Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DuplicateBranches a warning #4700

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading