diff --git a/jode/jode/type/ClassInterfacesType.java b/jode/jode/type/ClassInterfacesType.java index 28c76de..76561fa 100644 --- a/jode/jode/type/ClassInterfacesType.java +++ b/jode/jode/type/ClassInterfacesType.java @@ -397,6 +397,15 @@ public class ClassInterfacesType extends ReferenceType { return "Ljava/lang/Object;"; } + public Class getTypeClass() throws ClassNotFoundException { + if (clazz != null) + return Class.forName(clazz.getName()); + else if (ifaces.length > 0) + return Class.forName(ifaces[0].getName()); + else + return Class.forName("java.lang.Object"); + } + public String toString() { if (this == tObject) diff --git a/jode/jode/type/IntegerType.java b/jode/jode/type/IntegerType.java index bd38e2f..ecc4367 100644 --- a/jode/jode/type/IntegerType.java +++ b/jode/jode/type/IntegerType.java @@ -163,6 +163,22 @@ public class IntegerType extends Type { } } + public Class getTypeClass() { + switch (((IntegerType)getHint()).possTypes) { + case IT_Z: + return Boolean.TYPE; + case IT_C: + return Character.TYPE; + case IT_B: + return Byte.TYPE; + case IT_S: + return Short.TYPE; + case IT_I: + default: + return Integer.TYPE; + } + } + public String toString() { switch (possTypes) { case IT_Z: diff --git a/jode/jode/type/RangeType.java b/jode/jode/type/RangeType.java index 7e21573..1ff85a9 100644 --- a/jode/jode/type/RangeType.java +++ b/jode/jode/type/RangeType.java @@ -122,6 +122,13 @@ public class RangeType extends Type { return bottomType.getTypeSignature(); } + public Class getTypeClass() throws ClassNotFoundException { + if (topType.isClassType() || !bottomType.isValidType()) + return topType.getTypeClass(); + else + return bottomType.getTypeClass(); + } + public String toString() { if (topType == tNull)