timeout param in FifoQueueImpl.add(Object element, long timeout)
Description
In FifoQueueImpl class, method add(Object element, long timeout)should return True if the element was successfully added to the queue before the timeout expired, false otherwise.
However the implementation of this method always return true and timeout parameter is not used anywhere.
public boolean add(Object element, long timeout) throws FifoQueueException, InterruptedException { synchronized (m_delegate) { m_delegate.addLast(element); m_delegate.notifyAll(); } return true; }
Environment
Operating System: Windows 2000
Platform: PC
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Seth Leger November 25, 2013 at 3:01 PM
This was fixed when I went through and replaced a lot of the old threadpooling code with new java.util.concurrent constructs. FifoQueueImpl now is just a thin wrapper that delegates to a java.util.concurrent.LinkedBlockingQueue which does support timeouts. Marking as fixed.
commit 6ca07e56924592c1449f8fbfcb7b139fa4951a61
Benjamin Reed October 3, 2008 at 2:15 PM
kind of a misleading API either way
Former user January 20, 2006 at 8:22 AM
Is this causing some problem or failure in the system?
In FifoQueueImpl class, method add(Object element,
long timeout)should return True if the element was
successfully added to the queue before the timeout
expired, false otherwise.
However the implementation of this method always
return true and timeout parameter is not used
anywhere.
public boolean add(Object element, long timeout)
throws FifoQueueException, InterruptedException {
synchronized (m_delegate) {
m_delegate.addLast(element);
m_delegate.notifyAll();
}
return true;
}