public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* minor frysk cleanup
@ 2008-02-29 21:10 Tom Tromey
  2008-03-01 18:16 ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2008-02-29 21:10 UTC (permalink / raw)
  To: Frysk List

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  <tromey@redhat.com>

	* 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) {
 	    

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: minor frysk cleanup
  2008-02-29 21:10 minor frysk cleanup Tom Tromey
@ 2008-03-01 18:16 ` Mark Wielaard
  2008-03-01 18:27   ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2008-03-01 18:16 UTC (permalink / raw)
  To: tromey; +Cc: Frysk List

Hi Tom,

On Fri, 2008-02-29 at 13:19 -0700, Tom Tromey wrote:
> 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.
>
> frysk-core/frysk/util/ChangeLog:
> 2008-02-29  Tom Tromey  <tromey@redhat.com>
> 
> 	* FlowControlWriter.java (outStream): Remove.
> 	(FlowControlWriter): Update.
> 	(flush): Update.
> 	(close): Update.
> 	(write(char[],int,int)): Update.
> 	(write(int)): Update.
> 	(write(String,int,int)): Update.

This looks good. Thanks.
If you have git push access please push it.
Otherwise I can do that for you.

It does help if you run make check in at least frysk-core (or make check
-k toplevel) and mention whether you see any failures (normally we
should have zero fails, at least in frysk-core).

Cheers,

Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: minor frysk cleanup
  2008-03-01 18:16 ` Mark Wielaard
@ 2008-03-01 18:27   ` Tom Tromey
  2008-03-01 19:22     ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2008-03-01 18:27 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Frysk List

Mark> This looks good. Thanks.
Mark> If you have git push access please push it.
Mark> Otherwise I can do that for you.

I don't think I do.

Mark> It does help if you run make check in at least frysk-core (or make check
Mark> -k toplevel) and mention whether you see any failures (normally we
Mark> should have zero fails, at least in frysk-core).

I will run it now.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: minor frysk cleanup
  2008-03-01 18:27   ` Tom Tromey
@ 2008-03-01 19:22     ` Mark Wielaard
  2008-03-01 19:27       ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2008-03-01 19:22 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Frysk List

Hi Tom,

On Sat, 2008-03-01 at 10:37 -0700, Tom Tromey wrote:
> Mark> This looks good. Thanks.
> Mark> If you have git push access please push it.
> Mark> Otherwise I can do that for you.
> 
> I don't think I do.

OK, I pushed it for you.

> Mark> It does help if you run make check in at least frysk-core (or make check
> Mark> -k toplevel) and mention whether you see any failures (normally we
> Mark> should have zero fails, at least in frysk-core).
> 
> I will run it now.

As discussed on irc there are currently some failures :{
Those are not supposed to be there of course, normally we are pretty
good at staying at zero fail. I checked that there were no regressions
with your patch applied (same results before/after).

Thanks,

Mark

Just for the record this is the failure list from frysk-core
(fedora 8, x86):

There were 2 unsupported:
  disassembler
  requires both 32-bit and 64-bit
There were 3 failures:
1)
testComplexStruct(frysk.value.TestClass)junit.framework.ComparisonFailure: Variable is a struct expected:<struct> but was:<class>
   at frysk.value.TestClass.testComplexStruct(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
2)
testInheritedStruct(frysk.value.TestClass)junit.framework.ComparisonFailure: Variable is a struct expected:<struct> but was:<class>
   at frysk.value.TestClass.testInheritedStruct(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
3)
testPublicPrivateType(frysk.value.TestComposite)junit.framework.ComparisonFailure: toPrint expected:<...public:
 ...> but was:<......>
   at frysk.value.TestComposite.testPublicPrivateType(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)

FAILURES!!!
Tests run: 981,  Failures: 3,  Errors: 0

Failed after run #0
Exception in thread "main" FAIL: TestRunner
java.lang.NullPointerException
   at FunitSimpleInterfaceTest.main(FunitSimpleInterfaceTest.java:46)
Exception in thread "main" java.lang.NullPointerException
   at FunitSimpleInterfaceTest.main(FunitSimpleInterfaceTest.java:46)
FAIL: frysk/pkglibdir/FunitSimpleInterfaceTest
no suitable method `main' in class
FAIL: frysk/rt/TestDisplayValue


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: minor frysk cleanup
  2008-03-01 19:22     ` Mark Wielaard
@ 2008-03-01 19:27       ` Tom Tromey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2008-03-01 19:27 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Frysk List

Mark> As discussed on irc there are currently some failures :{
Mark> Those are not supposed to be there of course, normally we are pretty
Mark> good at staying at zero fail. I checked that there were no regressions
Mark> with your patch applied (same results before/after).

Yeah, this looks like the results I saw as well.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-01 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29 21:10 minor frysk cleanup Tom Tromey
2008-03-01 18:16 ` Mark Wielaard
2008-03-01 18:27   ` Tom Tromey
2008-03-01 19:22     ` Mark Wielaard
2008-03-01 19:27       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).