Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: converted to 1.6 markup

The Collections Mysterious LRUMap NullPointerException

Wiki MarkupSee \[http://issues.apache.org/bugzilla/show_bug.cgi?id=32573 Bug 32573\]

The Collections 3.1 LRUMap has been reported to throw unexpected NullPointerException's. What is mysterious is that these have only only ever been observed by a small number of users in production code. Attempts to replicate this phenomenum under laboratory conditions have (so far) failed.

This map (as with the majority of the maps, collections and bags in commons-collections) should be externally synchronized (by using - for example - Collections.synchronizeMap) when used in a multithreaded environment. When not appropriately synchronized, analysis of the code indicates that NullPointerExceptions may be thrown. However, all those who have analysed the code have yet to find a use case where a NullPointerException may be thrown when the map is appropriately synchronized.

Wiki MarkupSo far, a definitive cause eludes us. It may be that this issue is caused by inappropriate synchronization or by problems with sychronization code in one or more JVMs. If you think you can help us solve this mystery, please email the \[http://jakarta.apache.org/site/mail.html commons developer list\] or edit this wiki page (at the bottom, if you please).

SOAK Tests

In order to try to discover whether this is a real issue but limited to certain environments (for example, only in particular JVMs or in multiprocessor machines), volunteers have run long running SOAK tests on various environment. The commons-collections team would be very grateful to anyone else who is willing to donate some cycles and record their results below.

...