[concurrency-interest] PriorityQueue bug with mutable object

Manuel Dominguez Sarmiento mads at renxo.com
Thu Jul 2 11:21:06 EDT 2009

Hi Doug,

I recently filed the following bug at Sun's bug database:


You might want to look into it since this class is used by many 
concurrent classes and you're listed as one of its authors.

I am well aware of the perils of mutable objects, however PriorityQueue 
should account for mutability since priorities might change for a queued 
element at runtime, and it is not always practical to remove and discard 
the previous element and create a new object. This does not only affect 
mutable objects but also those whose priority is somehow based on 
System.currentTimeMillis() or other external data, which is what caused 
us to find this subtle bug.


Ing. Manuel Dominguez Sarmiento
Director General
Renxo S.A.
e-mail:	mads at renxo.com
Phone:	+54 11 4719 6806, ext. 104

More information about the Concurrency-interest mailing list