Handle another transitive classpath fallback case
Completion failures are usually caught and printed at the top-level, but
if they occur inside an Error Prone check they get wrapped and reported
as error diagnostics.
MOS_MIGRATED_REVID=145322258
@@ -77,7 +77,6 @@ public class ReducedClasspathJavaLibraryBuilder extends SimpleJavaLibraryBuilder
return false;
}
for (FormattedDiagnostic diagnostic : result.diagnostics()) {
- System.err.println(diagnostic.getCode());
String code = diagnostic.getCode();
if (code.contains("doesnt.exist")
|| code.contains("cant.resolve")
@@ -89,6 +88,13 @@ public class ReducedClasspathJavaLibraryBuilder extends SimpleJavaLibraryBuilder
if (diagnostic.getFormatted().contains("error: reference not found")) {
return true;
}
+ // Error Prone wraps completion failures
+ if (code.equals("compiler.err.error.prone.crash")
+ && diagnostic
+ .getFormatted()
+ .contains("com.sun.tools.javac.code.Symbol$CompletionFailure")) {
+ return true;
+ }
}
if (result.output().contains("com.sun.tools.javac.code.Symbol$CompletionFailure")) {
return true;
