From e6b2749f4bbaaf6c162cfe2f5739937e110e4f32 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 29 Oct 1998 00:10:56 +0000 Subject: [PATCH] Better special handling, but needs more knowledge git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@103 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/InvokeOperator.java | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/jode/jode/expr/InvokeOperator.java b/jode/jode/expr/InvokeOperator.java index 1a3b777..cc79ea7 100644 --- a/jode/jode/expr/InvokeOperator.java +++ b/jode/jode/expr/InvokeOperator.java @@ -89,8 +89,25 @@ public final class InvokeOperator extends Operator { } public String toString(String[] operands) { - String object = - methodType.isStatic() + String object = null; + if (specialFlag) { + if (operands[0].equals("this")) { + Class clazz = codeAnalyzer.method.classAnalyzer.clazz; + object = ""; + while (clazz != null + && !classType.equals(Type.tType(clazz))) { + object = "super"; + clazz = clazz.getSuperclass(); + } + + if (clazz == null) + object = "ERROR-SPECIAL"; + } else + object = "ERROR-SPECIAL"; + } + + object = (object != null) ? object + : methodType.isStatic() ? (classType.equals(Type.tType(codeAnalyzer.getClazz())) ? "" : classType.toString()) @@ -103,11 +120,9 @@ public final class InvokeOperator extends Operator { : operands[0]); int arg = methodType.isStatic() ? 0 : 1; - String method; - if (isConstructor()) - method = (object.length() == 0 ? "this" : object); - else - method = (object.length() == 0 ? "" : object + ".") + methodName; + String method = isConstructor() + ? (object.length() == 0 ? "this" : object) + : (object.length() == 0 ? "" : object + ".") + methodName; StringBuffer params = new StringBuffer(); for (int i=0; i < methodType.getParameterTypes().length; i++) {