Skip to content

Commit

Permalink
Catch a linkage error and try to recover.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanStureNielsen authored and RobAustin committed Jul 18, 2020
1 parent 8776ead commit 9b12483
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,13 @@ private Class createClass() {

return CACHED_COMPILER.loadFromJava(classLoader, packageName + '.' + className, imports.toString());

} catch (LinkageError e) {
try {
return Class.forName(packageName + '.' + className, true, classLoader);
} catch (ClassNotFoundException x) {
throw Jvm.rethrow(x);
}
} catch (Throwable e) {
System.out.println(imports.toString());
e.printStackTrace();
throw Jvm.rethrow(new ClassNotFoundException(e.getMessage() + '\n' + imports, e));
}
}
Expand Down

0 comments on commit 9b12483

Please sign in to comment.