Skip to content

Commit

Permalink
Don't ignore NoClassDefFoundError's when linking at build time
Browse files Browse the repository at this point in the history
Closes: oracle#6253
  • Loading branch information
zakkak committed Apr 26, 2023
1 parent 1300858 commit 580fb3b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ protected void maybeEagerlyResolve(int cpi, int bytecode) {
try {
super.maybeEagerlyResolve(cpi, bytecode);
} catch (UnresolvedElementException e) {
if (e.getCause() instanceof LinkageError || e.getCause() instanceof IllegalAccessError) {
Throwable cause = e.getCause();
if (cause instanceof LinkageError && !(linkAtBuildTime && cause instanceof NoClassDefFoundError)) {
/*
* Ignore LinkageError if thrown from eager resolution attempt. This is usually
* followed by a call to ConstantPool.lookupType() which should return an
* UnresolvedJavaType which we know how to deal with.
* Ignore LinkageError if thrown from eager resolution attempt, unless linking
* at build time is enabled and the cause is a NoClassDefFoundError. This is
* usually followed by a call to ConstantPool.lookupType() which should return
* an UnresolvedJavaType which we know how to deal with.
*/
} else {
throw e;
Expand Down

0 comments on commit 580fb3b

Please sign in to comment.