mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Report DFA exception if myFlow.toString() fails
GitOrigin-RevId: 59409b57cb752d53d48122510925cf59be4b2ea3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c2c2b450f1
commit
746cb5401f
+19
-7
@@ -22,7 +22,10 @@ import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Standard interpreter implementation
|
||||
@@ -362,13 +365,22 @@ public class StandardDataFlowInterpreter implements DataFlowInterpreter {
|
||||
|
||||
private void reportDfaProblem(@Nullable DfaInstructionState lastInstructionState, @NotNull Throwable e) {
|
||||
Attachment[] attachments = {new Attachment("method_body.txt", myPsiAnchor.getText())};
|
||||
String flowText = myFlow.toString();
|
||||
if (lastInstructionState != null) {
|
||||
int index = lastInstructionState.getInstruction().getIndex();
|
||||
flowText = flowText.replaceAll("(?m)^", " ");
|
||||
flowText = flowText.replaceFirst("(?m)^ {2}" + index + ": ", "* " + index + ": ");
|
||||
try {
|
||||
String flowText = myFlow.toString();
|
||||
if (lastInstructionState != null) {
|
||||
int index = lastInstructionState.getInstruction().getIndex();
|
||||
flowText = flowText.replaceAll("(?m)^", " ");
|
||||
flowText = flowText.replaceFirst("(?m)^ {2}" + index + ": ", "* " + index + ": ");
|
||||
}
|
||||
attachments = ArrayUtil.append(attachments, new Attachment("flow.txt", flowText));
|
||||
}
|
||||
catch (ProcessCanceledException pce) {
|
||||
throw pce;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ex.addSuppressed(e);
|
||||
LOG.error("While gathering flow text", ex);
|
||||
}
|
||||
attachments = ArrayUtil.append(attachments, new Attachment("flow.txt", flowText));
|
||||
if (lastInstructionState != null) {
|
||||
DfaMemoryState memoryState = lastInstructionState.getMemoryState();
|
||||
String memStateText = null;
|
||||
|
||||
Reference in New Issue
Block a user