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 31, 2024
1 parent 7fb6e86 commit 6f21f61
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,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 6f21f61

Please sign in to comment.