Skip to content

Commit

Permalink
Make DuplicateBranches a warning
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 697019132
  • Loading branch information
cushon authored and Error Prone Team committed Nov 25, 2024
1 parent 405b5c2 commit 9a6a727
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.Iterables.getLast;
import static com.google.errorprone.BugPattern.SeverityLevel.ERROR;
import static com.google.errorprone.BugPattern.SeverityLevel.WARNING;
import static com.google.errorprone.matchers.Description.NO_MATCH;
import static com.google.errorprone.util.ASTHelpers.getStartPosition;
import static java.util.stream.Collectors.joining;
Expand All @@ -36,7 +36,7 @@
import com.sun.source.tree.Tree.Kind;

/** A {@link BugChecker}; see the associated {@link BugPattern} annotation for details. */
@BugPattern(summary = "Both branches contain identical code", severity = ERROR)
@BugPattern(summary = "Both branches contain identical code", severity = WARNING)
public class DuplicateBranches extends BugChecker
implements IfTreeMatcher, ConditionalExpressionTreeMatcher {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ public static ScannerSupplier warningChecks() {
DoNotCallChecker.class,
DoNotMockChecker.class,
DoubleBraceInitialization.class,
DuplicateBranches.class,
DuplicateMapKeys.class,
DurationFrom.class,
DurationGetTemporalUnit.class,
Expand Down Expand Up @@ -912,6 +911,7 @@ public static ScannerSupplier warningChecks() {
DoNotClaimAnnotations.class,
DoNotMockAutoValue.class,
DoubleCheckedLocking.class,
DuplicateBranches.class,
DuplicateDateFormatField.class,
EmptyBlockTag.class,
EmptyCatch.class,
Expand Down

0 comments on commit 9a6a727

Please sign in to comment.