changeset 7831:52923cc16dc4

Javadoc format cleanups
author briangoetz
date Fri, 05 Apr 2013 19:04:04 -0400
parents 92cd244a11db
children 2fd5a66fed96 e33af7ca99f9
files src/share/classes/java/util/stream/AbstractTask.java src/share/classes/java/util/stream/Collector.java src/share/classes/java/util/stream/Collectors.java src/share/classes/java/util/stream/DoubleStream.java src/share/classes/java/util/stream/IntStream.java src/share/classes/java/util/stream/LongStream.java src/share/classes/java/util/stream/PipelineHelper.java src/share/classes/java/util/stream/Sink.java src/share/classes/java/util/stream/Stream.java src/share/classes/java/util/stream/Streams.java src/share/classes/java/util/stream/package-info.java
diffstat 11 files changed, 199 insertions(+), 199 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/AbstractTask.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/AbstractTask.java	Fri Apr 05 19:04:04 2013 -0400
@@ -55,7 +55,7 @@
  * {@code Spliterator}, and override {@code onCompletion()} to merge the results
  * of the child tasks for internal nodes:
  *
- * <pre>
+ * <pre>{@code
  *     protected S doLeaf() {
  *         spliterator.forEach(...);
  *         return localReductionResult;
@@ -71,7 +71,7 @@
  *             setLocalResult(result);
  *         }
  *     }
- * </pre>
+ * }</pre>
  *
  * @param <P_IN> Type of elements input to the pipeline
  * @param <P_OUT> Type of elements output from the pipeline
--- a/src/share/classes/java/util/stream/Collector.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/Collector.java	Fri Apr 05 19:04:04 2013 -0400
@@ -83,13 +83,13 @@
  * @apiNote
  * <p>Performing a reduction operation with a {@code Collector} should produce a result
  * equivalent to:
- * <pre>
+ * <pre>{@code
  *     BiFunction<R,T,R> accumulator = collector.accumulator();
  *     R result = collector.resultSupplier().get();
  *     for (T t : data)
  *         result = accumulator.apply(result, t);
  *     return result;
- * </pre>
+ * }</pre>
  *
  * However, the library is free to partition the input, perform the reduction on the partitions,
  * and then use the combiner function to combine the partial results to achieve a parallel
--- a/src/share/classes/java/util/stream/Collectors.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/Collectors.java	Fri Apr 05 19:04:04 2013 -0400
@@ -288,11 +288,11 @@
      * following a {@code groupingBy} or {@code partitioningBy} collection.
      * For example, given a stream of {@code Person}, to accumulate the set of last names in
      * each city:
-     * <pre>
+     * <pre>{@code
      *     Map<City, Set<String>> lastNamesByCity
      *         = people.stream().collect(groupingBy(Person::getCity,
      *                                              mapping(Person::getLastName, toSet())));
-     * </pre>
+     * }</pre>
      *
      * @param <T> The type of the input elements
      * @param <U> Type of elements accepted by downstream collector
@@ -319,12 +319,12 @@
      * following a {@code groupingBy} or {@code partitioningBy} collection; if you want to perform
      * a simple reduction on a stream, use {@link Stream#reduce(BinaryOperator)}.
      * For example, given a stream of {@code Person}, to calculate tallest person in each city:
-     * <pre>
+     * <pre>{@code
      *     Comparator<Person> byHeight = Comparators.comparing(Person::getHeight);
      *     BinaryOperator<Person> tallerOf = Comparators.greaterOf(byHeight);
      *     Map<City, Person> tallestByCity
      *         = people.stream().collect(groupingBy(Person::getCity, reducing(tallerOf)));
-     * </pre>
+     * }</pre>
      * @param op A {@code BinaryOperator<T>} used to reduce the input elements
      * @param <T> The type of the input elements
      * @return A {@code Collector} which implements the reduction operation
@@ -340,9 +340,9 @@
      *
      * @implSpec
      * This produces a result equivalent to:
-     * <pre>
+     * <pre>{@code
      *     reducing(e -> 1L, Long::sum)
-     * </pre>
+     * }</pre>
      * @param <T> The type of the input elements
      * @return A {@code Collector} that counts its input elements
      */
@@ -363,13 +363,13 @@
      * a simple reduction on a stream, use {@link Stream#reduce(BinaryOperator)}.
      * For example, given a stream of {@code Person}, to calculate the longest last name of residents
      * in each city:
-     * <pre>
+     * <pre>{@code
      *     Comparator<String> byLength = Comparators.comparing(String::length);
      *     BinaryOperator<String> longerOf = Comparators.greaterOf(byLength);
      *     Map<City, String> longestLastNameByCity
      *         = people.stream().collect(groupingBy(Person::getCity,
      *                                              reducing(Person::getLastName, longerOf)));
-     * </pre>
+     * }</pre>
      *
      * @param mapper A mapping function to apply to each input value
      * @param op A {@code BinaryOperator<T>} used to reduce the mapped values
--- a/src/share/classes/java/util/stream/DoubleStream.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/DoubleStream.java	Fri Apr 05 19:04:04 2013 -0400
@@ -217,14 +217,14 @@
      *
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
-     * <pre>
+     * <pre>{@code
      *     list.stream()
      *         .filter(filteringFunction)
      *         .peek(e -> {System.out.println("Filtered value: " + e); });
      *         .map(mappingFunction)
      *         .peek(e -> {System.out.println("Mapped value: " + e); });
      *         .collect(Collectors.toDoubleSummaryStastistics());
-     * </pre>
+     * }</pre>
      *
      * @param consumer A <a href="package-summary.html#NonInterference">
      *                 non-interfering</a> action to perform on the elements as
@@ -319,12 +319,12 @@
      * an <a href="package-summary.html#Associativity">associative</a>
      * accumulation function, and return the reduced value.  This is equivalent
      * to:
-     * <pre>
+     * <pre>{@code
      *     double result = identity;
      *     for (double element : this stream)
      *         result = accumulator.apply(result, element)
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -340,15 +340,15 @@
      * @apiNote Sum, min, max, and average are all special cases of reduction.
      * Summing a stream of numbers can be expressed as:
      *
-     * <pre>
+     * <pre>{@code
      *     double sum = numbers.reduce(0, (a, b) -> a+b);
-     * </pre>
+     * }</pre>
      *
      * or more compactly:
      *
-     * <pre>
+     * <pre>{@code
      *     double sum = numbers.reduce(0, Double::sum);
-     * </pre>
+     * }</pre>
      *
      * <p>While this may seem a more roundabout way to perform an aggregation
      * compared to simply mutating a running total in a loop, reduction
@@ -373,7 +373,7 @@
      * <a href="package-summary.html#Associativity">associative</a> accumulation
      * function, and return an {@code OptionalDouble} describing the reduced value,
      * if any. This is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     boolean foundAny = false;
      *     double result = null;
      *     for (double element : this stream) {
@@ -384,7 +384,7 @@
      *         else
      *             result = accumulator.apply(result, element)
      *     return foundAny ? OptionalDouble.of(result) : OptionalDouble.empty();
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -409,12 +409,12 @@
      * such as an {@code ArrayList}, and elements are incorporated by updating
      * the state of the result, rather than by replacing the result.  This
      * produces a result equivalent to:
-     * <pre>
+     * <pre>{@code
      *     R result = resultFactory.get();
      *     for (double element : this stream)
      *         accumulator.accept(result, element);
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * Like {@link #reduce(double, DoubleBinaryOperator)}, {@code collect} operations
      * can be parallelized without requiring additional sychronization.
@@ -446,9 +446,9 @@
      * Returns the sum of elements in this stream.  This is a special case
      * of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(0, Double::sum);
-     * </pre>
+     * }</pre>
      * @return The sum of elements in this stream
      */
     double sum();
@@ -458,9 +458,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Double::min);
-     * </pre>
+     * }</pre>
      * @return The minimal element of this stream, or an empty
      * {@code OptionalDouble}
      */
@@ -471,9 +471,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Double::max);
-     * </pre>
+     * }</pre>
      * @return The maximal element of this stream, or an empty
      * {@code OptionalDouble}
      */
@@ -483,9 +483,9 @@
      * Returns the count of elements in this stream.  This is a special case of
      * a <a href="package-summary.html#MutableReduction">reduction</a> and is
      * equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return mapToLong(e -> 1L).sum();
-     * </pre>
+     * }</pre>
      * @return The count of elements in this stream
      */
     long count();
--- a/src/share/classes/java/util/stream/IntStream.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/IntStream.java	Fri Apr 05 19:04:04 2013 -0400
@@ -218,14 +218,14 @@
      *
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
-     * <pre>
+     * <pre>{@code
      *     list.stream()
      *         .filter(filteringFunction)
      *         .peek(e -> {System.out.println("Filtered value: " + e); });
      *         .map(mappingFunction)
      *         .peek(e -> {System.out.println("Mapped value: " + e); });
      *         .collect(Collectors.toIntSummaryStastistics());
-     * </pre>
+     * }</pre>
      *
      * @param consumer A <a href="package-summary.html#NonInterference">
      *                 non-interfering</a> action to perform on the elements as
@@ -320,12 +320,12 @@
      * an <a href="package-summary.html#Associativity">associative</a>
      * accumulation function, and return the reduced value.  This is equivalent
      * to:
-     * <pre>
+     * <pre>{@code
      *     int result = identity;
      *     for (int element : this stream)
      *         result = accumulator.apply(result, element)
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -341,15 +341,15 @@
      * @apiNote Sum, min, max, and average are all special cases of reduction.
      * Summing a stream of numbers can be expressed as:
      *
-     * <pre>
+     * <pre>{@code
      *     int sum = integers.reduce(0, (a, b) -> a+b);
-     * </pre>
+     * }</pre>
      *
      * or more compactly:
      *
-     * <pre>
+     * <pre>{@code
      *     int sum = integers.reduce(0, Integer::sum);
-     * </pre>
+     * }</pre>
      *
      * <p>While this may seem a more roundabout way to perform an aggregation
      * compared to simply mutating a running total in a loop, reduction
@@ -374,7 +374,7 @@
      * <a href="package-summary.html#Associativity">associative</a> accumulation
      * function, and return an {@code OptionalInt} describing the reduced value,
      * if any. This is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     boolean foundAny = false;
      *     int result = null;
      *     for (int element : this stream) {
@@ -385,7 +385,7 @@
      *         else
      *             result = accumulator.apply(result, element)
      *     return foundAny ? OptionalInt.of(result) : OptionalInt.empty();
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -410,12 +410,12 @@
      * such as an {@code ArrayList}, and elements are incorporated by updating
      * the state of the result, rather than by replacing the result.  This
      * produces a result equivalent to:
-     * <pre>
+     * <pre>{@code
      *     R result = resultFactory.get();
      *     for (int element : this stream)
      *         accumulator.accept(result, element);
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * Like {@link #reduce(int, IntBinaryOperator)}, {@code collect} operations
      * can be parallelized without requiring additional sychronization.
@@ -447,9 +447,9 @@
      * Returns the sum of elements in this stream.  This is a special case
      * of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(0, Integer::sum);
-     * </pre>
+     * }</pre>
      * @return The sum of elements in this stream
      */
     int sum();
@@ -459,9 +459,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Integer::min);
-     * </pre>
+     * }</pre>
      * @return The minimal element of this stream, or an empty
      * {@code OptionalInt}
      */
@@ -472,9 +472,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Integer::max);
-     * </pre>
+     * }</pre>
      * @return The maximal element of this stream, or an empty
      * {@code OptionalInt}
      */
@@ -484,9 +484,9 @@
      * Returns the count of elements in this stream.  This is a special case of
      * a <a href="package-summary.html#MutableReduction">reduction</a> and is
      * equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return mapToLong(e -> 1L).sum();
-     * </pre>
+     * }</pre>
      * @return The count of elements in this stream
      */
     long count();
--- a/src/share/classes/java/util/stream/LongStream.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/LongStream.java	Fri Apr 05 19:04:04 2013 -0400
@@ -218,14 +218,14 @@
      *
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
-     * <pre>
+     * <pre>{@code
      *     list.stream()
      *         .filter(filteringFunction)
      *         .peek(e -> {System.out.println("Filtered value: " + e); });
      *         .map(mappingFunction)
      *         .peek(e -> {System.out.println("Mapped value: " + e); });
      *         .collect(Collectors.toLongSummaryStastistics());
-     * </pre>
+     * }</pre>
      *
      * @param consumer A <a href="package-summary.html#NonInterference">
      *                 non-interfering</a> action to perform on the elements as
@@ -320,12 +320,12 @@
      * an <a href="package-summary.html#Associativity">associative</a>
      * accumulation function, and return the reduced value.  This is equivalent
      * to:
-     * <pre>
+     * <pre>{@code
      *     long result = identity;
      *     for (long element : this stream)
      *         result = accumulator.apply(result, element)
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -341,15 +341,15 @@
      * @apiNote Sum, min, max, and average are all special cases of reduction.
      * Summing a stream of numbers can be expressed as:
      *
-     * <pre>
+     * <pre>{@code
      *     long sum = integers.reduce(0, (a, b) -> a+b);
-     * </pre>
+     * }</pre>
      *
      * or more compactly:
      *
-     * <pre>
+     * <pre>{@code
      *     long sum = integers.reduce(0, Long::sum);
-     * </pre>
+     * }</pre>
      *
      * <p>While this may seem a more roundabout way to perform an aggregation
      * compared to simply mutating a running total in a loop, reduction
@@ -374,7 +374,7 @@
      * <a href="package-summary.html#Associativity">associative</a> accumulation
      * function, and return an {@code OptionalLong} describing the reduced value,
      * if any. This is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     boolean foundAny = false;
      *     long result = null;
      *     for (long element : this stream) {
@@ -385,7 +385,7 @@
      *         else
      *             result = accumulator.apply(result, element)
      *     return foundAny ? OptionalLong.of(result) : OptionalLong.empty();
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -410,12 +410,12 @@
      * such as an {@code ArrayList}, and elements are incorporated by updating
      * the state of the result, rather than by replacing the result.  This
      * produces a result equivalent to:
-     * <pre>
+     * <pre>{@code
      *     R result = resultFactory.get();
      *     for (long element : this stream)
      *         accumulator.accept(result, element);
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * Like {@link #reduce(long, LongBinaryOperator)}, {@code collect} operations
      * can be parallelized without requiring additional sychronization.
@@ -447,9 +447,9 @@
      * Returns the sum of elements in this stream.  This is a special case
      * of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(0, Long::sum);
-     * </pre>
+     * }</pre>
      * @return The sum of elements in this stream
      */
     long sum();
@@ -459,9 +459,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Long::min);
-     * </pre>
+     * }</pre>
      * @return The minimal element of this stream, or an empty
      * {@code OptionalLong}
      */
@@ -472,9 +472,9 @@
      * stream, or an empty optional if this stream is empty.  This is a special
      * case of a <a href="package-summary.html#MutableReduction">reduction</a>
      * and is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return reduce(Long::max);
-     * </pre>
+     * }</pre>
      * @return The maximal element of this stream, or an empty
      * {@code OptionalLong}
      */
@@ -484,9 +484,9 @@
      * Returns the count of elements in this stream.  This is a special case of
      * a <a href="package-summary.html#MutableReduction">reduction</a> and is
      * equivalent to:
-     * <pre>
+     * <pre>{@code
      *     return map(e -> 1).sum();
-     * </pre>
+     * }</pre>
      * @return The count of elements in this stream
      */
     long count();
--- a/src/share/classes/java/util/stream/PipelineHelper.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/PipelineHelper.java	Fri Apr 05 19:04:04 2013 -0400
@@ -90,9 +90,9 @@
      *
      * @implSpec
      * The implementation behaves as if:
-     * <pre>
+     * <pre>{@code
      *     intoWrapped(wrapSink(sink), spliterator);
-     * </pre>
+     * }</pre>
      *
      * @param sink the {@code Sink} to receive the results
      * @param spliterator the spliterator describing the source input to process
--- a/src/share/classes/java/util/stream/Sink.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/Sink.java	Fri Apr 05 19:04:04 2013 -0400
@@ -56,13 +56,13 @@
  * (such as filtering or mapping), and a terminal stage, such as reduction or
  * for-each.  For concreteness, consider the pipeline:
  *
- * <pre>
+ * <pre>{@code
  *     int longestStringLengthStartingWithA
  *         = strings.stream()
  *                  .filter(s -> s.startsWith("A"))
  *                  .mapToInt(String::length)
  *                  .max();
- * </pre>
+ * }</pre>
  *
  * <p>Here, we have three stages, filtering, mapping, and reducing.  The
  * filtering stage consumes strings and emits a subset of those strings; the
@@ -97,13 +97,13 @@
  * intermediate operations will use these chaining wrappers.  For example, the
  * mapping stage in the above example would look like:
  *
- * <pre>
+ * <pre>{@code
  *     IntSink is = new Sink.ChainedReference<U>(sink) {
  *         public void accept(U u) {
  *             downstream.accept(mapper.applyAsInt(u));
  *         }
  *     };
- * </pre>
+ * }</pre>
  *
  * <p>Here, we implement {@code Sink.ChainedReference<U>}, meaning that we expect
  * to receive elements of type {@code U} as input, and pass the downstream sink
--- a/src/share/classes/java/util/stream/Stream.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/Stream.java	Fri Apr 05 19:04:04 2013 -0400
@@ -172,9 +172,9 @@
      * is a stream of purchase orders, and each purchase order contains a
      * collection of line items, then the following produces a stream of line
      * items:
-     * <pre>
+     * <pre>{@code
      *     orderStream.flatMap(order -> order.getLineItems().stream())...
-     * </pre>
+     * }</pre>
      *
      * <p>This implementation is likely to be less efficient than the other
      * form of {@link #flatMap(FlatMapper)}, and is provided for convenience.
@@ -197,13 +197,13 @@
      * transform, and a {@code Consumer} into which it deposits zero or more
      * values corresponding to that element.  For example, to map a stream of
      * strings into a stream of the characters in those strings, you would do:
-     * <pre>
+     * <pre>{@code
      *     stringStream.flatMap((elt, destination) -> {
-     *                              for (i=0; i &lt; elt.length(); i++)
+     *                              for (i=0; i < elt.length(); i++)
      *                                  destination.accept(charAt(i));
      *                          })
      *                 ...
-     * </pre>
+     * }</pre>
      * @implNote
      * This form of {@code flatMap} is usually less convenient to use than the
      * {@link #flatMap(Function)} form, but is often considerably more efficient
@@ -327,14 +327,14 @@
      *
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
-     * <pre>
+     * <pre>{@code
      *     list.stream()
      *         .filter(filteringFunction)
      *         .peek(e -> {System.out.println("Filtered value: " + e); });
      *         .map(mappingFunction)
      *         .peek(e -> {System.out.println("Mapped value: " + e); });
      *         .collect(Collectors.intoList());
-     * </pre>
+     * }</pre>
      *
      * @param consumer A <a href="package-summary.html#NonInterference">
      *                 non-interfering</a> action to perform on the elements as
@@ -446,12 +446,12 @@
      * an <a href="package-summary.html#Associativity">associative</a>
      * accumulation function, and return the reduced value.  This is equivalent
      * to:
-     * <pre>
+     * <pre>{@code
      *     T result = identity;
      *     for (T element : this stream)
      *         result = accumulator.apply(result, element)
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -467,15 +467,15 @@
      * @apiNote Sum, min, max, average, and string concatenation are all special
      * cases of reduction. Summing a stream of numbers can be expressed as:
      *
-     * <pre>
+     * <pre>{@code
      *     Integer sum = integers.reduce(0, (a, b) -> a+b);
-     * </pre>
+     * }</pre>
      *
      * or more compactly:
      *
-     * <pre>
+     * <pre>{@code
      *     Integer sum = integers.reduce(0, Integer::sum);
-     * </pre>
+     * }</pre>
      *
      * <p>While this may seem a more roundabout way to perform an aggregation
      * compared to simply mutating a running total in a loop, reduction
@@ -496,7 +496,7 @@
      * <a href="package-summary.html#Associativity">associative</a> accumulation
      * function, and return an {@code Optional} describing the reduced value,
      * if any. This is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     boolean foundAny = false;
      *     T result = null;
      *     for (T element : this stream) {
@@ -507,7 +507,7 @@
      *         else
      *             result = accumulator.apply(result, element)
      *     return foundAny ? Optional.of(result) : Optional.empty();
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -529,12 +529,12 @@
      * Performs a <a href="package-summary.html#Reduction">reduction</a> on the
      * elements of this stream, using the provided identity, accumulation
      * function, and a combining functions.  This is equivalent to:
-     * <pre>
+     * <pre>{@code
      *     U result = identity;
      *     for (T element : this stream)
      *         result = accumulator.apply(result, element)
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * but is not constrained to execute sequentially.
      *
@@ -543,9 +543,9 @@
      * is equal to {@code u}.  Additionally, the {@code combiner} function
      * must be compatible with the {@code accumulator} function; for all
      * {@code u} and {@code t}, the following must hold:
-     * <pre>
+     * <pre>{@code
      *     combiner.apply(u, accumulator.apply(identity, t)) == accumulator.apply(u, t)
-     * </pre>
+     * }</pre>
      *
      * <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
      *
@@ -581,12 +581,12 @@
      * such as an {@code ArrayList}, and elements are incorporated by updating
      * the state of the result, rather than by replacing the result.  This
      * produces a result equivalent to:
-     * <pre>
+     * <pre>{@code
      *     R result = resultFactory.get();
      *     for (T element : this stream)
      *         accumulator.accept(result, element);
      *     return result;
-     * </pre>
+     * }</pre>
      *
      * Like {@link #reduce(Object, BinaryOperator)}, {@code collect} operations
      * can be parallelized without requiring additional sychronization.
@@ -597,17 +597,17 @@
      * @apiNote There are many existing classes in the JDK whose signatures are
      * a good match for use as arguments to {@code collect()}.  For example,
      * the following will accumulate strings into an ArrayList:
-     * <pre>
-     *     List&lt;String> asList = stringStream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
-     * </pre>
+     * <pre>{@code
+     *     List<String> asList = stringStream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
+     * }</pre>
      *
      * The following will take a stream of strings and concatenates them into a
      * single string:
-     * <pre>
+     * <pre>{@code
      *     String concat = stringStream.collect(StringBuilder::new, StringBuilder::append,
      *                                          StringBuilder::append)
      *                                 .toString();
-     * </pre>
+     * }</pre>
      *
      * @param resultFactory Function that creates a new result container.
      *                      For a parallel execution, this function may be
@@ -647,23 +647,23 @@
      *
      * @apiNote
      * The following will accumulate strings into an ArrayList:
-     * <pre>
-     *     List&lt;String> asList = stringStream.collect(Collectors.toList());
+     * <pre>{@code
+     *     List<String> asList = stringStream.collect(Collectors.toList());
      * }</pre>
      *
      * The following will classify {@code Person} objects by city:
-     * <pre>
-     *     Map&lt;String, Collection&lt;Person>> peopleByCity
+     * <pre>{@code
+     *     Map<String, Collection<Person>> peopleByCity
      *         = personStream.collect(Collectors.groupBy(Person::getCity));
-     * </pre>
+     * }</pre>
      *
      * The following will classify {@code Person} objects by state and city,
      * cascading two {@code Collector}s together:
-     * <pre>
-     *     Map&lt;String, Map&lt;String, Collection&lt;Person>>> peopleByStateAndCity
+     * <pre>{@code
+     *     Map<String, Map<String, Collection<Person>>> peopleByStateAndCity
      *         = personStream.collect(Collectors.groupBy(Person::getState,
      *                                                   Collectors.groupBy(Person::getCity)));
-     * </pre>
+     * }</pre>
      *
      * @param collector The {@code Collector} describing the reduction
      * @param <R> The type of the result
--- a/src/share/classes/java/util/stream/Streams.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/Streams.java	Fri Apr 05 19:04:04 2013 -0400
@@ -866,9 +866,9 @@
      * <p>
      * @implSpec
      * The implementation behaves as if:
-     * <pre>
-     *     longRange(start, end, start &lt;= end ? 1 : -1);
-     * </pre>
+     * <pre>{@code
+     *     longRange(start, end, start <= end ? 1 : -1);
+     * }</pre>
      *
      * @param start the (inclusive) initial value
      * @param end the exclusive upper bound
@@ -891,9 +891,9 @@
      * <p>
      * An equivalent sequence of increasing values can be produced,
      * sequentially, using a {@code for} loop as follows:
-     * <pre>
-     *     for (long i = start; i &lt; end ; i += step) { ... }
-     * </pre>
+     * <pre>{@code
+     *     for (long i = start; i < end ; i += step) { ... }
+     * }</pre>
      *
      * @param start the (inclusive) initial value
      * @param end the exclusive upper bound
@@ -994,9 +994,9 @@
      * <p>
      * @implSpec
      * The implementation behaves as if:
-     * <pre>
-     *     doubleRange(start, end, start &lt;= end ? 1.0 : -1.0);
-     * </pre>
+     * <pre>{@code
+     *     doubleRange(start, end, start <= end ? 1.0 : -1.0);
+     * }</pre>
      *
      * @param start the (inclusive) initial value
      * @param end the exclusive upper bound
@@ -1021,19 +1021,19 @@
      * <p>
      * An equivalent sequence of increasing values can be produced,
      * sequentially, using a {@code for} loop as follows:
-     * <pre>
+     * <pre>{@code
      *     long size = (long) Math.ceil((start - end) / step);
      *     long i = 0
      *     for (double v = start; i < size; i++, v = start + step * i) {
      *         ...
      *     }
-     * </pre>
+     * }</pre>
      * A stream of equivalent values can be produced as follows:
-     * <pre>
+     * <pre>{@code
      *     long size = (long) Math.ceil((start - end) / step);
      *     DoubleStream ds = Streams.longStream(0, size).doubles()
      *         .map(i -> start + step * i);
-     * </pre>
+     * }</pre>
      *
      * @param start the (inclusive) initial value
      * @param end the exclusive upper bound
--- a/src/share/classes/java/util/stream/package-info.java	Fri Apr 05 17:44:17 2013 -0400
+++ b/src/share/classes/java/util/stream/package-info.java	Fri Apr 05 19:04:04 2013 -0400
@@ -26,11 +26,11 @@
 /**
  * Classes to support functional-style operations on streams of values, as in the following:
  *
- * <pre>
+ * <pre>{@code
  *     int sumOfWeights = blocks.stream().filter(b -> b.getColor() == RED)
  *                                       .mapToInt(b -> b.getWeight())
  *                                       .sum();
- * </pre>
+ * }</pre>
  *
  * <p>Here we use {@code blocks}, which might be a {@code Collection}, as a source for a stream,
  * and then perform a filter-map-reduce ({@code sum()} is an example of a {@link #Reduction reduction}
@@ -79,14 +79,14 @@
  * return to the data source, or select a new data source, to get a new stream. For example,
  * obtaining the sum of weights of all red blocks, and then of all blue blocks, requires a
  * filter-map-reduce on two different streams:
- * <pre>
+ * <pre>{@code
  *     int sumOfRedWeights  = blocks.stream().filter(b -> b.getColor() == RED)
  *                                           .mapToInt(b -> b.getWeight())
  *                                           .sum();
  *     int sumOfBlueWeights = blocks.stream().filter(b -> b.getColor() == BLUE)
  *                                           .mapToInt(b -> b.getWeight())
  *                                           .sum();
- * </pre>
+ * }</pre>
  *
  * <p>However, there are other techniques that allow you to obtain both results in a single
  * pass if multiple traversal is impractical or inefficient.  TODO provide link
@@ -143,11 +143,11 @@
  * result. The set of operations on serial and parallel streams is identical. To execute the
  * "sum of weights of blocks" query in parallel, we would do:
  *
- * <pre>
+ * <pre>{@code
  *     int sumOfWeights = blocks.parallelStream().filter(b -> b.getColor() == RED)
  *                                               .mapToInt(b -> b.getWeight())
  *                                               .sum();
- * </pre>
+ * }</pre>
  *
  * <p>The only difference between the serial and parallel versions of this example code is
  * the creation of the initial {@code Stream}.  Whether a {@code Stream} will execute in serial
@@ -224,10 +224,10 @@
  * stream operations are <em>stateful</em>.  A stateful lambda (or other object implementing the
  * appropriate functional interface) is one whose result depends on any state which might change
  * during the execution of the stream pipeline.  An example of a stateful lambda is:
- * <pre>
+ * <pre>{@code
  *     Set<Integer> seen = Collections.synchronizedSet(new HashSet<>());
  *     stream.parallel().map(e -> { if (seen.add(e)) return 0; else return e; })...
- * </pre>
+ * }</pre>
  * Here, if the mapping operation us performed in parallel, the results for the same input
  * could vary from run to run, due to thread scheduling differences, whereas, with a stateless
  * lambda expression the results would always be the same.
@@ -244,24 +244,24 @@
  * from each block before summing up the weights.)
  *
  * <p>Of course, such operations can be readily implemented as simple sequential loops, as in:
- * <pre>
+ * <pre>{@code
  *    int sum = 0;
  *    for (int x : numbers) {
  *       sum += x;
  *    }
- * </pre>
+ * }</pre>
  * However, there may be a significant advantage to preferring a {@link Stream#reduce reduce operation}
  * over a mutative accumulation such as the above -- a properly constructed reduce operation is
  * inherently parallelizable, so long as the {@link BinaryOperator} has the right characteristics,
  * specifically that it is <a href="#Associativity">associative</a>.  For example, given a
  * stream of numbers for which we want to find the sum, we can write:
- * <pre>
+ * <pre>{@code
  *    int sum = numbers.reduce(0, (x,y) -> x+y);
- * </pre>
+ * }</pre>
  * or more succinctly:
- * <pre>
+ * <pre>{@code
  *    int sum = numbers.reduce(0, Integer::sum);
- * </pre>
+ * }</pre>
  *
  * <p>(The primitive specializations of {@link java.util.stream.Stream}, such as
  * {@link java.util.stream.IntStream}, even have convenience methods for common reductions,
@@ -280,19 +280,19 @@
  * <p>The "blocks" examples shown earlier shows how reduction combines with other operations
  * to replace for loops with bulk operations.  If {@code blocks} is a collection of {@code Block}
  * objects, which have a {@code getWeight} method, we can find the heaviest block with:
- * <pre>
+ * <pre>{@code
  *     OptionalInt heaviest = blocks.stream()
  *                                  .mapToInt(Block::getWeight)
  *                                  .reduce(Integer::max);
- * </pre>
+ * }</pre>
  *
  * <p>In its more general form, a {@code reduce} operation on elements of type {@code T}
  * yielding a result of type {@code U} requires three parameters:
- * <pre>
- * &lt;U> U reduce(U identity,
- *                 BiFunction&lt;U, ? super T, U> accumlator,
- *                 BinaryOperator&lt;U> combiner);
- * </pre>
+ * <pre>{@code
+ * <U> U reduce(U identity,
+ *              BiFunction<U, ? super T, U> accumlator,
+ *              BinaryOperator<U> combiner);
+ * }</pre>
  * Here, the <em>identity</em> element is both an initial seed for the reduction, and a default
  * result if there are no elements. The <em>accumulator</em> function takes a partial result and
  * the next element, and produce a new partial result. The <em>combiner</em> function combines
@@ -304,11 +304,11 @@
  * example using the more general form, {@code 0} would be the identity element, while
  * {@code Integer::sum} would be both the accumulator and combiner. For the sum-of-weights
  * example, this could be re-cast as:
- * <pre>
+ * <pre>{@code
  *     int sumOfWeights = blocks.stream().reduce(0,
  *                                               (sum, b) -> sum + b.getWeight())
  *                                               Integer::sum);
- * </pre>
+ * }</pre>
  * though the map-reduce form is more readable and generally preferable.  The generalized form
  * is provided for cases where significant work can be optimized away by combining mapping and
  * reducing into a single function.
@@ -318,9 +318,9 @@
  * to {@code u}. Additionally, the {@code combiner} function must be
  * <a href="#Associativity">associative</a> and must be compatible with the {@code accumulator}
  * function; for all {@code u} and {@code t}, the following must hold:
- * <pre>
+ * <pre>{@code
  *     combiner.apply(u, accumulator.apply(identity, t)) == accumulator.apply(u, t)
- * </pre>
+ * }</pre>
  *
  * <h3><a name="MutableReduction">Mutable Reduction</a></h3>
  *
@@ -331,9 +331,9 @@
  *
  * <p>For example, if we wanted to take a stream of strings and concatenate them into a single
  * long string, we <em>could</em> achieve this with ordinary reduction:
- * <pre>
+ * <pre>{@code
  *     String concatenated = strings.reduce("", String::concat)
- * </pre>
+ * }</pre>
  *
  * We would get the desired result, and it would even work in parallel.  However, we might not
  * be happy about the performance!  Such an implementation would do a great deal of string
@@ -349,33 +349,33 @@
  * container by incorporating a new element, and a combining function that can take two
  * result containers and merge their contents.  The form of this is very similar to the general
  * form of ordinary reduction:
- * <pre>
- * &lt;R> R collect(Supplier&lt;R> resultFactory,
- *                  BiConsumer&lt;R, ? super T> accumulator,
- *                  BiConsumer&lt;R, R> combiner);
- * </pre>
+ * <pre>{@code
+ * <R> R collect(Supplier<R> resultFactory,
+ *               BiConsumer<R, ? super T> accumulator,
+ *               BiConsumer<R, R> combiner);
+ * }</pre>
  * As with {@code reduce()}, the benefit of expressing {@collect} in this abstract way is
  * that it is directly amenable to parallelization: we can accumulate partial results in parallel
  * and then combine them.  For example, to collect the string representations of the elements
  * in a stream into an {@code ArrayList}, we could write the obvious sequential for-each form:
- * <pre>
- *     ArrayList&lt;String> strings = new ArrayList&lt;>();
+ * <pre>{@code
+ *     ArrayList<String> strings = new ArrayList<>();
  *     for (T element : stream) {
  *         strings.add(element.toString());
  *     }
- * </pre>
+ * }</pre>
  * Or we could use a parallelizable collect form:
- * <pre>
- *     ArrayList&lt;String> strings = stream.collect(() -> new ArrayList&lt;>(),
- *                                                   (c, e) -> c.add(e.toString()),
- *                                                   (c1, c2) -> c1.addAll(c2));
- * </pre>
+ * <pre>{@code
+ *     ArrayList<String> strings = stream.collect(() -> new ArrayList<>(),
+ *                                                (c, e) -> c.add(e.toString()),
+ *                                                (c1, c2) -> c1.addAll(c2));
+ * }</pre>
  * or, noting that we have buried a mapping operation inside the accumlator function, more
  * succinctly as:
- * <pre>
- *     ArrayList&lt;String> strings = stream.map(Object::toString)
- *                                          .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
- * </pre>
+ * <pre>{@code
+ *     ArrayList<String> strings = stream.map(Object::toString)
+ *                                       .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
+ * }</pre>
  * Here, our supplier is just the {@link ArrayList#ArrayList() ArrayList constructor}, the
  * accumulator adds the stringified element to an {@code ArrayList}, and the combiner simply
  * uses {@link ArrayList#addAll addAll} to copy the strings from one container into the other.
@@ -383,34 +383,34 @@
  * <p>As with the regular reduction operation, the ability to parallelize only comes if an 
  * {@link #Associativity associativity} condition is met. The {@code combiner} is associative
  * if for result containers {@code r1}, {@code r2}, and {@code r3}:
- * <pre>
+ * <pre>{@code
  *    combiner.accept(r1, r2);
  *    combiner.accept(r1, r3);
- * </pre>
+ * }</pre>
  * is equivalent to
- * <pre>
+ * <pre>{@code
  *    combiner.accept(r2, r3);
  *    combiner.accept(r1, r2);
- * </pre>
+ * }</pre>
  * where equivalence means that {@code r1} is left in the same state (according to the meaning
  * of {@link Object#equals equals} for the element types). Similarly, the {@code resultFactory}
  * must act as an <em>identity</em> with respect to the {@code combiner} so that for any result
  * container {@code r}:
- * <pre>
+ * <pre>{@code
  *     combiner.accept(r, resultFactory.get());
- * </pre>
+ * }</pre>
  * does not modify the state of {@code r} (again according to the meaning of
  * {@link Object#equals equals}). Finally, the {@code accumulator} and {@code combiner} must be
  * compatible such that for a result container {@code r} and element {@code t}:
- * <pre>
+ * <pre>{@code
  *    r2 = resultFactory.get();
  *    accumulator.accept(r2, t);
  *    combiner.accept(r, r2);
- * </pre>
+ * }</pre>
  * is equivalent to:
- * <pre>
+ * <pre>{@code
  *    accumulator.accept(r,t);
- * </pre>
+ * }</pre>
  * where equivalence means that {@code r} is left in the same state (again according to the
  * meaning of {@link Object#equals equals}).
  *
@@ -420,19 +420,19 @@
  * method that simply takes a {@code Collector} and returns the resulting container.
  * The above example for collecting strings into a {@code List} can be rewritten using a
  * standard {@code Collector} as:
- * <pre>
- *     ArrayList&lt;String> strings = stream.map(Object::toString)
- *                                          .collect(Collectors.toList());
- * </pre>
+ * <pre>{@code
+ *     ArrayList<String> strings = stream.map(Object::toString)
+ *                                       .collect(Collectors.toList());
+ * }</pre>
  *
  * <h3><a name="ConcurrentReduction">Reduction, concurrency, and ordering</a></h3>
  *
  * With some complex reduction operations, such as those that produce a
  * {@code Map}, such as:
- * <pre>
+ * <pre>{@code
  *     Map<Buyer, List<Transaction>> salesByBuyer
  *         = txns.stream().collect(groupingBy(Transaction::getBuyer));
- * </pre>
+ * }</pre>
  *
  * it may actually be counterproductive to perform this reduction in parallel,
  * because the merging step (merging one {@code Map} into another by key)
@@ -455,23 +455,23 @@
  * and either the stream is unordered or the collector has the
  * {@link java.util.stream.Collector.Characteristics.UNORDERED} characteristic,
  * as in:
- * <pre>
+ * <pre>{@code
  *     Map<Buyer, List<Transaction>> salesByBuyer
  *         = txns.stream()
  *               .unordered()
  *               .collect(groupingByConcurrent(Transaction::getBuyer));
- * </pre>
+ * }</pre>
  *
  * <a name="Associativity"><h2>Associativity</h2></a>
  *
  * An operator or function {@code op} is <em>associative</em> if the following holds:
- * <pre>
+ * <pre>{@code
  *     (a op b) op c == a op (b op c)
- * </pre>
+ * }</pre>
  * The importance of this to parallel evaluation can be seen if we expand this to four terms:
- * <pre>
+ * <pre>{@code
  *     a op b op c op d == (a op b) op (c op d)
- * </pre>
+ * }</pre>
  * So we can evaluate {@code (a op b)} in parallel with {@code (c op d)} and then invoke {@code op} on
  * the results.
  * TODO what does associative mean for mutative combining functions?
@@ -516,22 +516,22 @@
  * might not be reflected and the throwing of a {@code ConcurrentModificationException} may occur.
  *
  * <p>For example, consider the following code:
- * <pre>
- *     List&lt;String> l = new ArrayList(Arrays.asList("one", "two"));
- *     Stream&lt;String> sl = l.stream();
+ * <pre>{@code
+ *     List<String> l = new ArrayList(Arrays.asList("one", "two"));
+ *     Stream<String> sl = l.stream();
  *     l.add("three");
  *     String s = sl.collect(toStringJoiner(" ")).toString();
- * </pre>
+ * }</pre>
  * First a list is created consisting of two strings: "one"; and "two". Then a stream is created from that list.
  * Next the list is modified by adding a third string: "three".  Finally the elements of the stream are collected
  * and joined together.  Since the list was modified before the terminal {@code collect} operation commenced
  * the result will be a string of "one two three". However, if the list is modified after the terminal operation
  * commences, as in:
- * <pre>
- *     List&lt;String> l = new ArrayList(Arrays.asList("one", "two"));
- *     Stream&lt;String> sl = l.stream();
+ * <pre>{@code
+ *     List<String> l = new ArrayList(Arrays.asList("one", "two"));
+ *     Stream<String> sl = l.stream();
  *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(toStringJoiner(" ")).toString();
- * </pre>
+ * }</pre>
  * then a {@code ConcurrentModificationException} will be thrown since the {@code peek} operation will attempt
  * to add the string "BAD LAMBDA" to the list after the terminal operation has commenced.
  *