Skip to content

Commit

Permalink
Issue #39: Some improvements and prevent NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
uschindler committed Mar 29, 2015
1 parent 689c8aa commit 708957d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/de/thetaphi/forbiddenapis/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public Checker(ClassLoader loader, boolean internalRuntimeForbidden, boolean fai
final Set<File> bootClassPathJars = new LinkedHashSet<File>();
final Set<String> bootClassPathDirs = new LinkedHashSet<String>();
try {
final boolean isJava9Modules = "jrt".equalsIgnoreCase(loader.getResource(Object.class.getName().replace('.','/') + ".class").getProtocol());
if (isJava9Modules) {
final URL objectClassURL = loader.getResource("java/lang/Object.class");
if (objectClassURL != null && "jrt".equalsIgnoreCase(objectClassURL.getProtocol())) {
// this is Java 9 with modules!
isSupportedJDK = true;
} else {
final RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
Expand Down

0 comments on commit 708957d

Please sign in to comment.