fixed minor bugs
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / specExtraction / ConditionalInterface.java
index 791a2052d34b1274fd8f26ed6e9a5161383ee08f..2ef95a6a6ee403c0d46bcd3adadefeb82e4f8765 100644 (file)
@@ -3,24 +3,25 @@ package edu.uci.eecs.specCompiler.specExtraction;
 public class ConditionalInterface {
        public final String interfaceName;
        public final String hbConditionLabel;
-       
+
        public ConditionalInterface(String interfaceName, String hbConditionLabel) {
                this.interfaceName = interfaceName;
                this.hbConditionLabel = hbConditionLabel;
        }
-       
-       public boolean equals(ConditionalInterface other) {
+
+       public boolean equals(Object other) {
                if (!(other instanceof ConditionalInterface))
                        return false;
                ConditionalInterface another = (ConditionalInterface) other;
-               return another.interfaceName.equals(interfaceName) && 
-                               another.hbConditionLabel.equals(hbConditionLabel);
+               return another.interfaceName.equals(interfaceName)
+                               && (another.hbConditionLabel.equals(hbConditionLabel) || another.hbConditionLabel
+                                               .equals(""));
        }
-       
+
        public int hashCode() {
                return interfaceName.hashCode() << 5 ^ hbConditionLabel.hashCode();
        }
-       
+
        public String toString() {
                if (hbConditionLabel.equals(""))
                        return interfaceName + "(true)";