FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
windows XP sp1
A DESCRIPTION OF THE PROBLEM :
public class TaskPool {
public static void main( String[] args ) throws InterruptedException {
LinkedBlockingQueue lbq = new LinkedBlockingQueue();
Integer one = 1;
Integer two = 2;
Integer three = 3;
lbq.put(one);
lbq.put(two);
lbq.remove(one);
lbq.remove(two);
lbq.put(three);
System.out.println(lbq.take());
}
}
java TaskPool
Exception in thread "main" java.lang.NullPointerException
at java.util.concurrent.LinkedBlockingQueue.extract(Unknown Source)
at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
at TaskPool.main(TaskPool.java:23)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java TaskPool
ACTUAL -
Exception in thread "main" java.lang.NullPointerException
at java.util.concurrent.LinkedBlockingQueue.extract(Unknown Source)
at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
at TaskPool.main(TaskPool.java:23)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.NullPointerException
at java.util.concurrent.LinkedBlockingQueue.extract(Unknown Source)
at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
at TaskPool.main(TaskPool.java:23)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.concurrent.LinkedBlockingQueue;
public class TaskPool {
public static void main( String[] args ) throws InterruptedException {
LinkedBlockingQueue lbq = new LinkedBlockingQueue();
Integer one = 1;
Integer two = 2;
Integer three = 3;
lbq.put(one);
lbq.put(two);
lbq.remove(one);
lbq.remove(two);
lbq.put(three);
System.out.println(lbq.take());
}
}
---------- END SOURCE ----------
###@###.### 2005-1-10 12:08:56 GMT