System property util might return null
Motivation: isAndroid0 should be robust. Modifications: yoda equals for string comparison. Result: No NPE.
This commit is contained in:
parent
4ed961f4fe
commit
01e46ed03a
@ -794,7 +794,7 @@ final class PlatformDependent0 {
|
|||||||
|
|
||||||
// Android sets this property to Dalvik, regardless of whether it actually is.
|
// Android sets this property to Dalvik, regardless of whether it actually is.
|
||||||
String vmName = SystemPropertyUtil.get("java.vm.name");
|
String vmName = SystemPropertyUtil.get("java.vm.name");
|
||||||
boolean isAndroid = vmName.equals("Dalvik");
|
boolean isAndroid = "Dalvik".equals(vmName);
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
logger.debug("Platform: Android");
|
logger.debug("Platform: Android");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user