Support removal using values iterator. (#8866)

Motivation:

As ActiveMQ project using netty, we want to make use of this class, unfortunately the iterator on values(), seems to not support remove method, even so the delegated iterator does. Currently we have to clone and modify this class locally albeit a one line change is needed, it would be ideal if netty could allow remove, then removing the need to maintain a clone.  

Modifications:

* remove throws UnsupportedOperationException, and instead call remove method on delegated iterator

Result:

Be able to call Iterator.remove() for the values.
This commit is contained in:
Michael André Pearce 2019-02-26 20:02:56 +00:00 committed by Norman Maurer
parent 106bd0c091
commit a40655ad0c

View File

@ -236,7 +236,7 @@ public class @K@ObjectHashMap<V> implements @K@ObjectMap<V> {
@Override
public void remove() {
throw new UnsupportedOperationException();
iter.remove();
}
};
}