summaryrefslogtreecommitdiffstats
path: root/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java')
-rw-r--r--org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java b/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java
index 93bf3be..19dd6b3 100644
--- a/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java
+++ b/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java
@@ -45,10 +45,7 @@ public class SymbolicState {
public SymbolicState copy() {
Set<PropertyState> ps = new HashSet<PropertyState>(propertyStates);
- ExecutionState es = new ExecutionState();
- for (ExecutionStateClause cl : executionState.getClauses()) {
- es.addClause(cl);
- }
+ ExecutionState es = executionState.copy();
Map<IVariable, Boolean> truthAssignments = new HashMap<IVariable, Boolean>(executionState.getTruthAssignments());
es.setTruthAssignments(truthAssignments);
@@ -65,4 +62,18 @@ public class SymbolicState {
buf.append("]");
return buf.toString();
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof SymbolicState) {
+ SymbolicState other = (SymbolicState) obj;
+ return propertyStates.equals(other.getPropertyStates()) && executionState.equals(other.getExecutionState());
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return propertyStates.hashCode() + executionState.hashCode();
+ }
}