Bug correction
[IRC.git] / Robust / src / IR / TypeDescriptor.java
index 04a717ed0161d78d669cf295a64186760c6f1b6c..bcafc03b44c7bef67bdf512c53b03c7a4a532f44 100644 (file)
@@ -30,7 +30,7 @@ public class TypeDescriptor extends Descriptor {
            TypeDescriptor t=(TypeDescriptor)o;
            if (t.type!=type)
                return false;
-           if ((type==CLASS)&&(t.class_desc!=class_desc))
+           if ((type==CLASS)&&(!t.getSymbol().equals(getSymbol())))
                return false;
            if (t.arraycount!=arraycount)
                return false;
@@ -39,6 +39,16 @@ public class TypeDescriptor extends Descriptor {
        return false;
     }
 
+    public boolean isString() {
+       if (type!=CLASS)
+           return false;
+       if (arraycount>0)
+           return false;
+       if (!getSymbol().equals(TypeUtil.StringClass))
+           return false;
+       return true;
+    }
+
     public int hashCode() {
        int hashcode=type^arraycount;
        if (type==CLASS)
@@ -243,9 +253,19 @@ public class TypeDescriptor extends Descriptor {
     }
 
     public String toString() {
-       if (type==CLASS)
+       if (type==CLASS) {
            return name;
-       else 
+       } else 
+           return decodeInt(type);
+    }
+
+    public String toPrettyString() {
+       if (type==CLASS) {
+           String str=name;
+           for(int i=0;i<arraycount;i++)
+               str+="[]";
+           return str;
+       } else 
            return decodeInt(type);
     }