Skip to content

Commit

Permalink
Give DoubleBraceInitialization a promotion to ERROR, but disable in b…
Browse files Browse the repository at this point in the history
…uild_defs for a release.

PiperOrigin-RevId: 428774991
  • Loading branch information
graememorgan authored and Error Prone Team committed Feb 15, 2022
1 parent 7c299ef commit a4291da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.errorprone.bugpatterns;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.errorprone.BugPattern.SeverityLevel.WARNING;
import static com.google.errorprone.BugPattern.SeverityLevel.ERROR;
import static com.google.errorprone.matchers.Description.NO_MATCH;
import static com.google.errorprone.matchers.Matchers.expressionStatement;
import static com.google.errorprone.matchers.method.MethodMatchers.constructor;
Expand Down Expand Up @@ -66,7 +66,7 @@
summary =
"Prefer collection factory methods or builders to the double-brace initialization"
+ " pattern.",
severity = WARNING)
severity = ERROR)
public class DoubleBraceInitialization extends BugChecker implements NewClassTreeMatcher {

@SuppressWarnings("ImmutableEnumChecker") // Matcher is immutable in practice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ public static ScannerSupplier errorChecks() {
DiscardedPostfixExpression.class,
DoNotCallChecker.class,
DoNotMockChecker.class,
DoubleBraceInitialization.class,
DuplicateMapKeys.class,
DurationFrom.class,
DurationGetTemporalUnit.class,
Expand Down Expand Up @@ -807,7 +808,6 @@ public static ScannerSupplier errorChecks() {
DoNotCallSuggester.class,
DoNotClaimAnnotations.class,
DoNotMockAutoValue.class,
DoubleBraceInitialization.class,
DoubleCheckedLocking.class,
EmptyBlockTag.class,
EmptyCatch.class,
Expand Down

0 comments on commit a4291da

Please sign in to comment.