X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FUtil%2FLattice.java;h=bc024cfad9cd95f58d7b06bea451823bb879915b;hb=031636263ce6e4b6f35f3d9162460eb0ef536c2a;hp=22ed8d64f99c711882b2c9728e1f6390c54bd00c;hpb=f0aec2e998d39bd8474da2e98da70bbf7a4f5b15;p=IRC.git diff --git a/Robust/src/Util/Lattice.java b/Robust/src/Util/Lattice.java index 22ed8d64..bc024cfa 100644 --- a/Robust/src/Util/Lattice.java +++ b/Robust/src/Util/Lattice.java @@ -76,7 +76,9 @@ public class Lattice { topNeighbor.remove(value); // if key is already connected with bottom,, it is no longer to be - table.get(key).remove(getBottomItem()); + if (!value.equals(getBottomItem())) { + table.get(key).remove(getBottomItem()); + } return true; } else @@ -129,7 +131,9 @@ public class Lattice { Set neighborSet = get(a); - if (neighborSet == null) { + if (a.equals(b)) { + return true; + } else if (neighborSet == null) { return false; } else if (neighborSet.contains(b)) { return true; @@ -146,6 +150,10 @@ public class Lattice { public boolean isGreaterThan(T a, T b) { + if (a.equals(b)) { + return false; + } + if (a.equals(top)) { if (b.equals(top)) { return false;