Skip to content

Commit

Permalink
Avoid security exception capture by specifying target loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Mar 25, 2020
1 parent c4a2cb6 commit 6193017
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ enum CreationAction implements PrivilegedAction<Dispatcher> {
@SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception should not be rethrown but trigger a fallback")
public Dispatcher run() {
try {
Class<?> module = Class.forName("java.lang.Module");
Class<?> module = Class.forName("java.lang.Module", false, null); // e.g. Netbeans contains a comilation target proxy
try {
Class<?> instrumentation = Class.forName("java.lang.instrument.Instrumentation");
return new Dispatcher.Enabled.WithInstrumentationSupport(Class.class.getMethod("getModule"),
Expand All @@ -368,8 +368,6 @@ public Dispatcher run() {
return Dispatcher.Disabled.INSTANCE;
} catch (NoSuchMethodException ignored) {
return Dispatcher.Disabled.INSTANCE;
} catch (SecurityException ignored) {
return Dispatcher.Disabled.INSTANCE;
}
}
}
Expand Down

0 comments on commit 6193017

Please sign in to comment.