diff --git a/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java b/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java index 3b33d456c29..c218df1f78c 100644 --- a/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java +++ b/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java @@ -1402,6 +1402,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;