[COLLECTIONS-330] javadoc: add warning about calling get() while iterating
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1069624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a6d51b8d2f
commit
ed3d9ab90b
|
@ -23,6 +23,7 @@ import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.collections.BoundedMap;
|
import org.apache.commons.collections.BoundedMap;
|
||||||
|
import org.apache.commons.collections.MapIterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A <code>Map</code> implementation with a fixed maximum size which removes
|
* A <code>Map</code> implementation with a fixed maximum size which removes
|
||||||
|
@ -33,6 +34,13 @@ import org.apache.commons.collections.BoundedMap;
|
||||||
* change the order. Queries such as containsKey and containsValue or access
|
* change the order. Queries such as containsKey and containsValue or access
|
||||||
* via views also do not change the order.
|
* via views also do not change the order.
|
||||||
* <p>
|
* <p>
|
||||||
|
* A somewhat subtle ramification of the least recently used
|
||||||
|
* algorithm is that calls to {@link #get(Object)} stand a very good chance
|
||||||
|
* of modifying the map's iteration order and thus invalidating any
|
||||||
|
* iterators currently in use. It is therefore suggested that iterations
|
||||||
|
* over an {@link LRUMap} instance access entry values only through a
|
||||||
|
* {@link MapIterator} or {@link #entrySet()} iterator.
|
||||||
|
* <p>
|
||||||
* The map implements <code>OrderedMap</code> and entries may be queried using
|
* The map implements <code>OrderedMap</code> and entries may be queried using
|
||||||
* the bidirectional <code>OrderedMapIterator</code>. The order returned is
|
* the bidirectional <code>OrderedMapIterator</code>. The order returned is
|
||||||
* least recently used to most recently used. Iterators from map views can
|
* least recently used to most recently used. Iterators from map views can
|
||||||
|
|
Loading…
Reference in New Issue