-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b51
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2128926 | 5.0u6 | Martin Buchholz | P2 | Resolved | Fixed | b03 |
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
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
- backported by
-
JDK-2128926 LinkedBlockingQueue.extract throws NPE
- Resolved
- relates to
-
JDK-6189072 Add sometimes fails after clear or drainTo in LinkedBlockingQueue
- Closed
-
JDK-6316155 LinkedBlockingQueue: q.offer(xyz) returns false positives and/or q.remove(xyz) gives up too easily
- Closed