Be more robust to broken java_runtime_dir

If java_runtime_dir in wala.properties is invalid, fall back to the
boot class path instead of just failing.
This commit is contained in:
Manu Sridharan 2015-12-16 10:56:09 -08:00
parent 46a483f320
commit e95663e24a
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ public final class WalaProperties {
}
String dir = p.getProperty(WalaProperties.J2SE_DIR);
Assertions.productionAssertion(dir != null);
if (dir == null || !(new File(dir)).isDirectory()) {
System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid. Using boot class path instead.");
return PlatformUtil.getBootClassPathJars();
}
return getJarsInDirectory(dir);
}