Re: JDK-8196298: Add null Reader and Writer

2018-02-01 Thread Brian Burkhalter

On Feb 1, 2018, at 2:49 PM, Patrick Reinhart  wrote:

>> Am 01.02.2018 um 22:26 schrieb Brian Burkhalter 
>> :
>>> […]
>> 
>> Yes: there is no such lock instance variable for those classes. Probably it 
>> would not hurt to add a one liner to each method’s doc as Alan suggested.
>> 
> 
> As my english is not that good,

It’s fine!

> I could need some help for that one liner :-)

How about simply “The {@link #lock object} used to synchronize operations on 
the returned {@code Reader} is not specified” and similarly for Writer? I’d 
suggest to put it as a separate paragraph before the @return doc.

Thanks,

Brian

Re: JDK-8196298: Add null Reader and Writer

2018-02-01 Thread Patrick Reinhart


> Am 01.02.2018 um 22:26 schrieb Brian Burkhalter :
> 
> 
> On Jan 30, 2018, at 8:52 AM, Patrick Reinhart  > wrote:
> 
>>> Am 30.01.2018 um 16:02 schrieb Alan Bateman >> >:
>>> 
>>> […]
>>> 
>>> One other micro detail is that Reader/Writer support implementations 
>>> specifying the object to use for synchronization. This isn't interesting 
>>> for the Reader/Writer objects returned by the proposed static methods so a 
>>> one-line that says that the object used to synchronize operations is not 
>>> specified might help. It would avoid something synchronizing on the reader 
>>> or writer and expecting operations read/write methods to block
>> 
>> Is that a difference from the null InputStream/OutputStream here?
> 
> Yes: there is no such lock instance variable for those classes. Probably it 
> would not hurt to add a one liner to each method’s doc as Alan suggested.
> 

As my english is not that good, I could need some help for that one liner :-)

-Patrick


Re: JDK-8196298: Add null Reader and Writer

2018-02-01 Thread Brian Burkhalter

On Jan 30, 2018, at 8:52 AM, Patrick Reinhart  wrote:

>> Am 30.01.2018 um 16:02 schrieb Alan Bateman :
>> 
>> […]
>> 
>> One other micro detail is that Reader/Writer support implementations 
>> specifying the object to use for synchronization. This isn't interesting for 
>> the Reader/Writer objects returned by the proposed static methods so a 
>> one-line that says that the object used to synchronize operations is not 
>> specified might help. It would avoid something synchronizing on the reader 
>> or writer and expecting operations read/write methods to block
> 
> Is that a difference from the null InputStream/OutputStream here?

Yes: there is no such lock instance variable for those classes. Probably it 
would not hurt to add a one liner to each method’s doc as Alan suggested.

Thanks,

Brian

Re: JDK-8196298: Add null Reader and Writer

2018-01-30 Thread Patrick Reinhart


> Am 30.01.2018 um 16:02 schrieb Alan Bateman :
> 
> On 29/01/2018 22:55, Brian Burkhalter wrote:
>> I made a few minor changes to the CSR [1] verbiage. Probably the 
>> nullWriter() documentation should also be updated to explicitly mention all 
>> variants of both append() and write().
>> 
> It could although limiting it to the abstract methods should be fine too as 
> the append methods are specified in terms of the write methods.
> 
> One other micro detail is that Reader/Writer support implementations 
> specifying the object to use for synchronization. This isn't interesting for 
> the Reader/Writer objects returned by the proposed static methods so a 
> one-line that says that the object used to synchronize operations is not 
> specified might help. It would avoid something synchronizing on the reader or 
> writer and expecting operations read/write methods to block

Is that a difference from the null InputStream/OutputStream here?

-Patrick



Re: JDK-8196298: Add null Reader and Writer

2018-01-30 Thread Alan Bateman

On 29/01/2018 22:55, Brian Burkhalter wrote:

I made a few minor changes to the CSR [1] verbiage. Probably the nullWriter() 
documentation should also be updated to explicitly mention all variants of both 
append() and write().

It could although limiting it to the abstract methods should be fine too 
as the append methods are specified in terms of the write methods.


One other micro detail is that Reader/Writer support implementations 
specifying the object to use for synchronization. This isn't interesting 
for the Reader/Writer objects returned by the proposed static methods so 
a one-line that says that the object used to synchronize operations is 
not specified might help. It would avoid something synchronizing on the 
reader or writer and expecting operations read/write methods to block.


-Alan


Re: JDK-8196298: Add null Reader and Writer

2018-01-29 Thread Brian Burkhalter
I made a few minor changes to the CSR [1] verbiage. Probably the nullWriter() 
documentation should also be updated to explicitly mention all variants of both 
append() and write().

Thanks,

Brian

[1] https://bugs.openjdk.java.net/browse/JDK-8196350

On Jan 29, 2018, at 12:58 PM, Brian Burkhalter  
wrote:

> Great - thanks - will take a look.
> 
> Brian
> 
> On Jan 29, 2018, at 11:43 AM, Patrick Reinhart  wrote:
> 
>> Just added a new CSR for it based on the one for InputStream/OutputStream...



Re: JDK-8196298: Add null Reader and Writer

2018-01-29 Thread Brian Burkhalter
Great - thanks - will take a look.

Brian

On Jan 29, 2018, at 11:43 AM, Patrick Reinhart  wrote:

> Just added a new CSR for it based on the one for InputStream/OutputStream...



Re: JDK-8196298: Add null Reader and Writer

2018-01-29 Thread Patrick Reinhart
Just added a new CSR for it based on the one for InputStream/OutputStream...

-Patrick

Am 29.01.2018 um 17:14 schrieb Brian Burkhalter:
> Hi Patrick,
>
> Conceptually this looks good. There might be some javadoc tweaks
> needed but those can be worked out while this is a draft CSR (to be
> filed).
>
> Thanks,
>
> Brian
>
> On Jan 27, 2018, at 12:45 AM, Patrick Reinhart  > wrote:
>
>> I saw that great extension on InputStream/OutputStream adding a Null
>> implementation there. Based on those I would propose a similar addition
>> to the Reader/Writer.
>



JDK-8196298: Add null Reader and Writer

2018-01-29 Thread Claudia Reinhart
Hi there,

I saw that great extension on InputStream/OutputStream adding a Null
implementation there. Based on those I would propose a similar addition
to the Reader/Writer.

-Patrick


Here is what the API would look like based on the existing from
InputStream/OutputStream:


    /**
 * Returns a new {@code Reader} that contains no characters. The
returned
 * stream is initially open.  The stream is closed by calling the
 * {@code close()} method.  Subsequent calls to {@code close()} have no
 * effect.
 *
 *  While the stream is open, the {@code ready​()}, {@code read()},
 * {@code read(char[])}, {@code read(char[], int, int)}, {@code
skip()}, and
 * {@code transferTo()} methods all behave as if end of stream has been
 * reached.  After the stream has been closed, these methods all throw
 * {@code IOException}.
 *
 *  The {@code markSupported()} method returns {@code false}.  The
 * {@code mark()} method does nothing, and the {@code reset()} method
 * throws {@code IOException}.
 *
 * @return an {@code Reader} which contains no characters
 *
 * @since 11
 */
    public static Reader nullReader() {}


    /**
 * Returns a new {@code Writer} which discards all characters.  The
 * returned stream is initially open.  The stream is closed by calling
 * the {@code close()} method.  Subsequent calls to {@code close()} have
 * no effect.
 *
 *  While the stream is open, the {@code write(int)}, {@code
 * write(char[])}, and {@code write(char[], int, int)} methods do
nothing.
 * After the stream has been closed, these methods all throw {@code
 * IOException}.
 *
 *  The {@code flush()} method does nothing.
 *
 * @return an {@code Writer} which discards all characters
 *
 * @since 11
 */
    public static Writer nullWriter() {}




Re: JDK-8196298: Add null Reader and Writer

2018-01-29 Thread Brian Burkhalter
Hi Patrick,

Conceptually this looks good. There might be some javadoc tweaks needed but 
those can be worked out while this is a draft CSR (to be filed).

Thanks,

Brian

On Jan 27, 2018, at 12:45 AM, Patrick Reinhart  wrote:

> I saw that great extension on InputStream/OutputStream adding a Null
> implementation there. Based on those I would propose a similar addition
> to the Reader/Writer.



JDK-8196298: Add null Reader and Writer

2018-01-27 Thread Patrick Reinhart
Hi there,

I saw that great extension on InputStream/OutputStream adding a Null
implementation there. Based on those I would propose a similar addition
to the Reader/Writer.

-Patrick


Here is what the API would look like based on the existing from
InputStream/OutputStream:


    /**
 * Returns a new {@code Reader} that contains no characters. The
returned
 * stream is initially open.  The stream is closed by calling the
 * {@code close()} method.  Subsequent calls to {@code close()} have no
 * effect.
 *
 *  While the stream is open, the {@code ready​()}, {@code read()},
 * {@code read(char[])}, {@code read(char[], int, int)}, {@code
skip()}, and
 * {@code transferTo()} methods all behave as if end of stream has been
 * reached.  After the stream has been closed, these methods all throw
 * {@code IOException}.
 *
 *  The {@code markSupported()} method returns {@code false}.  The
 * {@code mark()} method does nothing, and the {@code reset()} method
 * throws {@code IOException}.
 *
 * @return an {@code Reader} which contains no characters
 *
 * @since 11
 */
    public static Reader nullReader() {}


    /**
 * Returns a new {@code Writer} which discards all characters.  The
 * returned stream is initially open.  The stream is closed by calling
 * the {@code close()} method.  Subsequent calls to {@code close()} have
 * no effect.
 *
 *  While the stream is open, the {@code write(int)}, {@code
 * write(char[])}, and {@code write(char[], int, int)} methods do
nothing.
 * After the stream has been closed, these methods all throw {@code
 * IOException}.
 *
 *  The {@code flush()} method does nothing.
 *
 * @return an {@code Writer} which discards all characters
 *
 * @since 11
 */
    public static Writer nullWriter() {}