Skip to content

Commit

Permalink
Some more logging if rutime detection fails for some reason: helps wi…
Browse files Browse the repository at this point in the history
…th debugging
  • Loading branch information
uschindler committed Oct 12, 2015
1 parent e8bda56 commit 750176a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/de/thetaphi/forbiddenapis/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ public Checker(Logger logger, ClassLoader loader, EnumSet<Option> options) {
}
}
isSupportedJDK = !(bootClassPathJars.isEmpty() && bootClassPathDirs.isEmpty());
// logInfo("JARs in boot-classpath: " + bootClassPathJars + "; dirs in boot-classpath: " + bootClassPathDirs);
if (!isSupportedJDK) {
logger.warn("Boot classpath appears to be empty; marking runtime as not suppported.");
}
}
} catch (IOException ioe) {
logger.warn("Cannot scan boot classpath due to IO exception; marking runtime as not suppported: " + ioe);
isSupportedJDK = false;
bootClassPathJars.clear();
bootClassPathDirs.clear();
Expand All @@ -162,6 +165,9 @@ public Checker(Logger logger, ClassLoader loader, EnumSet<Option> options) {
if (isSupportedJDK) {
try {
isSupportedJDK = getClassFromClassLoader(Object.class.getName()).isRuntimeClass;
if (!isSupportedJDK) {
logger.warn("Bytecode of java.lang.Object does not seem to come from runtime library; marking runtime as not suppported.");
}
} catch (IllegalArgumentException iae) {
logger.warn("Bundled version of ASM cannot parse bytecode of java.lang.Object class; marking runtime as not suppported.");
isSupportedJDK = false;
Expand Down

0 comments on commit 750176a

Please sign in to comment.