Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 65336 invoked from network); 10 Feb 2011 23:58:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2011 23:58:24 -0000 Received: (qmail 30728 invoked by uid 500); 10 Feb 2011 23:58:23 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 30664 invoked by uid 500); 10 Feb 2011 23:58:23 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 30656 invoked by uid 99); 10 Feb 2011 23:58:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 23:58:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 23:58:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0E9FE2388A40; Thu, 10 Feb 2011 23:58:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1069624 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java Date: Thu, 10 Feb 2011 23:58:00 -0000 To: commits@commons.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110210235800.0E9FE2388A40@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mbenson Date: Thu Feb 10 23:57:59 2011 New Revision: 1069624 URL: http://svn.apache.org/viewvc?rev=1069624&view=rev Log: [COLLECTIONS-330] javadoc: add warning about calling get() while iterating Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java?rev=1069624&r1=1069623&r2=1069624&view=diff ============================================================================== --- commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java (original) +++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java Thu Feb 10 23:57:59 2011 @@ -23,6 +23,7 @@ import java.io.Serializable; import java.util.Map; import org.apache.commons.collections.BoundedMap; +import org.apache.commons.collections.MapIterator; /** * A Map implementation with a fixed maximum size which removes @@ -33,6 +34,13 @@ import org.apache.commons.collections.Bo * change the order. Queries such as containsKey and containsValue or access * via views also do not change the order. *

+ * 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. + *

* The map implements OrderedMap and entries may be queried using * the bidirectional OrderedMapIterator. The order returned is * least recently used to most recently used. Iterators from map views can