dfa minor

This commit is contained in:
peter
2013-02-03 22:42:56 +01:00
parent 8a3b6547f6
commit 83231fb653
3 changed files with 5 additions and 18 deletions
@@ -77,15 +77,8 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
newState.myEqClasses.add(aClass != null ? new SortedIntSet(aClass.toNativeArray()) : null);
}
try {
for (Object o : myVariableStates.keySet()) {
DfaVariableValue dfaVariableValue = (DfaVariableValue)o;
DfaVariableState clone = (DfaVariableState)myVariableStates.get(dfaVariableValue).clone();
newState.myVariableStates.put(dfaVariableValue, clone);
}
}
catch (CloneNotSupportedException e) {
LOG.error(e);
for (DfaVariableValue dfaVariableValue : myVariableStates.keySet()) {
newState.myVariableStates.put(dfaVariableValue, myVariableStates.get(dfaVariableValue).clone());
}
return newState;
}
@@ -280,13 +273,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
applyCondition(dfaEqual);
if (value instanceof DfaVariableValue) {
try {
DfaVariableState newState = (DfaVariableState)getVariableState((DfaVariableValue)value).clone();
myVariableStates.put(var, newState);
}
catch (CloneNotSupportedException e) {
LOG.error(e);
}
myVariableStates.put(var, getVariableState((DfaVariableValue)value).clone());
}
}
@@ -114,7 +114,7 @@ public class DfaVariableState implements Cloneable {
myNullable == aState.myNullable;
}
protected Object clone() throws CloneNotSupportedException {
protected DfaVariableState clone() {
return new DfaVariableState(this);
}
@@ -67,7 +67,7 @@ public class ValuableDataFlowRunner extends AnnotationsAwareDataFlowRunner {
return myValue;
}
protected Object clone() throws CloneNotSupportedException {
protected ValuableDfaVariableState clone() {
return new ValuableDfaVariableState(this);
}
}