@Test public void testSameObjectOtherField() { if (verifyNoPropertyViolation(LISTENER)) { final SharedObject o = new SharedObject(); Runnable r = new Runnable() { public void run() { o.instanceField = 42; } }; Thread t = new Thread(r); o.whatEver = -42; // different field, no race } }
public void run() { o.instanceField = 42; // same insn, different 'o', no race }