mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test failed under log debug
This commit is contained in:
@@ -18,7 +18,6 @@ package com.intellij.psi.controlFlow;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiStatement;
|
||||
import com.intellij.util.containers.Stack;
|
||||
import gnu.trove.TObjectIntHashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -37,7 +36,7 @@ class ControlFlowImpl implements ControlFlow {
|
||||
|
||||
private final Stack<PsiElement> myElementStack = new Stack<PsiElement>();
|
||||
|
||||
public void addInstruction(Instruction instruction) {
|
||||
void addInstruction(Instruction instruction) {
|
||||
myInstructions.add(instruction);
|
||||
myElementsForInstructions.add(myElementStack.peek());
|
||||
}
|
||||
@@ -45,20 +44,9 @@ class ControlFlowImpl implements ControlFlow {
|
||||
public void startElement(PsiElement element) {
|
||||
myElementStack.push(element);
|
||||
myElementToStartOffsetMap.put(element, myInstructions.size());
|
||||
|
||||
if (LOG.isDebugEnabled()){
|
||||
if (element instanceof PsiStatement){
|
||||
String text = element.getText();
|
||||
int index = Math.min(text.indexOf('\n'), text.indexOf('\r'));
|
||||
if (index >= 0){
|
||||
text = text.substring(0, index);
|
||||
}
|
||||
addInstruction(new CommentInstruction(text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void finishElement(PsiElement element) {
|
||||
void finishElement(PsiElement element) {
|
||||
PsiElement popped = myElementStack.pop();
|
||||
LOG.assertTrue(popped.equals(element));
|
||||
myElementToEndOffsetMap.put(element, myInstructions.size());
|
||||
@@ -101,7 +89,7 @@ class ControlFlowImpl implements ControlFlow {
|
||||
public boolean isConstantConditionOccurred() {
|
||||
return myConstantConditionOccurred;
|
||||
}
|
||||
public void setConstantConditionOccurred(boolean constantConditionOccurred) {
|
||||
void setConstantConditionOccurred(boolean constantConditionOccurred) {
|
||||
myConstantConditionOccurred = constantConditionOccurred;
|
||||
}
|
||||
|
||||
@@ -111,7 +99,7 @@ class ControlFlowImpl implements ControlFlow {
|
||||
Instruction instruction = myInstructions.get(i);
|
||||
buffer.append(Integer.toString(i));
|
||||
buffer.append(": ");
|
||||
buffer.append(instruction.toString());
|
||||
buffer.append(instruction);
|
||||
buffer.append("\n");
|
||||
}
|
||||
return buffer.toString();
|
||||
|
||||
Reference in New Issue
Block a user