implements Se
/**
* Compares the specified object with this set for equality. Returns
- * true if the given object is also a set, the two sets have
+ * {@code true} if the given object is also a set, the two sets have
* the same size, and every member of the given set is contained in
- * this set. This ensures that the equals method works
- * properly across different implementations of the Set
+ * this set. This ensures that the {@code equals} method works
+ * properly across different implementations of the {@code Set}
* interface.
*
* This implementation first checks if the specified object is this
- * set; if so it returns true. Then, it checks if the
+ * set; if so it returns {@code true}. Then, it checks if the
* specified object is a set whose size is identical to the size of
* this set; if not, it returns false. If so, it returns
- * containsAll((Collection) o).
+ * {@code containsAll((Collection) o)}.
*
* @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
+ * @return {@code true} if the specified object is equal to this set
*/
public boolean equals(Object o) {
if (o == this)
@@ -103,14 +103,14 @@ public abstract class AbstractSet extends AbstractCollection implements Se
/**
* Returns the hash code value for this set. The hash code of a set is
* defined to be the sum of the hash codes of the elements in the set,
- * where the hash code of a null element is defined to be zero.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two sets s1
- * and s2, as required by the general contract of
+ * where the hash code of a {@code null} element is defined to be zero.
+ * This ensures that {@code s1.equals(s2)} implies that
+ * {@code s1.hashCode()==s2.hashCode()} for any two sets {@code s1}
+ * and {@code s2}, as required by the general contract of
* {@link Object#hashCode}.
*
* This implementation iterates over the set, calling the
- * hashCode method on each element in the set, and adding up
+ * {@code hashCode} method on each element in the set, and adding up
* the results.
*
* @return the hash code value for this set
@@ -136,24 +136,24 @@ public abstract class AbstractSet extends AbstractCollection implements Se
* the two sets.
*
* This implementation determines which is the smaller of this set
- * and the specified collection, by invoking the size
+ * and the specified collection, by invoking the {@code size}
* method on each. If this set has fewer elements, then the
* implementation iterates over this set, checking each element
* returned by the iterator in turn to see if it is contained in
* the specified collection. If it is so contained, it is removed
- * from this set with the iterator's remove method. If
+ * from this set with the iterator's {@code remove} method. If
* the specified collection has fewer elements, then the
* implementation iterates over the specified collection, removing
* from this set each element returned by the iterator, using this
- * set's remove method.
+ * set's {@code remove} method.
*
*
Note that this implementation will throw an
- * UnsupportedOperationException if the iterator returned by the
- * iterator method does not implement the remove method.
+ * {@code UnsupportedOperationException} if the iterator returned by the
+ * {@code iterator} method does not implement the {@code remove} method.
*
* @param c collection containing elements to be removed from this set
- * @return true if this set changed as a result of the call
- * @throws UnsupportedOperationException if the removeAll operation
+ * @return {@code true} if this set changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code removeAll} operation
* is not supported by this set
* @throws ClassCastException if the class of an element of this set
* is incompatible with the specified collection
diff --git a/jdk/src/java.base/share/classes/java/util/ArrayList.java b/jdk/src/java.base/share/classes/java/util/ArrayList.java
index 7a3ad72fb46c39fabeb9073dfab8c7078d8f4d5c..6afb4338350aedd6a4039764af4381020d57d6ed 100644
--- a/jdk/src/java.base/share/classes/java/util/ArrayList.java
+++ b/jdk/src/java.base/share/classes/java/util/ArrayList.java
@@ -294,7 +294,7 @@ public class ArrayList extends AbstractList
* Returns {@code true} if this list contains the specified element.
* More formally, returns {@code true} if and only if this list contains
* at least one element {@code e} such that
- * (o==null ? e==null : o.equals(e)).
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this list is to be tested
* @return {@code true} if this list contains the specified element
@@ -307,7 +307,7 @@ public class ArrayList extends AbstractList
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the lowest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*/
public int indexOf(Object o) {
@@ -327,7 +327,7 @@ public class ArrayList extends AbstractList
* Returns the index of the last occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the highest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*/
public int lastIndexOf(Object o) {
@@ -511,7 +511,7 @@ public class ArrayList extends AbstractList
* if it is present. If the list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
* {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i)))
+ * {@code Objects.equals(o, get(i))}
* (if such an element exists). Returns {@code true} if this list
* contained the specified element (or equivalently, if this list
* changed as a result of the call).
diff --git a/jdk/src/java.base/share/classes/java/util/Arrays.java b/jdk/src/java.base/share/classes/java/util/Arrays.java
index 70049da58028fdf9e05113ca8ace7a577c32b002..35962987cc82b9f3541fd7316d189939db53beba 100644
--- a/jdk/src/java.base/share/classes/java/util/Arrays.java
+++ b/jdk/src/java.base/share/classes/java/util/Arrays.java
@@ -1772,10 +1772,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -1802,11 +1802,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -1853,10 +1853,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -1883,11 +1883,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -1934,10 +1934,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -1964,11 +1964,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2015,10 +2015,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2045,11 +2045,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2096,10 +2096,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2126,11 +2126,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2178,10 +2178,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2209,11 +2209,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2269,10 +2269,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2300,11 +2300,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2366,10 +2366,10 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2404,11 +2404,11 @@ public class Arrays {
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2464,13 +2464,13 @@ public class Arrays {
* @param a the array to be searched
* @param key the value to be searched for
* @param c the comparator by which the array is ordered. A
- * null value indicates that the elements'
+ * {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @return index of the search key, if it is contained in the array;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
- * element greater than the key, or a.length if all
+ * element greater than the key, or {@code a.length} if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2503,15 +2503,15 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @param c the comparator by which the array is ordered. A
- * null value indicates that the elements'
+ * {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @return index of the search key, if it is contained in the array
* within the specified range;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
- * or toIndex if all
+ * or {@code toIndex} if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -2557,16 +2557,16 @@ public class Arrays {
// Equality Testing
/**
- * Returns true if the two specified arrays of longs are
+ * Returns {@code true} if the two specified arrays of longs are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(long[] a, long[] a2) {
if (a==a2)
@@ -2586,16 +2586,16 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of ints are
+ * Returns {@code true} if the two specified arrays of ints are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(int[] a, int[] a2) {
if (a==a2)
@@ -2615,16 +2615,16 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of shorts are
+ * Returns {@code true} if the two specified arrays of shorts are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(short[] a, short a2[]) {
if (a==a2)
@@ -2644,16 +2644,16 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of chars are
+ * Returns {@code true} if the two specified arrays of chars are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
@HotSpotIntrinsicCandidate
public static boolean equals(char[] a, char[] a2) {
@@ -2674,16 +2674,16 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of bytes are
+ * Returns {@code true} if the two specified arrays of bytes are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(byte[] a, byte[] a2) {
if (a==a2)
@@ -2703,16 +2703,16 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of booleans are
+ * Returns {@code true} if the two specified arrays of booleans are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(boolean[] a, boolean[] a2) {
if (a==a2)
@@ -2732,21 +2732,21 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of doubles are
+ * Returns {@code true} if the two specified arrays of doubles are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
- * Two doubles d1 and d2 are considered equal if:
- * new Double(d1).equals(new Double(d2))
- * (Unlike the == operator, this method considers
- * NaN equals to itself, and 0.0d unequal to -0.0d.)
+ * Two doubles {@code d1} and {@code d2} are considered equal if:
+ * {@code new Double(d1).equals(new Double(d2))}
+ * (Unlike the {@code ==} operator, this method considers
+ * {@code NaN} equals 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
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
* @see Double#equals(Object)
*/
public static boolean equals(double[] a, double[] a2) {
@@ -2767,21 +2767,21 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of floats are
+ * Returns {@code true} if the two specified arrays of floats are
* equal to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
- * two array references are considered equal if both are null.
+ * two array references are considered equal if both are {@code null}.
*
- * Two floats f1 and f2 are considered equal if:
- * new Float(f1).equals(new Float(f2))
- * (Unlike the == operator, this method considers
- * NaN equals to itself, and 0.0f unequal to -0.0f.)
+ * Two floats {@code f1} and {@code f2} are considered equal if:
+ * {@code new Float(f1).equals(new Float(f2))}
+ * (Unlike the {@code ==} operator, this method considers
+ * {@code NaN} equals 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
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
* @see Float#equals(Object)
*/
public static boolean equals(float[] a, float[] a2) {
@@ -2802,18 +2802,19 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays of Objects are
+ * Returns {@code true} if the two specified arrays of Objects are
* equal to one another. The two arrays are considered equal if
* both arrays contain the same number of elements, and all corresponding
- * pairs of elements in the two arrays are equal. Two objects e1
- * and e2 are considered equal if (e1==null ? e2==null
- * : e1.equals(e2)). In other words, the two arrays are equal if
+ * pairs of elements in the two arrays are equal. Two objects {@code e1}
+ * and {@code e2} are considered equal if
+ * {@code Objects.equals(e1, e2)}.
+ * In other words, the two arrays are equal if
* they contain the same elements in the same order. Also, two array
- * references are considered equal if both are null.
+ * references are considered equal if both are {@code null}.
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
*/
public static boolean equals(Object[] a, Object[] a2) {
if (a==a2)
@@ -2852,8 +2853,8 @@ public class Arrays {
/**
* Assigns the specified long value to each element of the specified
* range of the specified array of longs. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -2862,9 +2863,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(long[] a, int fromIndex, int toIndex, long val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -2887,8 +2888,8 @@ public class Arrays {
/**
* Assigns the specified int value to each element of the specified
* range of the specified array of ints. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -2897,9 +2898,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(int[] a, int fromIndex, int toIndex, int val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -2922,8 +2923,8 @@ public class Arrays {
/**
* Assigns the specified short value to each element of the specified
* range of the specified array of shorts. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -2932,9 +2933,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(short[] a, int fromIndex, int toIndex, short val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -2957,8 +2958,8 @@ public class Arrays {
/**
* Assigns the specified char value to each element of the specified
* range of the specified array of chars. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -2967,9 +2968,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(char[] a, int fromIndex, int toIndex, char val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -2992,8 +2993,8 @@ public class Arrays {
/**
* Assigns the specified byte value to each element of the specified
* range of the specified array of bytes. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -3002,9 +3003,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(byte[] a, int fromIndex, int toIndex, byte val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -3027,8 +3028,8 @@ public class Arrays {
/**
* Assigns the specified boolean value to each element of the specified
* range of the specified array of booleans. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -3037,9 +3038,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(boolean[] a, int fromIndex, int toIndex,
boolean val) {
@@ -3063,8 +3064,8 @@ public class Arrays {
/**
* Assigns the specified double value to each element of the specified
* range of the specified array of doubles. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -3073,9 +3074,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(double[] a, int fromIndex, int toIndex,double val){
rangeCheck(a.length, fromIndex, toIndex);
@@ -3098,8 +3099,8 @@ public class Arrays {
/**
* Assigns the specified float value to each element of the specified
* range of the specified array of floats. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -3108,9 +3109,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
*/
public static void fill(float[] a, int fromIndex, int toIndex, float val) {
rangeCheck(a.length, fromIndex, toIndex);
@@ -3135,8 +3136,8 @@ public class Arrays {
/**
* Assigns the specified Object reference to each element of the specified
* range of the specified array of Objects. The range to be filled
- * extends from index fromIndex, inclusive, to index
- * toIndex, exclusive. (If fromIndex==toIndex, the
+ * extends from index {@code fromIndex}, inclusive, to index
+ * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be filled is empty.)
*
* @param a the array to be filled
@@ -3145,9 +3146,9 @@ public class Arrays {
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0 or
- * toIndex > a.length
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+ * {@code toIndex > a.length}
* @throws ArrayStoreException if the specified value is not of a
* runtime type that can be stored in the specified array
*/
@@ -3164,7 +3165,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain null.
+ * copy but not the original, the copy will contain {@code null}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
* The resulting array is of exactly the same class as the original array.
@@ -3174,8 +3175,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with nulls
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
@SuppressWarnings("unchecked")
@@ -3188,10 +3189,10 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain null.
+ * copy but not the original, the copy will contain {@code null}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
- * The resulting array is of the class newType.
+ * The resulting array is of the class {@code newType}.
*
* @param the class of the objects in the original array
* @param the class of the objects in the returned array
@@ -3200,11 +3201,11 @@ public class Arrays {
* @param newType the class of the copy to be returned
* @return a copy of the original array, truncated or padded with nulls
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @throws ArrayStoreException if an element copied from
- * original is not of a runtime type that can be stored in
- * an array of class newType
+ * {@code original} is not of a runtime type that can be stored in
+ * an array of class {@code newType}
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@@ -3223,7 +3224,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain (byte)0.
+ * copy but not the original, the copy will contain {@code (byte)0}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3231,8 +3232,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static byte[] copyOf(byte[] original, int newLength) {
@@ -3247,7 +3248,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain (short)0.
+ * copy but not the original, the copy will contain {@code (short)0}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3255,8 +3256,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static short[] copyOf(short[] original, int newLength) {
@@ -3271,7 +3272,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain 0.
+ * copy but not the original, the copy will contain {@code 0}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3279,8 +3280,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static int[] copyOf(int[] original, int newLength) {
@@ -3295,7 +3296,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain 0L.
+ * copy but not the original, the copy will contain {@code 0L}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3303,8 +3304,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static long[] copyOf(long[] original, int newLength) {
@@ -3319,7 +3320,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are valid
* in both the original array and the copy, the two arrays will contain
* identical values. For any indices that are valid in the copy but not
- * the original, the copy will contain '\\u000'. Such indices
+ * the original, the copy will contain {@code '\\u000'}. Such indices
* will exist if and only if the specified length is greater than that of
* the original array.
*
@@ -3327,8 +3328,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with null characters
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static char[] copyOf(char[] original, int newLength) {
@@ -3343,7 +3344,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain 0f.
+ * copy but not the original, the copy will contain {@code 0f}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3351,8 +3352,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static float[] copyOf(float[] original, int newLength) {
@@ -3367,7 +3368,7 @@ public class Arrays {
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain 0d.
+ * copy but not the original, the copy will contain {@code 0d}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3375,8 +3376,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static double[] copyOf(double[] original, int newLength) {
@@ -3387,11 +3388,11 @@ public class Arrays {
}
/**
- * Copies the specified array, truncating or padding with false (if necessary)
+ * Copies the specified array, truncating or padding with {@code false} (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
- * copy but not the original, the copy will contain false.
+ * copy but not the original, the copy will contain {@code false}.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
@@ -3399,8 +3400,8 @@ public class Arrays {
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with false elements
* to obtain the specified length
- * @throws NegativeArraySizeException if newLength is negative
- * @throws NullPointerException if original is null
+ * @throws NegativeArraySizeException if {@code newLength} is negative
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static boolean[] copyOf(boolean[] original, int newLength) {
@@ -3412,17 +3413,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * null is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code null} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* The resulting array is of exactly the same class as the original array.
*
@@ -3435,8 +3436,8 @@ public class Arrays {
* truncated or padded with nulls to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
@SuppressWarnings("unchecked")
@@ -3446,18 +3447,18 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * null is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
- * The resulting array is of the class newType.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code null} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
+ * The resulting array is of the class {@code newType}.
*
* @param the class of the objects in the original array
* @param the class of the objects in the returned array
@@ -3470,11 +3471,11 @@ public class Arrays {
* truncated or padded with nulls to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @throws ArrayStoreException if an element copied from
- * original is not of a runtime type that can be stored in
- * an array of class newType.
+ * {@code original} is not of a runtime type that can be stored in
+ * an array of class {@code newType}.
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@@ -3493,17 +3494,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * (byte)0 is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code (byte)0} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3513,8 +3514,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static byte[] copyOfRange(byte[] original, int from, int to) {
@@ -3529,17 +3530,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * (short)0 is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code (short)0} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3549,8 +3550,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static short[] copyOfRange(short[] original, int from, int to) {
@@ -3565,17 +3566,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * 0 is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code 0} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3585,8 +3586,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static int[] copyOfRange(int[] original, int from, int to) {
@@ -3601,17 +3602,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * 0L is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code 0L} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3621,8 +3622,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static long[] copyOfRange(long[] original, int from, int to) {
@@ -3637,17 +3638,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * '\\u000' is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code '\\u000'} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3657,8 +3658,8 @@ public class Arrays {
* truncated or padded with null characters to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static char[] copyOfRange(char[] original, int from, int to) {
@@ -3673,17 +3674,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * 0f is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code 0f} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3693,8 +3694,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static float[] copyOfRange(float[] original, int from, int to) {
@@ -3709,17 +3710,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * 0d is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code 0d} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3729,8 +3730,8 @@ public class Arrays {
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static double[] copyOfRange(double[] original, int from, int to) {
@@ -3745,17 +3746,17 @@ public class Arrays {
/**
* Copies the specified range of the specified array into a new array.
- * The initial index of the range (from) must lie between zero
- * and original.length, inclusive. The value at
- * original[from] is placed into the initial element of the copy
- * (unless from == original.length or from == to).
+ * The initial index of the range ({@code from}) must lie between zero
+ * and {@code original.length}, inclusive. The value at
+ * {@code original[from]} is placed into the initial element of the copy
+ * (unless {@code from == original.length} or {@code from == to}).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
- * (to), which must be greater than or equal to from,
- * may be greater than original.length, in which case
- * false is placed in all elements of the copy whose index is
- * greater than or equal to original.length - from. The length
- * of the returned array will be to - from.
+ * ({@code to}), which must be greater than or equal to {@code from},
+ * may be greater than {@code original.length}, in which case
+ * {@code false} is placed in all elements of the copy whose index is
+ * greater than or equal to {@code original.length - from}. The length
+ * of the returned array will be {@code to - from}.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
@@ -3765,8 +3766,8 @@ public class Arrays {
* truncated or padded with false elements to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
- * @throws IllegalArgumentException if from > to
- * @throws NullPointerException if original is null
+ * @throws IllegalArgumentException if {@code from > to}
+ * @throws NullPointerException if {@code original} is null
* @since 1.6
*/
public static boolean[] copyOfRange(boolean[] original, int from, int to) {
@@ -3902,18 +3903,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two long arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code long} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
* The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Long}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(long a[]) {
@@ -3931,18 +3932,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two non-null int arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two non-null {@code int} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Integer}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(int a[]) {
@@ -3958,18 +3959,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two short arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code short} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Short}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(short a[]) {
@@ -3985,18 +3986,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two char arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code char} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Character}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(char a[]) {
@@ -4012,18 +4013,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two byte arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code byte} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Byte}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(byte a[]) {
@@ -4039,18 +4040,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two boolean arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code boolean} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Boolean}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(boolean a[]) {
@@ -4066,18 +4067,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two float arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code float} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Float}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(float a[]) {
@@ -4093,18 +4094,18 @@ public class Arrays {
/**
* Returns a hash code based on the contents of the specified array.
- * For any two double arrays a and b
- * such that Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ * For any two {@code double} arrays {@code a} and {@code b}
+ * such that {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is the same value that would be
- * obtained by invoking the {@link List#hashCode() hashCode}
+ * obtained by invoking the {@link List#hashCode() hashCode}
* method on a {@link List} containing a sequence of {@link Double}
- * instances representing the elements of a in the same order.
- * If a is null, this method returns 0.
+ * instances representing the elements of {@code a} in the same order.
+ * If {@code a} is {@code null}, this method returns 0.
*
* @param a the array whose hash value to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @since 1.5
*/
public static int hashCode(double a[]) {
@@ -4127,16 +4128,16 @@ public class Arrays {
* element, either directly or indirectly through one or more levels of
* arrays.
*
- *
For any two arrays a and b such that
- * Arrays.equals(a, b), it is also the case that
- * Arrays.hashCode(a) == Arrays.hashCode(b).
+ *
For any two arrays {@code a} and {@code b} such that
+ * {@code Arrays.equals(a, b)}, it is also the case that
+ * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
*
*
The value returned by this method is equal to the value that would
- * be returned by Arrays.asList(a).hashCode(), unless a
- * is null, in which case 0 is returned.
+ * be returned by {@code Arrays.asList(a).hashCode()}, unless {@code a}
+ * is {@code null}, in which case {@code 0} is returned.
*
* @param a the array whose content-based hash code to compute
- * @return a content-based hash code for a
+ * @return a content-based hash code for {@code a}
* @see #deepHashCode(Object[])
* @since 1.5
*/
@@ -4161,23 +4162,23 @@ public class Arrays {
* one or more levels of arrays. The behavior of such an invocation is
* undefined.
*
- *
For any two arrays a and b such that
- * Arrays.deepEquals(a, b), it is also the case that
- * Arrays.deepHashCode(a) == Arrays.deepHashCode(b).
+ *
For any two arrays {@code a} and {@code b} such that
+ * {@code Arrays.deepEquals(a, b)}, it is also the case that
+ * {@code Arrays.deepHashCode(a) == Arrays.deepHashCode(b)}.
*
*
The computation of the value returned by this method is similar to
* that of the value returned by {@link List#hashCode()} on a list
- * containing the same elements as a in the same order, with one
- * difference: If an element e of a is itself an array,
- * its hash code is computed not by calling e.hashCode(), but as
- * by calling the appropriate overloading of Arrays.hashCode(e)
- * if e is an array of a primitive type, or as by calling
- * Arrays.deepHashCode(e) recursively if e is an array
- * of a reference type. If a is null, this method
+ * containing the same elements as {@code a} in the same order, with one
+ * difference: If an element {@code e} of {@code a} is itself an array,
+ * its hash code is computed not by calling {@code e.hashCode()}, but as
+ * by calling the appropriate overloading of {@code Arrays.hashCode(e)}
+ * if {@code e} is an array of a primitive type, or as by calling
+ * {@code Arrays.deepHashCode(e)} recursively if {@code e} is an array
+ * of a reference type. If {@code a} is {@code null}, this method
* returns 0.
*
* @param a the array whose deep-content-based hash code to compute
- * @return a deep-content-based hash code for a
+ * @return a deep-content-based hash code for {@code a}
* @see #hashCode(Object[])
* @since 1.5
*/
@@ -4217,28 +4218,28 @@ public class Arrays {
}
/**
- * Returns true if the two specified arrays are deeply
+ * Returns {@code true} if the two specified arrays are deeply
* equal to one another. Unlike the {@link #equals(Object[],Object[])}
* method, this method is appropriate for use with nested arrays of
* arbitrary depth.
*
*
Two array references are considered deeply equal if both
- * are null, or if they refer to arrays that contain the same
+ * are {@code null}, or if they refer to arrays that contain the same
* number of elements and all corresponding pairs of elements in the two
* arrays are deeply equal.
*
- *
Two possibly null elements e1 and e2 are
+ *
Two possibly {@code null} elements {@code e1} and {@code e2} are
* deeply equal if any of the following conditions hold:
*
- * - e1 and e2 are both arrays of object reference
- * types, and Arrays.deepEquals(e1, e2) would return true
- *
- e1 and e2 are arrays of the same primitive
+ *
- {@code e1} and {@code e2} are both arrays of object reference
+ * types, and {@code Arrays.deepEquals(e1, e2) would return true}
+ *
- {@code e1} and {@code e2} are arrays of the same primitive
* type, and the appropriate overloading of
- * Arrays.equals(e1, e2) would return true.
- *
- e1 == e2
- *
- e1.equals(e2) would return true.
+ * {@code Arrays.equals(e1, e2)} would return true.
+ *
- {@code e1 == e2}
+ *
- {@code e1.equals(e2)} would return true.
*
- * Note that this definition permits null elements at any depth.
+ * Note that this definition permits {@code null} elements at any depth.
*
* If either of the specified arrays contain themselves as elements
* either directly or indirectly through one or more levels of arrays,
@@ -4246,7 +4247,7 @@ public class Arrays {
*
* @param a1 one array to be tested for equality
* @param a2 the other array to be tested for equality
- * @return true if the two arrays are equal
+ * @return {@code true} if the two arrays are equal
* @see #equals(Object[],Object[])
* @see Objects#deepEquals(Object, Object)
* @since 1.5
@@ -4307,14 +4308,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(long). Returns "null" if a
- * is null.
+ * {@code String.valueOf(long)}. Returns {@code "null"} if {@code a}
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(long[] a) {
@@ -4337,14 +4338,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(int). Returns "null" if a is
- * null.
+ * {@code String.valueOf(int)}. Returns {@code "null"} if {@code a} is
+ * {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(int[] a) {
@@ -4367,14 +4368,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(short). Returns "null" if a
- * is null.
+ * {@code String.valueOf(short)}. Returns {@code "null"} if {@code a}
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(short[] a) {
@@ -4397,14 +4398,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(char). Returns "null" if a
- * is null.
+ * {@code String.valueOf(char)}. Returns {@code "null"} if {@code a}
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(char[] a) {
@@ -4427,14 +4428,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements
- * are separated by the characters ", " (a comma followed
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements
+ * are separated by the characters {@code ", "} (a comma followed
* by a space). Elements are converted to strings as by
- * String.valueOf(byte). Returns "null" if
- * a is null.
+ * {@code String.valueOf(byte)}. Returns {@code "null"} if
+ * {@code a} is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(byte[] a) {
@@ -4457,14 +4458,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(boolean). Returns "null" if
- * a is null.
+ * {@code String.valueOf(boolean)}. Returns {@code "null"} if
+ * {@code a} is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(boolean[] a) {
@@ -4487,14 +4488,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(float). Returns "null" if a
- * is null.
+ * {@code String.valueOf(float)}. Returns {@code "null"} if {@code a}
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(float[] a) {
@@ -4518,14 +4519,14 @@ public class Arrays {
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
- * enclosed in square brackets ("[]"). Adjacent elements are
- * separated by the characters ", " (a comma followed by a
+ * enclosed in square brackets ({@code "[]"}). Adjacent elements are
+ * separated by the characters {@code ", "} (a comma followed by a
* space). Elements are converted to strings as by
- * String.valueOf(double). Returns "null" if a
- * is null.
+ * {@code String.valueOf(double)}. Returns {@code "null"} if {@code a}
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @since 1.5
*/
public static String toString(double[] a) {
@@ -4549,15 +4550,15 @@ public class Arrays {
* Returns a string representation of the contents of the specified array.
* If the array contains other arrays as elements, they are converted to
* strings by the {@link Object#toString} method inherited from
- * Object, which describes their identities rather than
+ * {@code Object}, which describes their identities rather than
* their contents.
*
*
The value returned by this method is equal to the value that would
- * be returned by Arrays.asList(a).toString(), unless a
- * is null, in which case "null" is returned.
+ * be returned by {@code Arrays.asList(a).toString()}, unless {@code a}
+ * is {@code null}, in which case {@code "null"} is returned.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @see #deepToString(Object[])
* @since 1.5
*/
@@ -4586,29 +4587,29 @@ public class Arrays {
* designed for converting multidimensional arrays to strings.
*
*
The string representation consists of a list of the array's
- * elements, enclosed in square brackets ("[]"). Adjacent
- * elements are separated by the characters ", " (a comma
+ * elements, enclosed in square brackets ({@code "[]"}). Adjacent
+ * elements are separated by the characters {@code ", "} (a comma
* followed by a space). Elements are converted to strings as by
- * String.valueOf(Object), unless they are themselves
+ * {@code String.valueOf(Object)}, unless they are themselves
* arrays.
*
- *
If an element e is an array of a primitive type, it is
+ *
If an element {@code e} is an array of a primitive type, it is
* converted to a string as by invoking the appropriate overloading of
- * Arrays.toString(e). If an element e is an array of a
+ * {@code Arrays.toString(e)}. If an element {@code e} is an array of a
* reference type, it is converted to a string as by invoking
* this method recursively.
*
*
To avoid infinite recursion, if the specified array contains itself
* as an element, or contains an indirect reference to itself through one
* or more levels of arrays, the self-reference is converted to the string
- * "[...]". For example, an array containing only a reference
- * to itself would be rendered as "[[...]]".
+ * {@code "[...]"}. For example, an array containing only a reference
+ * to itself would be rendered as {@code "[[...]]"}.
*
- *
This method returns "null" if the specified array
- * is null.
+ *
This method returns {@code "null"} if the specified array
+ * is {@code null}.
*
* @param a the array whose string representation to return
- * @return a string representation of a
+ * @return a string representation of {@code a}
* @see #toString(Object[])
* @since 1.5
*/
diff --git a/jdk/src/java.base/share/classes/java/util/Collection.java b/jdk/src/java.base/share/classes/java/util/Collection.java
index 3a01908d73ed8651d17e70cbadb7198bd4878148..f92b9f6153f4d347bc366f9a0da52947429f9a99 100644
--- a/jdk/src/java.base/share/classes/java/util/Collection.java
+++ b/jdk/src/java.base/share/classes/java/util/Collection.java
@@ -35,30 +35,30 @@ import java.util.stream.StreamSupport;
* collections allow duplicate elements and others do not. Some are ordered
* and others unordered. The JDK does not provide any direct
* implementations of this interface: it provides implementations of more
- * specific subinterfaces like Set and List. This interface
+ * specific subinterfaces like {@code Set} and {@code List}. This interface
* is typically used to pass collections around and manipulate them where
* maximum generality is desired.
*
*
Bags or multisets (unordered collections that may contain
* duplicate elements) should implement this interface directly.
*
- *
All general-purpose Collection implementation classes (which
- * typically implement Collection indirectly through one of its
+ *
All general-purpose {@code Collection} implementation classes (which
+ * typically implement {@code Collection} indirectly through one of its
* subinterfaces) should provide two "standard" constructors: a void (no
* arguments) constructor, which creates an empty collection, and a
- * constructor with a single argument of type Collection, which
+ * constructor with a single argument of type {@code Collection}, which
* creates a new collection with the same elements as its argument. In
* effect, the latter constructor allows the user to copy any collection,
* producing an equivalent collection of the desired implementation type.
* There is no way to enforce this convention (as interfaces cannot contain
- * constructors) but all of the general-purpose Collection
+ * constructors) but all of the general-purpose {@code Collection}
* implementations in the Java platform libraries comply.
*
*
The "destructive" methods contained in this interface, that is, the
* methods that modify the collection on which they operate, are specified to
- * throw UnsupportedOperationException if this collection does not
+ * throw {@code UnsupportedOperationException} if this collection does not
* support the operation. If this is the case, these methods may, but are not
- * required to, throw an UnsupportedOperationException if the
+ * required to, throw an {@code UnsupportedOperationException} if the
* invocation would have no effect on the collection. For example, invoking
* the {@link #addAll(Collection)} method on an unmodifiable collection may,
* but is not required to, throw the exception if the collection to be added
@@ -69,7 +69,7 @@ import java.util.stream.StreamSupport;
* they may contain.