From 1123c02533d3d0f95581b36b9a01c099442e753a Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 6 Mar 1999 21:31:45 +0000 Subject: [PATCH] getHint added git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@301 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/type/ArrayType.java | 4 ++++ jode/jode/type/ClassInterfacesType.java | 10 ++++++++++ jode/jode/type/Type.java | 4 ++++ 3 files changed, 18 insertions(+) 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. */