Description
There is a incorect remove method call on ConcurrentHashSet object in inner class QueueImpl.DelayedAddRedistributor.
Check this line on github
Following is problematic part of code.
public class QueueImpl implements Queue { private final Set<ScheduledFuture<?>> futures = new ConcurrentHashSet<>(); private class DelayedAddRedistributor implements Runnable { @Override public void run() { ..... futures.remove(this); ..... } } }
futures is ConcurrentHashSet of ScheduledFuture<?>. However, QueueImpl.DelayedAddRedistributor.run() calls futures.remove(this), where this is an instance of QueueImpl.DelayedAddRedistributor class. It is not ScheduledFuture<?>. remove method never removes instance of QueueImpl.DelayedAddRedistributor class, since it stores Scheduled Futures.
QueueImpl$DelayedAddRedistributor is incompatible with expected argument type java.util.concurrent.ScheduledFuture<?>
Attachments
Issue Links
- links to