toString: close tabbed print writer to flush it

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1256 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 25 years ago
parent aca625aa34
commit bf597fea43
  1. 17
      jode/jode/expr/Expression.java

@ -316,14 +316,15 @@ public abstract class Expression {
}
public String toString() {
try {
java.io.StringWriter strw = new java.io.StringWriter();
TabbedPrintWriter writer = new TabbedPrintWriter(strw);
dumpExpression(writer);
return strw.toString();
} catch (java.io.IOException ex) {
return "/*IOException*/"+super.toString();
} catch (RuntimeException ex) {
try {
java.io.StringWriter strw = new java.io.StringWriter();
TabbedPrintWriter writer = new TabbedPrintWriter(strw);
dumpExpression(writer);
writer.close();
return strw.toString();
} catch (java.io.IOException ex) {
return "/*IOException*/"+super.toString();
} catch (RuntimeException ex) {
return "/*RuntimeException*/"+super.toString();
}
}

Loading…
Cancel
Save