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 12, 2020
1 parent a88d05a commit ee33249
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,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(Option.XLINT.getPrimaryName())
|| key.equals(Option.XLINT_CUSTOM.getPrimaryName())
|| key.equals(Option.XDOCLINT.getPrimaryName())
|| key.equals(Option.XDOCLINT_CUSTOM.getPrimaryName())
|| key.equals(Option.XDOCLINT_PACKAGE.getPrimaryName())
|| key.equals(Option.DOCLINT_FORMAT.getPrimaryName())) {
// 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 ee33249

Please sign in to comment.