InvokeOperator has new constructor syntax

Const/IInc-Operator.getValue() changed return type.


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1184 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 25 years ago
parent 75f42b3167
commit e00cff956c
  1. 4
      jode/jode/flow/CreateClassField.java
  2. 8
      jode/jode/flow/CreateConstantArray.java
  3. 2
      jode/jode/flow/CreateIfThenElseOperator.java
  4. 4
      jode/jode/flow/CreateNewConstructor.java
  5. 11
      jode/jode/flow/CreatePrePostIncExpression.java

@ -67,8 +67,8 @@ public class CreateClassField {
if (invoke.isGetClass()
&& param instanceof ConstOperator
&& param.getType().equals(Type.tString)) {
String clazz = ((ConstOperator)param).getValue();
&& ((ConstOperator)param).getValue() instanceof String) {
String clazz = (String) ((ConstOperator)param).getValue();
if (put.getField().setClassConstant(clazz)) {
cmp.setSubExpressions
(0, new ClassFieldOperator(clazz.charAt(0) == '['

@ -61,11 +61,11 @@ public class CreateConstantArray {
if (dup.type != SpecialBlock.DUP
|| dup.depth != 0 || dup.count != 1
|| !(indexOp.getType().isOfType(Type.tUInt))
|| !(indexOp.getValue() instanceof Integer)
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock))
return false;
int index = Integer.parseInt(indexOp.getValue());
int index = ((Integer) indexOp.getValue()).intValue();
InstructionBlock ib = (InstructionBlock)sequBlock.subBlocks[0];
if (ib.getInstruction() instanceof NewArrayOperator) {
@ -79,10 +79,10 @@ public class CreateConstantArray {
ConstOperator countop =
(ConstOperator) newArray.getSubExpressions()[0];
if (!countop.getType().isOfType(Type.tUInt))
if (!(countop.getValue() instanceof Integer))
return false;
int arraylength = Integer.parseInt(countop.getValue());
int arraylength = ((Integer) countop.getValue()).intValue();
if (arraylength <= index)
return false;

@ -96,7 +96,7 @@ public class CreateIfThenElseOperator {
(ConstOperator) pushBlock.getInstruction();
if (condBlock.trueBlock.jump.destination == trueDest
&& constOp.getValue().equals("0")) {
&& constOp.getValue().equals(new Integer(0))) {
Expression cond = condBlock.getInstruction();
condBlock.flowBlock.removeSuccessor(condBlock.trueBlock.jump);

@ -87,14 +87,14 @@ public class CreateNewConstructor {
Type appendType = appendCall.getMethodType().getParameterTypes()[0];
if (!appendType.equals(Type.tString)) {
InvokeOperator valueOf = new InvokeOperator
(methodAna, true, false,
(methodAna, InvokeOperator.STATIC,
Reference.getReference("Ljava/lang/String;", "valueOf",
"(" + appendType.getTypeSignature()
+ ")Ljava/lang/String;"));
expr = valueOf.addOperand(expr);
}
InvokeOperator newConstr = new InvokeOperator
(methodAna, false, true,
(methodAna, InvokeOperator.CONSTRUCTOR,
Reference.getReference("Ljava/lang/StringBuffer;", "<init>",
"(Ljava/lang/String;)V"));
newConstr.makeNonVoid();

@ -72,9 +72,9 @@ public class CreatePrePostIncExpression {
else
return false;
if (iinc.getValue().equals("-1"))
if (iinc.getValue() == -1)
op ^= 1;
else if (!iinc.getValue().equals("1"))
else if (iinc.getValue() != 1)
return false;
if (!iinc.lvalueMatches(load))
@ -134,11 +134,10 @@ public class CreatePrePostIncExpression {
else
return false;
if (constOp.getValue().equals("-1")
|| constOp.getValue().equals("-1.0"))
/* Why doubleValue? This is the most exact measurement. */
if (((Number)constOp.getValue()).doubleValue() == -1.0)
op ^= 1;
else if (!constOp.getValue().equals("1")
&& !constOp.getValue().equals("-1.0"))
else if (((Number)constOp.getValue()).doubleValue() != 1.0)
return false;
if (!(last.outer instanceof SequentialBlock))

Loading…
Cancel
Save