Handle null Objects

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@276 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 8142839a41
commit 861edb2456
  1. 15
      jode/jode/expr/InvokeOperator.java

@ -139,7 +139,9 @@ public final class InvokeOperator extends Operator
isThis() ? operands[0] : "NON VIRTUAL " + operands[0]))
: (methodType.isStatic()
? (isThis() ? "" : classType.toString())
: (operands[0].equals("this") ? "" : operands[0]));
: (operands[0].equals("this") ? ""
: operands[0].equals("null") ? "((" + classType + ") null)"
: operands[0]));
int arg = methodType.isStatic() ? 0 : 1;
String method = isConstructor()
@ -155,6 +157,17 @@ public final class InvokeOperator extends Operator
return method+"("+params+")";
}
/**
* Checks if the method is the magic class$ method.
* @return true if this is the magic class$ method, false otherwise.
*/
public boolean isGetClass() {
if (!classType.equals(Type.tClass(codeAnalyzer.getClazz().getName())))
return false;
return codeAnalyzer.getClassAnalyzer()
.getMethod(methodName, methodType).isGetClass();
}
/* Invokes never equals: they may return different values even if
* they have the same parameters.
*/

Loading…
Cancel
Save