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() { public String toString() {
try { try {
java.io.StringWriter strw = new java.io.StringWriter(); java.io.StringWriter strw = new java.io.StringWriter();
TabbedPrintWriter writer = new TabbedPrintWriter(strw); TabbedPrintWriter writer = new TabbedPrintWriter(strw);
dumpExpression(writer); dumpExpression(writer);
return strw.toString(); writer.close();
} catch (java.io.IOException ex) { return strw.toString();
return "/*IOException*/"+super.toString(); } catch (java.io.IOException ex) {
} catch (RuntimeException ex) { return "/*IOException*/"+super.toString();
} catch (RuntimeException ex) {
return "/*RuntimeException*/"+super.toString(); return "/*RuntimeException*/"+super.toString();
} }
} }

Loading…
Cancel
Save