Re: non-blocking channel Infinite loop in java.util.Scanner

2012-06-06 Thread Alan Bateman
On 06/06/2012 00:12, Rémi Forax wrote: Thanks Alan, I can't ensure that the blocking mode will not change by synchronizing on the channel's blockingLock because I will have to take the lock before creating the reader and releasing it when the reader is closed. Looking at now, it would need to

Re: non-blocking channel Infinite loop in java.util.Scanner

2012-06-05 Thread Rémi Forax
On 06/05/2012 12:40 PM, Alan Bateman wrote: On 05/06/2012 11:00, Rémi Forax wrote: One of my student find a bug in the implementation of Scanner, that allows you to use a non blocking channel as input of a Scanner. The Scanner uses Channels.newReader() to create a Reader from a channel which it

Re: non-blocking channel Infinite loop in java.util.Scanner

2012-06-05 Thread Alan Bateman
On 05/06/2012 11:00, Rémi Forax wrote: One of my student find a bug in the implementation of Scanner, that allows you to use a non blocking channel as input of a Scanner. The Scanner uses Channels.newReader() to create a Reader from a channel which itself create a StreamDecoder. In that case, S

non-blocking channel Infinite loop in java.util.Scanner

2012-06-05 Thread Rémi Forax
One of my student find a bug in the implementation of Scanner, that allows you to use a non blocking channel as input of a Scanner. The Scanner uses Channels.newReader() to create a Reader from a channel which itself create a StreamDecoder. In that case, StreamDecoder.impReader() goes into an in