From 1c92cf7c9589fa919726ecc80379d4169e1b2e6d Mon Sep 17 00:00:00 2001 From: Error Prone Team Date: Fri, 14 Oct 2022 17:00:36 -0700 Subject: [PATCH] Fix `-XepDisableAllWarnings` flag when passed on its own Without this change, the flag would not work when passed as the single Error Prone argument. Not sure how to add a regression test for this, but the fix works locally. Fixes #3462 FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/google/error-prone/pull/3462 from msridhar:fix-disable-all-warnings 89f2c1db33a7a2980e9b0e464345fb9cefc46171 PiperOrigin-RevId: 481263162 --- .../java/com/google/errorprone/scanner/ScannerSupplier.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_api/src/main/java/com/google/errorprone/scanner/ScannerSupplier.java b/check_api/src/main/java/com/google/errorprone/scanner/ScannerSupplier.java index 037b2c1f597..731c86d581e 100644 --- a/check_api/src/main/java/com/google/errorprone/scanner/ScannerSupplier.java +++ b/check_api/src/main/java/com/google/errorprone/scanner/ScannerSupplier.java @@ -143,7 +143,8 @@ public ScannerSupplier applyOverrides(ErrorProneOptions errorProneOptions) { && errorProneOptions.getFlags().isEmpty() && !errorProneOptions.isEnableAllChecksAsWarnings() && !errorProneOptions.isDropErrorsToWarnings() - && !errorProneOptions.isDisableAllChecks()) { + && !errorProneOptions.isDisableAllChecks() + && !errorProneOptions.isDisableAllWarnings()) { return this; }