Skip to content

Commit d002850

Browse files
committed
Prevent AbortCompilation for AccessRestrictionTreeScanner
1 parent ad60232 commit d002850

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/AccessRestrictionTreeScanner.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,12 @@ private void collectProblemForFQN(String fqn, int startPos, int endPos, byte acc
411411
return;
412412
}
413413
char[][] fqnChar = Stream.of(fqn.split("\\.")).map(String::toCharArray).toArray(char[][]::new);
414-
NameEnvironmentAnswer ans = nameEnvironment.findType(fqnChar);
414+
NameEnvironmentAnswer ans = null;
415+
try {
416+
ans = nameEnvironment.findType(fqnChar);
417+
} catch (org.eclipse.jdt.internal.compiler.problem.AbortCompilation e) {
418+
// Can happen easily, ignore
419+
}
415420
if (ans != null && ans.getAccessRestriction() != null) {
416421
AccessRestriction accessRestriction = ans.getAccessRestriction();
417422
if (accessRestriction.getProblemId() == IProblem.ForbiddenReference || !this.isWarningSuppressed) {

0 commit comments

Comments
 (0)