[Java] How to use HashMap that causes hangs, which attaches attention from logs

less than 1 minute read

If the following log to HashMap is observed

Sample1.log


at java.util.HashMap.findNonNullKeyEntry(HashMap.java:605)
at java.util.HashMap.putImpl(HashMap.java:701)
at java.util.HashMap.put(HashMap.java:684)
at zzz.yyy.xxx.setSomething(SomeUtil.java:nnn)

Sample2.log


at java.util.HashMap$TreeNode.putTreeVal(HashMap.java:2013)
at java.util.HashMap.putVal(HashMap.java:648)
at java.util.HashMap.put(HashMap.java:622)
at zzz.yyy.xxx.setSomething(SomeUtil.java:nnn)

For an example, let’s look at SomeUtil.java or let the developer see it.

Is HashMap properly controlled and used?

HashMap review

Exclusive control review