From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9414 invoked by alias); 29 Feb 2008 21:10:16 -0000 Received: (qmail 9404 invoked by uid 22791); 29 Feb 2008 21:10:15 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Feb 2008 21:09:55 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m1TL9kn7029309 for ; Fri, 29 Feb 2008 16:09:46 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m1TL9kCC028073 for ; Fri, 29 Feb 2008 16:09:46 -0500 Received: from opsy.redhat.com (vpn-14-132.rdu.redhat.com [10.11.14.132]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m1TL9kxG010958; Fri, 29 Feb 2008 16:09:46 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 11BC73780BC; Fri, 29 Feb 2008 13:19:52 -0700 (MST) To: Frysk List Subject: minor frysk cleanup From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Fri, 29 Feb 2008 21:10:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00088.txt.bz2 I was looking at frysk a little today and noticed an oddity in FlowControlWriter. This class keeps its own copy of the output writer, but there is no reason to do this. FilterWriter subclasses should either use super calls or the inherited "out" field. Tom frysk-core/frysk/util/ChangeLog: 2008-02-29 Tom Tromey * FlowControlWriter.java (outStream): Remove. (FlowControlWriter): Update. (flush): Update. (close): Update. (write(char[],int,int)): Update. (write(int)): Update. (write(String,int,int)): Update. diff --git a/frysk-core/frysk/util/FlowControlWriter.java b/frysk-core/frysk/util/FlowControlWriter.java index b0b76fd..0ab8dfb 100644 --- a/frysk-core/frysk/util/FlowControlWriter.java +++ b/frysk-core/frysk/util/FlowControlWriter.java @@ -47,7 +47,6 @@ import java.io.Writer; * Extension of Writer that allows output to be paused. */ public class FlowControlWriter extends FilterWriter { - private Writer outStream; private boolean paused = false; /** @@ -55,7 +54,6 @@ public class FlowControlWriter extends FilterWriter { */ public FlowControlWriter(Writer outStream) { super(outStream); - this.outStream = outStream; } public synchronized boolean isPaused() { @@ -81,7 +79,7 @@ public class FlowControlWriter extends FilterWriter { } } try { - outStream.flush(); + super.flush(); } catch (IOException e) { } @@ -96,7 +94,6 @@ public class FlowControlWriter extends FilterWriter { } } - outStream.close(); super.close(); } @@ -109,9 +106,9 @@ public class FlowControlWriter extends FilterWriter { } } - outStream.write(buf, offset, len); + super.write(buf, offset, len); try { - outStream.flush(); + super.flush(); } catch (IOException e) { } @@ -126,9 +123,9 @@ public class FlowControlWriter extends FilterWriter { } } - outStream.write(b); + super.write(b); try { - outStream.flush(); + super.flush(); } catch (IOException e) { } @@ -143,9 +140,9 @@ public class FlowControlWriter extends FilterWriter { } } - outStream.write(str, offset, len); + super.write(str, offset, len); try { - outStream.flush(); + super.flush(); } catch (IOException e) {