--- jsr166/src/test/tck/DelayQueueTest.java 2009/11/21 19:11:53 1.22 +++ jsr166/src/test/tck/DelayQueueTest.java 2009/11/21 21:00:34 1.23 @@ -493,10 +493,11 @@ public class DelayQueueTest extends JSR1 */ public void testTimedPollWithOffer() throws InterruptedException { final DelayQueue q = new DelayQueue(); + final PDelay pdelay = new PDelay(0); Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); - q.poll(LONG_DELAY_MS, MILLISECONDS); + assertSame(pdelay, q.poll(LONG_DELAY_MS, MILLISECONDS)); try { q.poll(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); @@ -505,7 +506,7 @@ public class DelayQueueTest extends JSR1 t.start(); Thread.sleep(SMALL_DELAY_MS); - assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); + assertTrue(q.offer(pdelay, SHORT_DELAY_MS, MILLISECONDS)); t.interrupt(); t.join(); }