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 Jan 3, 2024
1 parent a84bab3 commit dc6015b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,17 @@ private Context createContext() {
// 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);
}
return context;
Expand Down

0 comments on commit dc6015b

Please sign in to comment.