This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This pattern is wrong with existing memory model in Java because there is no guarantee that method b() executed in different thread than a() will see a's updates: class A int i = 0; ... a() { i++; ... i--; } b() { if (i>0) return; ... } }
1) Agree with general assessment. Variable should be volatile to protect against this. 2) For this particular block of code, IIRC it is actually protecting itself within the context of a single thread (e.g recursion issues) so the general assessment does not apply (ie the described scenario does not happen in real life). 3) This code is dead (removal is pending) so the bug is irrelevant regardless.
Code line no longer used, marking WONTFIX.