8021601: Add unit test for PriorityQueue(Comparator) constructor
authormduigou
Fri, 26 Jul 2013 17:23:20 -0700
changeset 19059 510ac28edfef
parent 19058 1c6217d6f528
child 19060 4d949a65ad7f
8021601: Add unit test for PriorityQueue(Comparator) constructor Reviewed-by: darcy, alanb
jdk/src/share/classes/java/util/PriorityQueue.java
jdk/test/java/util/PriorityQueue/RemoveContains.java
--- a/jdk/src/share/classes/java/util/PriorityQueue.java	Fri Jul 26 15:16:53 2013 -0700
+++ b/jdk/src/share/classes/java/util/PriorityQueue.java	Fri Jul 26 17:23:20 2013 -0700
@@ -136,8 +136,8 @@
     }
 
     /**
-     * Creates a {@code PriorityQueue} with the default initial capacity
-     * that orders its elements according to the specified comparator.
+     * Creates a {@code PriorityQueue} with the default initial capacity and
+     * whose elements are ordered according to the specified comparator.
      *
      * @param  comparator the comparator that will be used to order this
      *         priority queue.  If {@code null}, the {@linkplain Comparable
--- a/jdk/test/java/util/PriorityQueue/RemoveContains.java	Fri Jul 26 15:16:53 2013 -0700
+++ b/jdk/test/java/util/PriorityQueue/RemoveContains.java	Fri Jul 26 17:23:20 2013 -0700
@@ -64,6 +64,7 @@
             public int compare(String x, String y) {
                 return x.charAt(0) - y.charAt(0); }};
 
+        test(new PriorityQueue<String>(firstChar));
         test(new PriorityQueue<String>(10, firstChar));
         test(new PriorityBlockingQueue<String>(10, firstChar));
         test(new ArrayBlockingQueue<String>(10));