-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
5.0
-
sparc
-
solaris_8
Execute the following code with Concurrency preliminary test release 1
and see the result. remove() method doesn't remove the given element.
This is only a backlog bug and added to bugtraq just for tracking purpose.
It has been fixed.
//If the array ArrayBlockingQueue size is 3, then remove() method of the queue
//doesn't remove the given element. But if the array size is 4, it works correctly.
ArrayBlockingQueue < String > queue = new ArrayBlockingQueue < String> (3);
// Code doesn't works if used above constructor.
//ArrayBlockingQueue < String > queue = new ArrayBlockingQueue < String> (4);
// Code works if used above constructor.
queue.add("str1");
queue.add("str2");
queue.add("str3");
System.out.println("status = " + queue.remove(queue.peek()));
System.out.println(queue.toString());
and see the result. remove() method doesn't remove the given element.
This is only a backlog bug and added to bugtraq just for tracking purpose.
It has been fixed.
//If the array ArrayBlockingQueue size is 3, then remove() method of the queue
//doesn't remove the given element. But if the array size is 4, it works correctly.
ArrayBlockingQueue < String > queue = new ArrayBlockingQueue < String> (3);
// Code doesn't works if used above constructor.
//ArrayBlockingQueue < String > queue = new ArrayBlockingQueue < String> (4);
// Code works if used above constructor.
queue.add("str1");
queue.add("str2");
queue.add("str3");
System.out.println("status = " + queue.remove(queue.peek()));
System.out.println(queue.toString());