Aaron> I'm kind of surprised you thought those classes were superior.
Aaron> I seem to recall that I was dis-satisfied with my
Aaron> implementation.  Please be sure to thoroughly test them.

I had trouble running Mauve last night, but these classes did pass the
"resource revocation" test (close() on the writer should notify the
readers).

The libgcj implementation was a bit simpler, but not radically so.

Aaron> In retrospect, non-blocking behavior should probably be the default. 

The 1.2 docs are pretty clear on this:

    Reads up to len characters of data from this piped stream into an
    array of characters. Less than len characters will be read if the end
    of the data stream is reached. This method blocks until at least one
    character of input is available.

I'm going to change Classpath to conform to this.

Aaron> My code is basically the GNU style, adopted to Java.  Other
Aaron> people use their own styles which may not be the same.  I think
Aaron> most people use Sun's gawdawful coding style.  Could you point
Aaron> me at some synchronized blocks for examples?

Look at the first synchronized block in PipedReader:

  synchronized (lock) {

  src.connect(this);

  ever_connected = true;

  } // synchronized

I'll lazily fix these if there's no objection.

There are other minor differences from the GNU style (as I understand
it).  Mostly missing spaces.  Many GNU programs eschew () with return:
"return foo;" and not "return (foo);", but I don't think this is
canonized.

I have to admit I find the lack of indentation for functions
offputting.  However, I know you like this.

Tom

Reply via email to