diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/IgnoredPureGetter.java b/core/src/main/java/com/google/errorprone/bugpatterns/IgnoredPureGetter.java index 3b9e6f10f02..16fc6b5c978 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/IgnoredPureGetter.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/IgnoredPureGetter.java @@ -16,7 +16,7 @@ package com.google.errorprone.bugpatterns; -import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; +import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.util.ASTHelpers.getReceiver; import static com.google.errorprone.util.ASTHelpers.getSymbol; import static com.google.errorprone.util.ASTHelpers.hasAnnotation; @@ -43,7 +43,7 @@ /** Flags ignored return values from pure getters. */ @BugPattern( - severity = ERROR, + severity = WARNING, summary = "Getters on AutoValues, AutoBuilders, and Protobuf Messages are side-effect free, so there" + " is no point in calling them if the return value is ignored. While there are no" diff --git a/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java b/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java index 98719bca0ce..dcf8e0ed625 100644 --- a/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java +++ b/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java @@ -670,7 +670,6 @@ public static ScannerSupplier errorChecks() { HashtableContains.class, IdentityBinaryExpression.class, IdentityHashMapBoxing.class, - IgnoredPureGetter.class, ImmutableChecker.class, ImpossibleNullComparison.class, Incomparable.class, @@ -862,6 +861,7 @@ public static ScannerSupplier errorChecks() { GetClassOnEnum.class, HidingField.class, IdentityHashMapUsage.class, + IgnoredPureGetter.class, ImmutableAnnotationChecker.class, ImmutableEnumChecker.class, InconsistentCapitalization.class,