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:
Johno Crawford 2018-02-09 15:58:54 +01:00 committed by Norman Maurer
parent 4ed961f4fe
commit 01e46ed03a

View File

@ -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");
} }