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

Loading…
Cancel
Save