ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/Collections.java
(Generate patch)

Comparing jsr166/src/main/java/util/Collections.java (file contents):
Revision 1.5 by jsr166, Mon May 2 08:35:49 2005 UTC vs.
Revision 1.6 by jsr166, Mon May 16 06:17:40 2005 UTC

# Line 569 | Line 569 | public class Collections {
569          Iterator<? extends T> i = coll.iterator();
570          T candidate = i.next();
571  
572 <        while(i.hasNext()) {
572 >        while (i.hasNext()) {
573              T next = i.next();
574              if (next.compareTo(candidate) < 0)
575                  candidate = next;
# Line 606 | Line 606 | public class Collections {
606          Iterator<? extends T> i = coll.iterator();
607          T candidate = i.next();
608  
609 <        while(i.hasNext()) {
609 >        while (i.hasNext()) {
610              T next = i.next();
611              if (comp.compare(next, candidate) < 0)
612                  candidate = next;
# Line 639 | Line 639 | public class Collections {
639          Iterator<? extends T> i = coll.iterator();
640          T candidate = i.next();
641  
642 <        while(i.hasNext()) {
642 >        while (i.hasNext()) {
643              T next = i.next();
644              if (next.compareTo(candidate) > 0)
645                  candidate = next;
# Line 676 | Line 676 | public class Collections {
676          Iterator<? extends T> i = coll.iterator();
677          T candidate = i.next();
678  
679 <        while(i.hasNext()) {
679 >        while (i.hasNext()) {
680              T next = i.next();
681              if (comp.compare(next, candidate) > 0)
682                  candidate = next;
# Line 1051 | Line 1051 | public class Collections {
1051       * @param  s the set for which an unmodifiable view is to be returned.
1052       * @return an unmodifiable view of the specified set.
1053       */
1054
1054      public static <T> Set<T> unmodifiableSet(Set<? extends T> s) {
1055          return new UnmodifiableSet<T>(s);
1056      }
# Line 2246 | Line 2245 | public class Collections {
2245               * Dump coll into an array of the required type.  This serves
2246               * three purposes: it insulates us from concurrent changes in
2247               * the contents of coll, it type-checks all of the elements in
2248 <             * coll, and it provides all-or-nothing semantics(which we
2248 >             * coll, and it provides all-or-nothing semantics (which we
2249               * wouldn't get if we type-checked each element as we added it).
2250               */
2251              E[] a = null;
2252              try {
2253                  a = coll.toArray(zeroLengthElementArray());
2254 <            } catch(ArrayStoreException e) {
2254 >            } catch (ArrayStoreException e) {
2255                  throw new ClassCastException();
2256              }
2257  
# Line 2436 | Line 2435 | public class Collections {
2435              E[] a = null;
2436              try {
2437                  a = c.toArray(zeroLengthElementArray());
2438 <            } catch(ArrayStoreException e) {
2438 >            } catch (ArrayStoreException e) {
2439                  throw new ClassCastException();
2440              }
2441  
# Line 2582 | Line 2581 | public class Collections {
2581              K[] keys = null;
2582              try {
2583                  keys = t.keySet().toArray(zeroLengthKeyArray());
2584 <            } catch(ArrayStoreException e) {
2584 >            } catch (ArrayStoreException e) {
2585                  throw new ClassCastException();
2586              }
2587              V[] values = null;
2588              try {
2589                  values = t.values().toArray(zeroLengthValueArray());
2590 <            } catch(ArrayStoreException e) {
2590 >            } catch (ArrayStoreException e) {
2591                  throw new ClassCastException();
2592              }
2593  
# Line 3462 | Line 3461 | public class Collections {
3461       * @throws UnsupportedOperationException if <tt>c</tt> does not support
3462       *         the <tt>add</tt> operation.
3463       * @throws NullPointerException if <tt>elements</tt> contains one or more
3464 <     *         null values and <tt>c</tt> does not support null elements, or
3464 >     *         null values and <tt>c</tt> does not permit null elements, or
3465       *         if <tt>c</tt> or <tt>elements</tt> are <tt>null</tt>
3466 <     * @throws IllegalArgumentException if some aspect of a value in
3466 >     * @throws IllegalArgumentException if some property of a value in
3467       *         <tt>elements</tt> prevents it from being added to <tt>c</tt>
3468       * @see Collection#addAll(Collection)
3469       * @since 1.5

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines