mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-01 22:49:39 +08:00
refactor: java 5 migration aid - remove unnecessary boxing
This commit is contained in:
parent
08812bab56
commit
680407fa58
@ -84,7 +84,11 @@ public class CordovaPreferences {
|
|||||||
name = name.toLowerCase(Locale.ENGLISH);
|
name = name.toLowerCase(Locale.ENGLISH);
|
||||||
String value = prefs.get(name);
|
String value = prefs.get(name);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
return Double.valueOf(value);
|
try {
|
||||||
|
return Double.parseDouble(value);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// Failed to parse value and will fallback with default value.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user