Skip to content

Commit

Permalink
Don't lint during SuggestedFixes#compilesWithFix
Browse files Browse the repository at this point in the history
Under certain circumstances this avoids triggering a compiler bug. It is
also expected to speed up the trial compilation somewhat. The implicit
assumption here is that it is okay to suggest a fix which introduces
another warning. (This may not be so in general, but the introduced
warning may be less severe or may be resolved manually.)

See google#849.
  • Loading branch information
Stephan202 committed Aug 4, 2021
1 parent c1f315e commit 3b2f54b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,17 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOExcept
// but does add them in response to passing --release. Here we invert that operation.
continue;
}
if (key.equals("-Xlint")
|| key.equals("-Xlint:")
|| key.equals("-Xdoclint")
|| key.equals("-Xdoclint:")
|| key.equals("-Xdoclint/package:")
|| key.equals("--doclint-format")) {
// For unknown reasons retaining -Xdoclint:reference here can cause an NPE; see #849. Since
// suggested fixes are unlikely to introduce lint errors that cannot be fixed manually, here
// we disable all lint checks. This _may_ also speed up compilation.
continue;
}
options.put(key, value);
}
JavacTask newTask =
Expand Down

0 comments on commit 3b2f54b

Please sign in to comment.