From 39fdeddfe3484f3eb7f9a97c917299c6c68a5547 Mon Sep 17 00:00:00 2001 From: markbrady Date: Thu, 20 Jun 2024 19:20:22 -0700 Subject: [PATCH] FORCE on check PiperOrigin-RevId: 645227800 --- .../StatementSwitchToExpressionSwitch.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitch.java b/core/src/main/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitch.java index ce273dc7587..8b642e082ab 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitch.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitch.java @@ -47,7 +47,6 @@ import com.google.errorprone.util.ASTHelpers; import com.google.errorprone.util.ErrorProneComment; import com.google.errorprone.util.Reachability; -import com.google.errorprone.util.SourceVersion; import com.sun.source.tree.AssignmentTree; import com.sun.source.tree.BlockTree; import com.sun.source.tree.BreakTree; @@ -135,7 +134,10 @@ static enum CaseQualifications { @Inject StatementSwitchToExpressionSwitch(ErrorProneFlags flags) { this.enableDirectConversion = - flags.getBoolean("StatementSwitchToExpressionSwitch:EnableDirectConversion").orElse(false); + true + || flags + .getBoolean("StatementSwitchToExpressionSwitch:EnableDirectConversion") + .orElse(false); this.enableReturnSwitchConversion = flags .getBoolean("StatementSwitchToExpressionSwitch:EnableReturnSwitchConversion") @@ -148,9 +150,9 @@ static enum CaseQualifications { @Override public Description matchSwitch(SwitchTree switchTree, VisitorState state) { - if (!SourceVersion.supportsSwitchExpressions(state.context)) { - return NO_MATCH; - } + // if (!SourceVersion.supportsSwitchExpressions(state.context)) { + // return NO_MATCH; + // } AnalysisResult analysisResult = analyzeSwitchTree(switchTree, state);