diff --git a/jode/jode/expr/CheckCastOperator.java b/jode/jode/expr/CheckCastOperator.java index 4523161..d5e2430 100644 --- a/jode/jode/expr/CheckCastOperator.java +++ b/jode/jode/expr/CheckCastOperator.java @@ -20,11 +20,10 @@ package jode; public class CheckCastOperator extends SimpleOperator { - String typeString; + Type castType; - public CheckCastOperator(Type type, String typeString) { + public CheckCastOperator(Type type) { super(type, 0, 1); - this.typeString = typeString; /* The following is wrong. The operand must not * be a super type of the given type, but any type * especially if type is an interface. @@ -36,6 +35,7 @@ public class CheckCastOperator extends SimpleOperator { * * The forgiving solution: */ + castType = type; operandTypes[0] = Type.tUnknown; } @@ -48,6 +48,6 @@ public class CheckCastOperator extends SimpleOperator { } public String toString(String[] operands) { - return "(" + typeString + ")" + operands[0]; + return "(" + castType.toString() + ")" + operands[0]; } } diff --git a/jode/jode/expr/InstanceOfOperator.java b/jode/jode/expr/InstanceOfOperator.java index c5fb338..1ba2879 100644 --- a/jode/jode/expr/InstanceOfOperator.java +++ b/jode/jode/expr/InstanceOfOperator.java @@ -20,9 +20,10 @@ package jode; public class InstanceOfOperator extends SimpleOperator { - String typeString; - public InstanceOfOperator(Type type, String typeString) { + Type instanceType; + + public InstanceOfOperator(Type type) { super(Type.tBoolean, 0, 1); /* The following is wrong. The operand must not * be a super type of the given type, but any type @@ -35,8 +36,8 @@ public class InstanceOfOperator extends SimpleOperator { * * The forgiving solution: */ + this.instanceType = type; this.operandTypes[0] = Type.tUnknown; - this.typeString = typeString; } public int getOperandCount() { return 1; @@ -51,6 +52,6 @@ public class InstanceOfOperator extends SimpleOperator { } public String toString(String[] operands) { - return operands[0] + " instanceof "+typeString; + return operands[0] + " instanceof "+instanceType; } } diff --git a/jode/jode/expr/NewOperator.java b/jode/jode/expr/NewOperator.java index 9130a8b..1fd29b4 100644 --- a/jode/jode/expr/NewOperator.java +++ b/jode/jode/expr/NewOperator.java @@ -20,11 +20,8 @@ package jode; public class NewOperator extends NoArgOperator { - String typeString; - - public NewOperator(Type type, String typeString) { + public NewOperator(Type type) { super(type); - this.typeString = typeString; } public int getPriority() { @@ -32,6 +29,6 @@ public class NewOperator extends NoArgOperator { } public String toString(String[] operands) { - return "new "+typeString; + return "new "+type.toString(); } }