X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fibex%2Fclassgen%2FType.java;h=58622ec95e2fb1c935a43322408d4903595968f1;hb=e33a20a95b926b2e75f07564d672b3a42a6a180a;hp=08c346fba161b6773def91c5c6e7dd5a22e9b51b;hpb=e70f9a95d3058a30dc93d8d45078ece8bb7a7dc6;p=org.ibex.classgen.git diff --git a/src/org/ibex/classgen/Type.java b/src/org/ibex/classgen/Type.java index 08c346f..58622ec 100644 --- a/src/org/ibex/classgen/Type.java +++ b/src/org/ibex/classgen/Type.java @@ -97,15 +97,28 @@ public abstract class Type implements CGConst { public boolean isClass() { return true; } public static Type.Class instance(String className) { return (Type.Class)Type.fromDescriptor("L"+className.replace('.', '/')+";"); } - //public boolean extendsOrImplements(Type.Class c, Context cx) { } + public boolean extendsOrImplements(Type.Class c, Context cx) { + if (this==c) return true; + if (this==OBJECT) return false; + ClassFile cf = cx.resolve(getName()); + if (cf==null) { + System.err.println("warning: could not resolve class " + getName()); + return false; + } + if (cf.superType == c) return true; + for(int i=0; i