Synchronizing on an object in java, then changing the value of the synchronized-on variable

Viewed 5797

I came across a code like this

synchronized(obj) {

   obj = new Object();

}

Something does not feel right about this , I am unable to explain, Is this piece of code OK or there is something really wrong in it, please point it out. Thanks

4 Answers
Related