Tim. I think at least half of this patch is Java 6 specific.
#1 (change of "remove" method) is a different behavior in Java 6, you can also apply this patch into Java 5 trunk and you can see the updated PriorityQueueTest can passes on RI 6 but fails on RI 5. So, it is Java 6 specific.
#2 may be also a feature of Java 5. But according to the spec, there's no doc of methods "contains(Object object),toArray(),toArray(T array)" of PriorityQueue in Java 5. In Java 5, these 3 methods are maked as "Methods inherited from sub class XXX". We can see that they're "pulled down" to the class PriorityQueue in Java 6.
So, I think we have two choices now, one is to apply this patch only into Java 6 branch, the other is to split it into 2 patches, one for Java 5 including the 3 inherited methods and one for Java 6 including only the update of "remove" mehtod and related test cases.
Tim, any idea? Thanks a lot!