bug fix: print empty if values[i] is null

only print "new xxx[]"  if not in initializer


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@632 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 78eb752b08
commit cbaa186d67
  1. 6
      jode/jode/expr/ConstantArrayOperator.java

@ -97,8 +97,11 @@ public class ConstantArrayOperator extends NoArgOperator {
public void dumpExpression(TabbedPrintWriter writer, public void dumpExpression(TabbedPrintWriter writer,
Expression[] operands) Expression[] operands)
throws java.io.IOException { throws java.io.IOException {
if (!isInitializer) {
writer.print("new "); writer.print("new ");
writer.printType(type); writer.printType(type);
writer.print(" ");
}
writer.println("{"); writer.println("{");
writer.tab(); writer.tab();
for (int i=0; i< values.length; i++) { for (int i=0; i< values.length; i++) {
@ -108,7 +111,10 @@ public class ConstantArrayOperator extends NoArgOperator {
else else
writer.print(", "); writer.print(", ");
} }
if (values[i] != null)
values[i].dumpExpression(writer, 0); values[i].dumpExpression(writer, 0);
else
empty.dumpExpression(writer, 0);
} }
writer.println(); writer.println();
writer.untab(); writer.untab();

Loading…
Cancel
Save