changes: now Inference engine works fine with the EyeTracking benchmark.
[IRC.git] / Robust / src / Analysis / SSJava / Location.java
index 98a05497131af40d7898f5fd74b086067678750f..6137379c93fb91bbd1f6e53f195a9454a1fc8c1f 100644 (file)
@@ -14,6 +14,12 @@ public class Location implements TypeExtension {
   String loc;
   Descriptor locDesc;
 
+  public Location(Descriptor enclosingDesc, Descriptor locDesc) {
+    this.d = enclosingDesc;
+    this.locDesc = locDesc;
+    this.loc = locDesc.getSymbol();
+  }
+
   public Location(Descriptor d, String loc) {
     this.d = d;
     this.loc = loc;
@@ -79,7 +85,10 @@ public class Location implements TypeExtension {
           return true;
         }
       } else {
-        if (loc.getLocIdentifier().equals(getLocIdentifier())) {
+        if (loc.getLocDescriptor() != null && getLocDescriptor() != null
+            && loc.getLocDescriptor().equals(getLocDescriptor())) {
+          return true;
+        } else if (loc.getLocIdentifier().equals(getLocIdentifier())) {
           return true;
         }
       }
@@ -94,6 +103,9 @@ public class Location implements TypeExtension {
     if (loc != null) {
       hash += loc.hashCode();
     }
+    if (locDesc != null) {
+      hash += locDesc.hashCode();
+    }
     return hash;
 
   }