added cast if necessary.

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1154 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 26 years ago
parent 2402d437c1
commit 567209f324
  1. 7
      jode/jode/expr/IfThenElseOperator.java

@ -104,6 +104,13 @@ public class IfThenElseOperator extends Operator {
throws java.io.IOException { throws java.io.IOException {
subExpressions[0].dumpExpression(writer, 201); subExpressions[0].dumpExpression(writer, 201);
writer.print(" ? "); writer.print(" ? ");
if (!subExpressions[1].getType().getHint().isOfType
(subExpressions[2].getType())) {
/* We need a cast here */
writer.print("(");
writer.printType(getType().getHint());
writer.print(") ");
}
subExpressions[1].dumpExpression(writer, 0); subExpressions[1].dumpExpression(writer, 0);
writer.print(" : "); writer.print(" : ");
subExpressions[2].dumpExpression(writer, 200); subExpressions[2].dumpExpression(writer, 200);

Loading…
Cancel
Save