8241014: Miscellaneous typos in documentation comments

Reviewed-by: igerasim, prappo, psandoz, rriggs, weijun
This commit is contained in:
Pavel Rappo 2020-03-20 20:54:56 +00:00
parent c5a7490809
commit 17ff85d4ad
39 changed files with 104 additions and 107 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -2794,7 +2794,7 @@ public class Arrays {
* Two doubles {@code d1} and {@code d2} are considered equal if:
* <pre> {@code new Double(d1).equals(new Double(d2))}</pre>
* (Unlike the {@code ==} operator, this method considers
* {@code NaN} equals to itself, and 0.0d unequal to -0.0d.)
* {@code NaN} equal to itself, and 0.0d unequal to -0.0d.)
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
@ -2827,7 +2827,7 @@ public class Arrays {
* <p>Two doubles {@code d1} and {@code d2} are considered equal if:
* <pre> {@code new Double(d1).equals(new Double(d2))}</pre>
* (Unlike the {@code ==} operator, this method considers
* {@code NaN} equals to itself, and 0.0d unequal to -0.0d.)
* {@code NaN} equal to itself, and 0.0d unequal to -0.0d.)
*
* @param a the first array to be tested for equality
* @param aFromIndex the index (inclusive) of the first element in the
@ -2877,7 +2877,7 @@ public class Arrays {
* Two floats {@code f1} and {@code f2} are considered equal if:
* <pre> {@code new Float(f1).equals(new Float(f2))}</pre>
* (Unlike the {@code ==} operator, this method considers
* {@code NaN} equals to itself, and 0.0f unequal to -0.0f.)
* {@code NaN} equal to itself, and 0.0f unequal to -0.0f.)
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
@ -2910,7 +2910,7 @@ public class Arrays {
* <p>Two floats {@code f1} and {@code f2} are considered equal if:
* <pre> {@code new Float(f1).equals(new Float(f2))}</pre>
* (Unlike the {@code ==} operator, this method considers
* {@code NaN} equals to itself, and 0.0f unequal to -0.0f.)
* {@code NaN} equal to itself, and 0.0f unequal to -0.0f.)
*
* @param a the first array to be tested for equality
* @param aFromIndex the index (inclusive) of the first element in the
@ -7493,7 +7493,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -7620,7 +7620,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -7747,7 +7747,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -7874,7 +7874,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8001,7 +8001,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8128,7 +8128,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8255,7 +8255,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8382,7 +8382,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8513,7 +8513,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
@ -8659,7 +8659,7 @@ public class Arrays {
* <p>Two non-{@code null} arrays, {@code a} and {@code b} with specified
* ranges [{@code aFromIndex}, {@code atoIndex}) and
* [{@code bFromIndex}, {@code btoIndex}) respectively, share a proper
* if the following expression is true:
* prefix if the following expression is true:
* <pre>{@code
* (aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
* Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1054,7 +1054,7 @@ public class BitSet implements Cloneable, java.io.Serializable {
/**
* Compares this object against the specified object.
* The result is {@code true} if and only if the argument is
* not {@code null} and is a {@code Bitset} object that has
* not {@code null} and is a {@code BitSet} object that has
* exactly the same set of bits set to {@code true} as this bit
* set. That is, for every nonnegative {@code int} index {@code k},
* <pre>((BitSet)obj).get(k) == this.get(k)</pre>

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,7 +88,7 @@ public interface Enumeration<E> {
* @apiNote
* This method is intended to help adapt code that produces
* {@code Enumeration} instances to code that consumes {@code Iterator}
* instances. For example, the {@link java.util.jar.JarFile#entries
* instances. For example, the {@link java.util.jar.JarFile#entries()
* JarFile.entries()} method returns an {@code Enumeration<JarEntry>}.
* This can be turned into an {@code Iterator}, and then the
* {@code forEachRemaining()} method can be used:
@ -98,7 +98,7 @@ public interface Enumeration<E> {
* jarFile.entries().asIterator().forEachRemaining(entry -> { ... });
* }</pre>
*
* (Note that there is also a {@link java.util.jar.JarFile#stream
* (Note that there is also a {@link java.util.jar.JarFile#stream()
* JarFile.stream()} method that returns a {@code Stream} of entries,
* which may be more convenient in some cases.)
*

View file

@ -732,8 +732,7 @@ public interface Map<K, V> {
* {@code null}, else returns the current value.
*
* @implSpec
* The default implementation is equivalent to, for this {@code
* map}:
* The default implementation is equivalent to, for this {@code map}:
*
* <pre> {@code
* V v = map.get(key);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -77,8 +77,8 @@ public final class StringJoiner {
private int len;
/**
* When overridden by the user to be non-null via {@link setEmptyValue}, the
* string returned by toString() when no elements have yet been added.
* When overridden by the user to be non-null via {@link #setEmptyValue(CharSequence)},
* the string returned by toString() when no elements have yet been added.
* When null, prefix + suffix is used as the empty value.
*/
private String emptyValue;

View file

@ -778,14 +778,13 @@ public final class Pattern
implements java.io.Serializable
{
/**
/*
* Regular expression modifier values. Instead of being passed as
* arguments, they can also be passed as inline modifiers.
* For example, the following statements have the same effect.
* <pre>
* Pattern p1 = Pattern.compile("abc", Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
* Pattern p2 = Pattern.compile("(?im)abc", 0);
* </pre>
*
* Pattern p1 = Pattern.compile("abc", Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
* Pattern p2 = Pattern.compile("(?im)abc", 0);
*/
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -932,7 +932,7 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
* additional synchronization is needed for a parallel reduction.
*
* @apiNote
* The following will accumulate strings into an ArrayList:
* The following will accumulate strings into a List:
* <pre>{@code
* List<String> asList = stringStream.collect(Collectors.toList());
* }</pre>

View file

@ -316,7 +316,7 @@
* see the API note documented on the {@link java.util.stream.Stream#count count}
* operation.)
*
* <p>Many computations where one might be tempted to use side effects can be more
* <p>Many computations where one might be tempted to use side-effects can be more
* safely and efficiently expressed without side-effects, such as using
* <a href="package-summary.html#Reduction">reduction</a> instead of mutable
* accumulators. However, side-effects such as using {@code println()} for debugging
@ -445,7 +445,7 @@
* required.
*
* <p>The "widgets" examples shown earlier shows how reduction combines with
* other operations to replace for loops with bulk operations. If {@code widgets}
* other operations to replace for-loops with bulk operations. If {@code widgets}
* is a collection of {@code Widget} objects, which have a {@code getWeight} method,
* we can find the heaviest widget with:
* <pre>{@code