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
stable
jochen 26 years ago
parent 90567a56b1
commit e6b2749f4b
  1. 29
      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++) {

Loading…
Cancel
Save