From: stephey Date: Fri, 14 Jan 2011 01:58:39 +0000 (+0000) Subject: RCR was only one using Tuple.java so I renamed it to Pair.java. Checked that nothing... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4f48c0b826dd5f9596483cd106590d337018fc6b;p=IRC.git RCR was only one using Tuple.java so I renamed it to Pair.java. Checked that nothing broke. --- diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index 03b16892..6b422473 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -8,7 +8,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Set; import java.util.Vector; -import Util.Tuple; +import Util.Pair; import Analysis.Disjoint.*; import Analysis.MLP.CodePlan; import IR.State; @@ -45,8 +45,8 @@ public class RuntimeConflictResolver { //This keeps track of taints we've traversed to prevent printing duplicate traverse functions //The Integer keeps track of the weakly connected group it's in (used in enumerateHeapRoots) private Hashtable doneTaints; - private Hashtable idMap=new Hashtable(); - private Hashtable weakMap=new Hashtable(); + private Hashtable idMap=new Hashtable(); + private Hashtable weakMap=new Hashtable(); private Hashtable> globalEffects; private Hashtable> globalConflicts; @@ -326,11 +326,11 @@ public class RuntimeConflictResolver { } public int getWeakID(TempDescriptor invar, FlatNode fn) { - return weakMap.get(new Tuple(invar, fn)).intValue(); + return weakMap.get(new Pair(invar, fn)).intValue(); } public int getTraverserID(TempDescriptor invar, FlatNode fn) { - Tuple t=new Tuple(invar, fn); + Pair t=new Pair(invar, fn); if (idMap.containsKey(t)) return idMap.get(t).intValue(); int value=currentID++; @@ -974,7 +974,7 @@ public class RuntimeConflictResolver { if(t.isRBlockTaint()) { int id=connectedHRHash.get(t).id; - Tuple tup=new Tuple(t.getVar(),t.getSESE()); + Pair tup=new Pair(t.getVar(),t.getSESE()); if (weakMap.containsKey(tup)) { if (weakMap.get(tup).intValue()!=id) throw new Error("Var/SESE not unique for weak component."); diff --git a/Robust/src/Util/Pair.java b/Robust/src/Util/Pair.java new file mode 100644 index 00000000..dea902c9 --- /dev/null +++ b/Robust/src/Util/Pair.java @@ -0,0 +1,19 @@ +package Util; + +public class Pair { + private Object a; + private Object b; + public Pair(Object a, Object b) { + this.a=a; + this.b=b; + } + public int hashCode() { + return a.hashCode()*31+b.hashCode(); + } + public boolean equals(Object o) { + if (!(o instanceof Pair)) + return false; + Pair t=(Pair)o; + return a.equals(t.a)&&b.equals(t.b); + } +} \ No newline at end of file diff --git a/Robust/src/Util/Tuple.java b/Robust/src/Util/Tuple.java deleted file mode 100644 index 2859717d..00000000 --- a/Robust/src/Util/Tuple.java +++ /dev/null @@ -1,19 +0,0 @@ -package Util; - -public class Tuple { - private Object a; - private Object b; - public Tuple(Object a, Object b) { - this.a=a; - this.b=b; - } - public int hashCode() { - return a.hashCode()*31+b.hashCode(); - } - public boolean equals(Object o) { - if (!(o instanceof Tuple)) - return false; - Tuple t=(Tuple)o; - return a.equals(t.a)&&b.equals(t.b); - } -} \ No newline at end of file