False positive for UseConcurrentHashMap when a local Map variable
A source code analyzer
Brought to you by:
adangel,
juansotuyo
The UseConcurrentHashMap rule is firing anytime one instantiates a HashMap. But it should really only fire if the Map is going to be shared across threads.
For a simple case where a Map is being instantiated in a method, and it's lifecycle is purely for that method call, using a ConcurrentHashMap doesn't add any value. That may change if the Map is returned.
Any news about this issue ?
This is a very interesting rule but i will disable it. I think that with the current coding, the use of ConcurrentHashMap everywhere is worst than the HashMap possible problem.