Handle INVOKESPECIAL, where the class expression isn't this.

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1238 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 25 years ago
parent 60889790b5
commit 7a3d90542b
  1. 22
      jode/jode/expr/InvokeOperator.java.in

@ -964,7 +964,10 @@ public final class InvokeOperator extends Operator
break; break;
} }
case SPECIAL: case SPECIAL:
if (isSuperOrThis()) { if (isSuperOrThis()
&& subExpressions[0] instanceof ThisOperator
&& (((ThisOperator)subExpressions[0]).getClassInfo()
== methodAnalyzer.getClazz())) {
if (!isThis()) { if (!isThis()) {
/* We don't have to check if this is the real super /* We don't have to check if this is the real super
* class, as long as ACC_SUPER is set. * class, as long as ACC_SUPER is set.
@ -978,6 +981,23 @@ public final class InvokeOperator extends Operator
} else { } else {
/* XXX check if this is a private method. */ /* XXX check if this is a private method. */
} }
} else if (isThis()) {
/* XXX check if this is a private method. */
if (needsCast(0, paramTypes)){
writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1);
writer.print("(");
writer.printType(classType);
writer.print(") ");
writer.breakOp();
subExpressions[0].dumpExpression(writer, 700);
writer.endOp();
writer.print(")");
paramTypes[0] = classType;
} else
subExpressions[0].dumpExpression(writer, 950);
writer.breakOp();
writer.print(".");
} else { } else {
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(writer.EXPL_PAREN, 0);

Loading…
Cancel
Save