commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pito Salas <>
Subject commons.collections.buffer.BlockingBuffer throws BufferUnderflowException
Date Thu, 16 Jun 2005 01:45:33 GMT
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 {
                 } 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.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message