# HG changeset patch # User mduigou # Date 1374523149 25200 # Node ID 18aee3cc498f94a504fc22e65ed8225997df55d5 # Parent 7e9050510b514c098b2d4018eeac7324c8c6ddbd 6799426: Adds constructor PriorityQueue(Comparator) Reviewed-by: lancea diff -r 7e9050510b51 -r 18aee3cc498f jdk/src/share/classes/java/util/PriorityQueue.java --- a/jdk/src/share/classes/java/util/PriorityQueue.java Mon Jul 22 15:26:11 2013 +0100 +++ b/jdk/src/share/classes/java/util/PriorityQueue.java Mon Jul 22 12:59:09 2013 -0700 @@ -136,6 +136,19 @@ } /** + * Creates a {@code PriorityQueue} with the default initial capacity + * that orders its elements according to the specified comparator. + * + * @param comparator the comparator that will be used to order this + * priority queue. If {@code null}, the {@linkplain Comparable + * natural ordering} of the elements will be used. + * @since 1.8 + */ + public PriorityQueue(Comparator comparator) { + this(DEFAULT_INITIAL_CAPACITY, comparator); + } + + /** * Creates a {@code PriorityQueue} with the specified initial capacity * that orders its elements according to the specified comparator. *