From 9468543033da408ff88e172e24ed80dc68ba53a7 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 7 Mar 2013 19:59:10 +0100 Subject: [PATCH] diagnose different control flows in different passes (EA-28732) --- .../dataFlow/ControlFlowAnalyzer.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java b/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java index 0a92e0091f18..2f6b65045bd4 100644 --- a/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java +++ b/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java @@ -35,14 +35,9 @@ import com.intellij.util.containers.Stack; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; -import static com.intellij.psi.CommonClassNames.JAVA_LANG_ERROR; -import static com.intellij.psi.CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION; -import static com.intellij.psi.CommonClassNames.JAVA_LANG_THROWABLE; +import static com.intellij.psi.CommonClassNames.*; class ControlFlowAnalyzer extends JavaElementVisitor { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer"); @@ -91,7 +86,9 @@ class ControlFlowAnalyzer extends JavaElementVisitor { pass2Flow.setFields(myFields.toArray(new DfaVariableValue[myFields.size()])); - LOG.assertTrue(myPass1Flow.getInstructionCount() == pass2Flow.getInstructionCount()); + if (myPass1Flow.getInstructionCount() != pass2Flow.getInstructionCount()) { + LOG.error(Arrays.toString(myPass1Flow.getInstructions()) + "!=\n" + Arrays.toString(pass2Flow.getInstructions())); + } addInstruction(new ReturnInstruction());