diff --git a/jode/jode/type/ArrayType.java b/jode/jode/type/ArrayType.java index e67a7e5..4d27d93 100644 --- a/jode/jode/type/ArrayType.java +++ b/jode/jode/type/ArrayType.java @@ -53,6 +53,10 @@ public class ArrayType extends Type { return tArray(elementType.getTop()); } + public Type getHint() { + return tArray(elementType.getHint()); + } + static boolean implementsAllIfaces(ClassInfo[] otherIfaces) { big: for (int i=0; i < otherIfaces.length; i++) { diff --git a/jode/jode/type/ClassInterfacesType.java b/jode/jode/type/ClassInterfacesType.java index fd9bb8f..4050611 100644 --- a/jode/jode/type/ClassInterfacesType.java +++ b/jode/jode/type/ClassInterfacesType.java @@ -80,6 +80,16 @@ public class ClassInterfacesType extends Type { return new ClassInterfacesType(clazz, ifaces); } + public Type getHint() { + if (ifaces.length == 0 + || (clazz == null && ifaces.length == 1)) + return this; + if (clazz != null) + return Type.tClass(clazz.getName()); + else + return Type.tClass(ifaces[0].getName()); + } + /** * Create the type corresponding to the range from bottomType to * this. Checks if the given type range may be not empty. This diff --git a/jode/jode/type/Type.java b/jode/jode/type/Type.java index a22dfe2..df48bb3 100644 --- a/jode/jode/type/Type.java +++ b/jode/jode/type/Type.java @@ -218,6 +218,10 @@ public class Type { return (this == tBoolByte || this == tBoolInt) ? tUnknown : this; } + public Type getHint() { + return this; + } + /** * @return the type code of the type. */