commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r643755 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/LRUMap.java
Date Wed, 02 Apr 2008 06:06:48 GMT
Author: bayard
Date: Tue Apr  1 23:06:47 2008
New Revision: 643755

URL: http://svn.apache.org/viewvc?rev=643755&view=rev
Log:
Adding a state check as per COLLECTIONS-3. I got an NPE when running through tests without
synchronization

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=643755&r1=643754&r2=643755&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
Tue Apr  1 23:06:47 2008
@@ -191,6 +191,11 @@
         if (entry.after != header) {
             modCount++;
             // remove
+            if(entry.before == null) {
+                throw new IllegalStateException("Entry.before is null." + 
+                    " Please check that your keys are immutable, and that you have used synchronization
properly." +
+                    " If so, then please report this to dev@commons.apache.org as a bug.");
+            }
             entry.before.after = entry.after;
             entry.after.before = entry.before;
             // add first



Mime
View raw message