This inspection reports instances of synchronized statements where the lock expression is a non-final field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
"I'm not back." - Bill Harding, Twister
Yes, that's how I understand this issue too. But in my case I am sure that nobody will change object reference o ever after it has been set. So I guess I am on the safe side.
SCJP 1.4, SCJD, OCE EJBD 6
Originally posted by Maris Orbidans:
Yes, that's how I understand this issue too. But in my case I am sure that nobody will change object reference o ever after it has been set. So I guess I am on the safe side.
Yes, that's how I understand this issue too. But in my case I am sure that nobody will change object reference o ever after it has been set. So I guess I am on the safe side.
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
"I'm not back." - Bill Harding, Twister
I just had the craziest dream. This tiny ad was in it.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|