commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joerg Schaible (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (COLLECTIONS-3) NPE: map.LRUMap.reuseMapping(LRUMap.java:272)
Date Wed, 17 Jun 2009 09:30:07 GMT

     [ https://issues.apache.org/jira/browse/COLLECTIONS-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joerg Schaible reopened COLLECTIONS-3:
--------------------------------------


Reopened, added a unit test (currently not executed, marked with TODO) that reproduces the
ConcurrentModificationException. Happens only if the remove is called on the iterator from
the keySet. Works fine for the iterators from the entrySet and values. See improved unit test
TestLRUMap.

> NPE: map.LRUMap.reuseMapping(LRUMap.java:272)
> ---------------------------------------------
>
>                 Key: COLLECTIONS-3
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-3
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.1
>         Environment: Operating System: Linux
> Platform: PC
>            Reporter: Otis Gospodnetic
>             Fix For: 3.3
>
>         Attachments: commons-collections-3.2-LRUMap-debug.jar, LRUMap.java, SoakLRUMap.java
>
>
> I'm using Collections 3.1 and just found this NPE in my logs:
> java.lang.NullPointerException
>         at
> org.apache.commons.collections.map.LRUMap.reuseMapping(LRUMap.java:272)
>         at
> org.apache.commons.collections.map.LRUMap.addMapping(LRUMap.java:243)
>         at
> org.apache.commons.collections.map.AbstractHashedMap.put(AbstractHashedMap.java:282)
> I instantiated LRUMap like this:
>   LRUMap map = new LRUMap(31);
> And from there on, I use it like I'd use any Map, putting things into
> it, and so on.  Maybe I'm not using LRUMap correctly?  My _guess_ is
> that this occurs when the Map is full, but I am not certain.
> I am wrapping the LRUMap in my own Maps as follows, but I think they're
> not the culprit:
>   LRUMap map = new LRUMap(31);
>     _userSessions = new ExpiringMap(map,
>        new TimerTTLReferenceHolder(1800000), // ttl=30min
>        300000);                              // purge frequency=5min
> The only similar thing I found is COM-1288, but it looks like that was fixed
> before 3.1 release.
> I understand the value of a self-contained unit test that demonstrates this bug,
> but it happens only occassionally on my production system, never during
> development, so I can't really come up with it :(
> My guess is that this is a boundary case, as line 272 is:
>  loop = loop.next;
> So 'loop' is most likely null, and it's null because ... not sure, maybe that
> hashIndex is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message