I\'m looking at some legacy code which has the following idiom:
Map myMap = someGlobalInstance.getMap(); synchronized (myMap) { item =
I think the code could be sound, depending on what the getMap() method does. If it keeps a reference to an instance that has to be shared between threads it makes sense. The warning is irrelevant since the local variable is not initialized locally.