From f4a2273beaeb619b88da9f7010ceb1c6bca8157d Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 21 Oct 1998 21:57:47 +0000 Subject: [PATCH] update parents git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@54 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/ComplexExpression.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jode/jode/expr/ComplexExpression.java b/jode/jode/expr/ComplexExpression.java index 053889d..9ec91a3 100644 --- a/jode/jode/expr/ComplexExpression.java +++ b/jode/jode/expr/ComplexExpression.java @@ -56,8 +56,8 @@ public class ComplexExpression extends Expression { } public Expression negate() { - if (operator.operator >= operator.COMPARE_OP && - operator.operator < operator.COMPARE_OP+6) { + if (operator.getOperatorIndex() >= operator.COMPARE_OP && + operator.getOperatorIndex() < operator.COMPARE_OP+6) { operator.setOperatorIndex(operator.getOperatorIndex() ^ 1); return this; } else if (operator.getOperatorIndex() == operator.LOG_AND_OP || @@ -65,6 +65,7 @@ public class ComplexExpression extends Expression { operator.setOperatorIndex(operator.getOperatorIndex() ^ 1); for (int i=0; i< subExpressions.length; i++) { subExpressions[i] = subExpressions[i].negate(); + subExpressions[i].parent = this; } return this; } else if (operator.operator == operator.LOG_NOT_OP) { @@ -99,6 +100,7 @@ public class ComplexExpression extends Expression { Expression combined = subExpressions[i].tryToCombine(e); if (combined != null) { subExpressions[i] = combined; + subExpressions[i].parent = this; return this; } } @@ -315,8 +317,10 @@ public class ComplexExpression extends Expression { return new ComplexExpression(new StringAddOperator(), exprs); } } - for (int i=0; i< subExpressions.length; i++) + for (int i=0; i< subExpressions.length; i++) { subExpressions[i] = (Expression) subExpressions[i].simplify(); + subExpressions[i].parent = this; + } return this; }