Analogous to the Static Calendar Detector I created a static HashMap and HashSet Detector. Just today we (again) were hit by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6423457 (causing 100% CPU in HashMap.get()). We needed to restart the whole app-server to get it working again.
I did not know how to detect assignments of HashMap to Map references, maybe someone could either add that or tell me how to do it.
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
New Detector class, patches for messages.xml, findbugs.xml and a test case file
Last edit: Anonymous 2017-09-04
Could you give us more context? There are definitely situations where you might want to have a static map/set. Was your code in a servlet?
oops! accidentally marked "out of date."
Given that the original problem has been declared "pilot error," we should probably close this. From the end of the linked bug report:
Please rebase the patch on latest git state.