Skip to content

Commit

Permalink
MatchLocator: enrich RuntimeException with filename
Browse files Browse the repository at this point in the history
During internal errors it is not clear which file did contain the
problematic binary. For example:

#3516

Example output will be like: "java.lang.RuntimeException:
RuntimeException caching =P/libGh375.jar|TestGh375.class"
  • Loading branch information
jukzi committed Jan 7, 2025
1 parent 8c8f5cd commit c7cf381
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,15 @@ protected BinaryTypeBinding cacheBinaryType(IType type, IBinaryType binaryType)
}
}
}
BinaryTypeBinding binding = this.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
BinaryTypeBinding binding;
try {
binding = this.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
} catch (AbortCompilation e) {
throw e;
} catch (RuntimeException e) {
throw new RuntimeException("RuntimeException caching " + new String(binaryType.getFileName()), e); //$NON-NLS-1$
}

if (binding == null) { // it was already cached as a result of a previous query
char[][] compoundName = CharOperation.splitOn('.', type.getFullyQualifiedName().toCharArray());
ReferenceBinding referenceBinding = this.lookupEnvironment.getCachedType(compoundName);
Expand Down

0 comments on commit c7cf381

Please sign in to comment.