From bf597fea43745904a6fabf685dcc0b2114807567 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Thu, 6 Jul 2000 16:48:53 +0000 Subject: [PATCH] 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 --- jode/jode/expr/Expression.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/jode/jode/expr/Expression.java b/jode/jode/expr/Expression.java index 28c48a7..7410dcb 100644 --- a/jode/jode/expr/Expression.java +++ b/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(); } }