From 8bdb47b62578aee3b93e9d5cf8ce3a3af0014d47 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 13 Apr 1999 10:46:22 +0000 Subject: [PATCH] ref.getClazz() is now type sig git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@578 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/InvokeOperator.java | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/jode/jode/expr/InvokeOperator.java b/jode/jode/expr/InvokeOperator.java index 5d3b7d6..ecc1201 100644 --- a/jode/jode/expr/InvokeOperator.java +++ b/jode/jode/expr/InvokeOperator.java @@ -36,7 +36,7 @@ public final class InvokeOperator extends Operator boolean specialFlag; MethodType methodType; String methodName; - ClassInfo clazz; + Type clazz; public InvokeOperator(CodeAnalyzer codeAnalyzer, boolean staticFlag, boolean specialFlag, @@ -44,13 +44,13 @@ public final class InvokeOperator extends Operator super(Type.tUnknown, 0); this.methodType = (MethodType) Type.tType(reference.getType()); this.methodName = reference.getName(); - this.clazz = ClassInfo.forName(reference.getClazz()); + this.clazz = Type.tType(reference.getClazz()); this.type = methodType.getReturnType(); this.codeAnalyzer = codeAnalyzer; this.staticFlag = staticFlag; this.specialFlag = specialFlag; if (staticFlag) - Type.tClass(clazz.getName()).useType(); + clazz.useType(); } /** @@ -85,7 +85,7 @@ public final class InvokeOperator extends Operator } public Type getClassType() { - return Type.tClass(clazz.getName()); + return clazz; } public int getPriority() { @@ -125,7 +125,11 @@ public final class InvokeOperator extends Operator * allow super class */ public boolean isThis() { - return (clazz == codeAnalyzer.getClazz()); + if (clazz instanceof ClassInterfacesType) { + return ((ClassInterfacesType) clazz).getClassInfo() + == codeAnalyzer.getClazz(); + } + return false; } /** @@ -133,7 +137,11 @@ public final class InvokeOperator extends Operator * @XXX check, if its the first super class that implements the method. */ public boolean isSuperOrThis() { - return clazz.superClassOf(codeAnalyzer.getClazz()); + if (clazz instanceof ClassInterfacesType) { + return ((ClassInterfacesType) clazz).getClassInfo() + .superClassOf(codeAnalyzer.getClazz()); + } + return false; } public String toString(String[] operands) { @@ -147,7 +155,7 @@ public final class InvokeOperator extends Operator ? (isThis() ? "" : clazz.toString()) : (operands[0].equals("this") ? "" : operands[0].equals("null") - ? "((" + clazz.getName() + ") null)" + ? "((" + clazz.toString() + ") null)" : operands[0])); int arg = isStatic() ? 0 : 1; @@ -179,8 +187,8 @@ public final class InvokeOperator extends Operator public Object invokeMethod(Reference ref, boolean isVirtual, Object cls, Object[] params) throws InterpreterException, InvocationTargetException { - if (ref.getClazz().equals(codeAnalyzer.getClazz().getName())) { - + if (ref.getClazz().equals + ("L"+codeAnalyzer.getClazz().getName().replace('.','/')+";")) { MethodType mt = (MethodType) Type.tType(ref.getType()); BytecodeInfo info = codeAnalyzer.getClassAnalyzer() .getMethod(ref.getName(), mt).getCode().getBytecodeInfo();