From aca625aa344f85a5ae75e0f209c72a51087fa9a4 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Thu, 6 Jul 2000 16:47:58 +0000 Subject: [PATCH] Added functionality to flush() and close() git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1255 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/TabbedPrintWriter.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jode/jode/decompiler/TabbedPrintWriter.java b/jode/jode/decompiler/TabbedPrintWriter.java index c6be8c6..f9f632d 100644 --- a/jode/jode/decompiler/TabbedPrintWriter.java +++ b/jode/jode/decompiler/TabbedPrintWriter.java @@ -562,7 +562,7 @@ public class TabbedPrintWriter { println(); } - public void println() { + public void flushLine() { currentBP.endPos = currentLine.length(); // pw.print(indentStr); @@ -578,13 +578,17 @@ public class TabbedPrintWriter { // pw.println(); pw.print(indentStr); currentBP.printLines(currentIndent, currentLine.toString()); - pw.println(); currentLine.setLength(0); currentBP = new BreakPoint(null, 0); currentBP.startOp(DONT_BREAK, 1, 0); } + public void println() { + flushLine(); + pw.println(); + } + public void print(String str) { currentLine.append(str); } @@ -751,10 +755,12 @@ public class TabbedPrintWriter { } public void flush() { + flushLine(); pw.flush(); } public void close() { + flushLine(); pw.close(); } }