Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ public boolean implies(ProtectionDomain domain, Permission permission) {
private static void addClassCodebase(Map<String, URL> codebases, String name, String classname) {
try {
Class<?> clazz = BootstrapForTesting.class.getClassLoader().loadClass(classname);
if (codebases.put(name, clazz.getProtectionDomain().getCodeSource().getLocation()) != null) {
throw new IllegalStateException("Already added " + name + " codebase for testing");
URL location = clazz.getProtectionDomain().getCodeSource().getLocation();
if (location.toString().endsWith(".jar") == false) {
if (codebases.put(name, location) != null) {
throw new IllegalStateException("Already added " + name + " codebase for testing");
}
}
} catch (ClassNotFoundException e) {
// no class, fall through to not add. this can happen for any tests that do not include
Expand Down