--- old/src/java.base/share/classes/java/util/Set.java 2015-08-07 21:15:19.790583988 +0400 +++ new/src/java.base/share/classes/java/util/Set.java 2015-08-07 21:15:19.586583997 +0400 @@ -27,16 +27,16 @@ /** * A collection that contains no duplicate elements. More formally, sets - * contain no pair of elements e1 and e2 such that - * e1.equals(e2), and at most one null element. As implied by + * contain no pair of elements {@code e1} and {@code e2} such that + * {@code e1.equals(e2)}, and at most one null element. As implied by * its name, this interface models the mathematical set abstraction. * - *

The Set interface places additional stipulations, beyond those - * inherited from the Collection interface, on the contracts of all - * constructors and on the contracts of the add, equals and - * hashCode methods. Declarations for other inherited methods are + *

The {@code Set} interface places additional stipulations, beyond those + * inherited from the {@code Collection} interface, on the contracts of all + * constructors and on the contracts of the {@code add}, {@code equals} and + * {@code hashCode} methods. Declarations for other inherited methods are * also included here for convenience. (The specifications accompanying these - * declarations have been tailored to the Set interface, but they do + * declarations have been tailored to the {@code Set} interface, but they do * not contain any additional stipulations.) * *

The additional stipulation on constructors is, not surprisingly, @@ -45,7 +45,7 @@ * *

Note: Great care must be exercised if mutable objects are used as set * elements. The behavior of a set is not specified if the value of an object - * is changed in a manner that affects equals comparisons while the + * is changed in a manner that affects {@code equals} comparisons while the * object is an element in the set. A special case of this prohibition is * that it is not permissible for a set to contain itself as an element. * @@ -53,7 +53,7 @@ * they may contain. For example, some implementations prohibit null elements, * and some have restrictions on the types of their elements. Attempting to * add an ineligible element throws an unchecked exception, typically - * NullPointerException or ClassCastException. Attempting + * {@code NullPointerException} or {@code ClassCastException}. Attempting * to query the presence of an ineligible element may throw an exception, * or it may simply return false; some implementations will exhibit the former * behavior and some will exhibit the latter. More generally, attempting an @@ -87,28 +87,28 @@ /** * Returns the number of elements in this set (its cardinality). If this - * set contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. + * set contains more than {@code Integer.MAX_VALUE} elements, returns + * {@code Integer.MAX_VALUE}. * * @return the number of elements in this set (its cardinality) */ int size(); /** - * Returns true if this set contains no elements. + * Returns {@code true} if this set contains no elements. * - * @return true if this set contains no elements + * @return {@code true} if this set contains no elements */ boolean isEmpty(); /** - * Returns true if this set contains the specified element. - * More formally, returns true if and only if this set - * contains an element e such that - * (o==null ? e==null : o.equals(e)). + * Returns {@code true} if this set contains the specified element. + * More formally, returns {@code true} if and only if this set + * contains an element {@code e} such that + * (o==null ? e==null : o.equals(e)). * * @param o element whose presence in this set is to be tested - * @return true if this set contains the specified element + * @return {@code true} if this set contains the specified element * @throws ClassCastException if the type of the specified element * is incompatible with this set * (optional) @@ -155,7 +155,7 @@ *

If this set fits in the specified array with room to spare * (i.e., the array has more elements than this set), the element in * the array immediately following the end of the set is set to - * null. (This is useful in determining the length of this + * {@code null}. (This is useful in determining the length of this * set only if the caller knows that this set does not contain * any null elements.) * @@ -168,15 +168,15 @@ * precise control over the runtime type of the output array, and may, * under certain circumstances, be used to save allocation costs. * - *

Suppose x is a set known to contain only strings. + *

Suppose {@code x} is a set known to contain only strings. * The following code can be used to dump the set into a newly allocated - * array of String: + * array of {@code String}: * *

      *     String[] y = x.toArray(new String[0]);
* - * Note that toArray(new Object[0]) is identical in function to - * toArray(). + * Note that {@code toArray(new Object[0])} is identical in function to + * {@code toArray()}. * * @param a the array into which the elements of this set are to be * stored, if it is big enough; otherwise, a new array of the same @@ -195,25 +195,25 @@ /** * Adds the specified element to this set if it is not already present * (optional operation). More formally, adds the specified element - * e to this set if the set contains no element e2 + * {@code e} to this set if the set contains no element {@code e2} * such that - * (e==null ? e2==null : e.equals(e2)). + * (e==null ? e2==null : e.equals(e2)). * If this set already contains the element, the call leaves the set - * unchanged and returns false. In combination with the + * unchanged and returns {@code false}. In combination with the * restriction on constructors, this ensures that sets never contain * duplicate elements. * *

The stipulation above does not imply that sets must accept all * elements; sets may refuse to add any particular element, including - * null, and throw an exception, as described in the + * {@code null}, and throw an exception, as described in the * specification for {@link Collection#add Collection.add}. * Individual set implementations should clearly document any * restrictions on the elements that they may contain. * * @param e element to be added to this set - * @return true if this set did not already contain the specified + * @return {@code true} if this set did not already contain the specified * element - * @throws UnsupportedOperationException if the add operation + * @throws UnsupportedOperationException if the {@code add} operation * is not supported by this set * @throws ClassCastException if the class of the specified element * prevents it from being added to this set @@ -227,23 +227,23 @@ /** * Removes the specified element from this set if it is present - * (optional operation). More formally, removes an element e + * (optional operation). More formally, removes an element {@code e} * such that - * (o==null ? e==null : o.equals(e)), if - * this set contains such an element. Returns true if this set + * (o==null ? e==null : o.equals(e)), if + * this set contains such an element. Returns {@code true} if this set * contained the element (or equivalently, if this set changed as a * result of the call). (This set will not contain the element once the * call returns.) * * @param o object to be removed from this set, if present - * @return true if this set contained the specified element + * @return {@code true} if this set contained the specified element * @throws ClassCastException if the type of the specified element * is incompatible with this set * (optional) * @throws NullPointerException if the specified element is null and this * set does not permit null elements * (optional) - * @throws UnsupportedOperationException if the remove operation + * @throws UnsupportedOperationException if the {@code remove} operation * is not supported by this set */ boolean remove(Object o); @@ -252,12 +252,12 @@ // Bulk Operations /** - * Returns true if this set contains all of the elements of the + * Returns {@code true} if this set contains all of the elements of the * specified collection. If the specified collection is also a set, this - * method returns true if it is a subset of this set. + * method returns {@code true} if it is a subset of this set. * * @param c collection to be checked for containment in this set - * @return true if this set contains all of the elements of the + * @return {@code true} if this set contains all of the elements of the * specified collection * @throws ClassCastException if the types of one or more elements * in the specified collection are incompatible with this @@ -275,15 +275,15 @@ /** * Adds all of the elements in the specified collection to this set if * they're not already present (optional operation). If the specified - * collection is also a set, the addAll operation effectively + * collection is also a set, the {@code addAll} operation effectively * modifies this set so that its value is the union of the two * sets. The behavior of this operation is undefined if the specified * collection is modified while the operation is in progress. * * @param c collection containing elements to be added to this set - * @return true if this set changed as a result of the call + * @return {@code true} if this set changed as a result of the call * - * @throws UnsupportedOperationException if the addAll operation + * @throws UnsupportedOperationException if the {@code addAll} operation * is not supported by this set * @throws ClassCastException if the class of an element of the * specified collection prevents it from being added to this set @@ -305,8 +305,8 @@ * intersection of the two sets. * * @param c collection containing elements to be retained in this set - * @return true if this set changed as a result of the call - * @throws UnsupportedOperationException if the retainAll operation + * @return {@code true} if this set changed as a result of the call + * @throws UnsupportedOperationException if the {@code retainAll} operation * is not supported by this set * @throws ClassCastException if the class of an element of this set * is incompatible with the specified collection @@ -327,8 +327,8 @@ * the two sets. * * @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 @@ -346,7 +346,7 @@ * Removes all of the elements from this set (optional operation). * The set will be empty after this call returns. * - * @throws UnsupportedOperationException if the clear method + * @throws UnsupportedOperationException if the {@code clear} method * is not supported by this set */ void clear(); @@ -356,7 +356,7 @@ /** * Compares the specified object with this set for equality. Returns - * true if the specified object is also a set, the two sets + * {@code true} if the specified object is also a set, the two sets * have the same size, and every member of the specified set is * contained in this set (or equivalently, every member of this set is * contained in the specified set). This definition ensures that the @@ -364,17 +364,17 @@ * set interface. * * @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 */ boolean equals(Object o); /** * 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}. * * @return the hash code value for this set