commons.collections.buffer.BlockingBuffer throws BufferUnderflowException

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

commons.collections.buffer.BlockingBuffer throws BufferUnderflowException

Pito Salas-3
Why does that make sense? I would think that a BlockingBuffer cannot  
underflow on a get().

Looking at the code for get() I see:

    public Object get() {
         synchronized (lock) {
             while (collection.isEmpty()) {
                 try {
                     wait();
                 } catch (InterruptedException e) {
                     throw new BufferUnderflowException();
                 }
             }
             return getBuffer().get();
         }
     }

So, an InterruptedException is turned into a BufferUnderflowException.

Usually InterruptedException is just re-thrown. I don't understand  
how to interpret the conversion to a BufferUnderflowException, and  
whether I can / should safely ignore it.

Anyone?

Pito

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]