harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r598628 [6/6] - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/
Date Tue, 27 Nov 2007 13:03:23 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeSet.java?rev=598628&r1=598627&r2=598628&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeSet.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeSet.java Tue
Nov 27 05:03:19 2007
@@ -17,7 +17,6 @@
 
 package java.util;
 
-
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -28,135 +27,137 @@
  * supported, adding and removing. The elements can be any objects which are
  * comparable to each other either using their natural order or a specified
  * Comparator.
+ * 
  * @since 1.2
  */
-public class TreeSet<E> extends AbstractSet<E> implements SortedSet<E>,
Cloneable,
-		Serializable {
-	
+public class TreeSet<E> extends AbstractSet<E> implements SortedSet<E>,
+        Cloneable, Serializable {
+
     private static final long serialVersionUID = -2479143000061671589L;
 
     private transient SortedMap<E, E> backingMap;
 
-    private TreeSet(SortedMap<E,E> map) {
+    private TreeSet(SortedMap<E, E> map) {
         this.backingMap = map;
     }
 
-	/**
-	 * Constructs a new empty instance of TreeSet which uses natural ordering.
-	 * 
-	 */
-	public TreeSet() {
-		backingMap = new TreeMap<E, E>();
-	}
-
-	/**
-	 * Constructs a new instance of TreeSet which uses natural ordering and
-	 * containing the unique elements in the specified collection.
-	 * 
-	 * @param collection
-	 *            the collection of elements to add
-	 * 
-	 * @exception ClassCastException
-	 *                when an element in the Collection does not implement the
-	 *                Comparable interface, or the elements in the Collection
-	 *                cannot be compared
-	 */
-	public TreeSet(Collection<? extends E> collection) {
-		this();
-		addAll(collection);
-	}
-
-	/**
-	 * Constructs a new empty instance of TreeSet which uses the specified
-	 * Comparator.
-	 * 
-	 * @param comparator
-	 *            the Comparator
-	 */
-	public TreeSet(Comparator<? super E> comparator) {
-		backingMap = new TreeMap<E, E>(comparator);
-	}
-
-	/**
-	 * Constructs a new instance of TreeSet containing the elements in the
-	 * specified SortedSet and using the same Comparator.
-	 * 
-	 * @param set
-	 *            the SortedSet of elements to add
-	 */
-	public TreeSet(SortedSet<E> set) {
-	    this(set.comparator());
-	    Iterator<E> it = set.iterator();
-	    while (it.hasNext()) {
-	        add(it.next());
-	    }
-	}
-
-	/**
-	 * Adds the specified object to this TreeSet.
-	 * 
-	 * @param object
-	 *            the object to add
-	 * @return true when this TreeSet did not already contain the object, false
-	 *         otherwise
-	 * 
-	 * @exception ClassCastException
-	 *                when the object cannot be compared with the elements in
-	 *                this TreeSet
-	 * @exception NullPointerException
-	 *                when the object is null and the comparator cannot handle
-	 *                null
-	 */
-	@Override
+    /**
+     * Constructs a new empty instance of TreeSet which uses natural ordering.
+     * 
+     */
+    public TreeSet() {
+        backingMap = new TreeMap<E, E>();
+    }
+
+    /**
+     * Constructs a new instance of TreeSet which uses natural ordering and
+     * containing the unique elements in the specified collection.
+     * 
+     * @param collection
+     *            the collection of elements to add
+     * 
+     * @exception ClassCastException
+     *                when an element in the Collection does not implement the
+     *                Comparable interface, or the elements in the Collection
+     *                cannot be compared
+     */
+    public TreeSet(Collection<? extends E> collection) {
+        this();
+        addAll(collection);
+    }
+
+    /**
+     * Constructs a new empty instance of TreeSet which uses the specified
+     * Comparator.
+     * 
+     * @param comparator
+     *            the Comparator
+     */
+    public TreeSet(Comparator<? super E> comparator) {
+        backingMap = new TreeMap<E, E>(comparator);
+    }
+
+    /**
+     * Constructs a new instance of TreeSet containing the elements in the
+     * specified SortedSet and using the same Comparator.
+     * 
+     * @param set
+     *            the SortedSet of elements to add
+     */
+    public TreeSet(SortedSet<E> set) {
+        this(set.comparator());
+        Iterator<E> it = set.iterator();
+        while (it.hasNext()) {
+            add(it.next());
+        }
+    }
+
+    /**
+     * Adds the specified object to this TreeSet.
+     * 
+     * @param object
+     *            the object to add
+     * @return true when this TreeSet did not already contain the object, false
+     *         otherwise
+     * 
+     * @exception ClassCastException
+     *                when the object cannot be compared with the elements in
+     *                this TreeSet
+     * @exception NullPointerException
+     *                when the object is null and the comparator cannot handle
+     *                null
+     */
+    @Override
     public boolean add(E object) {
-		return backingMap.put(object, object) == null;
-	}
+        return backingMap.put(object, object) == null;
+    }
 
-	/**
-	 * Adds the objects in the specified Collection to this TreeSet.
-	 * 
-	 * @param collection
-	 *            the Collection of objects
-	 * @return true if this TreeSet is modified, false otherwise
-	 * 
-	 * @exception ClassCastException
-	 *                when an object in the Collection cannot be compared with
-	 *                the elements in this TreeSet
-	 * @exception NullPointerException
-	 *                when an object in the Collection is null and the
-	 *                comparator cannot handle null
-	 */
-	@Override
+    /**
+     * Adds the objects in the specified Collection to this TreeSet.
+     * 
+     * @param collection
+     *            the Collection of objects
+     * @return true if this TreeSet is modified, false otherwise
+     * 
+     * @exception ClassCastException
+     *                when an object in the Collection cannot be compared with
+     *                the elements in this TreeSet
+     * @exception NullPointerException
+     *                when an object in the Collection is null and the
+     *                comparator cannot handle null
+     */
+    @Override
     public boolean addAll(Collection<? extends E> collection) {
-		return super.addAll(collection);
-	}
+        return super.addAll(collection);
+    }
 
-	/**
-	 * Removes all elements from this TreeSet, leaving it empty.
-	 * 
-	 * @see #isEmpty
-	 * @see #size
-	 */
-	@Override
+    /**
+     * Removes all elements from this TreeSet, leaving it empty.
+     * 
+     * @see #isEmpty
+     * @see #size
+     */
+    @Override
     public void clear() {
-		backingMap.clear();
-	}
+        backingMap.clear();
+    }
 
-	/**
-	 * Answers a new TreeSet with the same elements, size and comparator as this
-	 * TreeSet.
-	 * 
-	 * @return a shallow copy of this TreeSet
-	 * 
-	 * @see java.lang.Cloneable
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * Answers a new TreeSet with the same elements, size and comparator as this
+     * TreeSet.
+     * 
+     * @return a shallow copy of this TreeSet
+     * 
+     * @see java.lang.Cloneable
+     */
+    @SuppressWarnings("unchecked")
     @Override
     public Object clone() {
         try {
             TreeSet<E> clone = (TreeSet<E>) super.clone();
             if (backingMap instanceof TreeMap) {
-                clone.backingMap = (SortedMap<E, E>) ((TreeMap<E, E>) backingMap).clone();
+                clone.backingMap = (SortedMap<E, E>) ((TreeMap<E, E>) backingMap)
+                        .clone();
             } else {
                 clone.backingMap = new TreeMap<E, E>(backingMap);
             }
@@ -166,161 +167,161 @@
         }
     }
 
-	/**
+    /**
      * Answers the Comparator used to compare elements in this TreeSet.
      * 
      * @return a Comparator or null if the natural ordering is used
      */
-	public Comparator<? super E> comparator() {
-		return backingMap.comparator();
-	}
-
-	/**
-	 * Searches this TreeSet for the specified object.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return true if <code>object</code> is an element of this TreeSet,
-	 *         false otherwise
-	 * 
-	 * @exception ClassCastException
-	 *                when the object cannot be compared with the elements in
-	 *                this TreeSet
-	 * @exception NullPointerException
-	 *                when the object is null and the comparator cannot handle
-	 *                null
-	 */
-	@Override
+    public Comparator<? super E> comparator() {
+        return backingMap.comparator();
+    }
+
+    /**
+     * Searches this TreeSet for the specified object.
+     * 
+     * @param object
+     *            the object to search for
+     * @return true if <code>object</code> is an element of this TreeSet,
+     *         false otherwise
+     * 
+     * @exception ClassCastException
+     *                when the object cannot be compared with the elements in
+     *                this TreeSet
+     * @exception NullPointerException
+     *                when the object is null and the comparator cannot handle
+     *                null
+     */
+    @Override
     public boolean contains(Object object) {
-		return backingMap.containsKey(object);
-	}
+        return backingMap.containsKey(object);
+    }
+
+    /**
+     * Answers the first element in this TreeSet.
+     * 
+     * @return the first element
+     * 
+     * @exception NoSuchElementException
+     *                when this TreeSet is empty
+     */
+    public E first() {
+        return backingMap.firstKey();
+    }
 
-	/**
-	 * Answers the first element in this TreeSet.
-	 * 
-	 * @return the first element
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this TreeSet is empty
-	 */
-	public E first() {
-		return backingMap.firstKey();
-	}
-
-	/**
-	 * Answers a SortedSet of the specified portion of this TreeSet which
-	 * contains elements less than the end element. The returned SortedSet is
-	 * backed by this TreeSet so changes to one are reflected by the other.
-	 * 
-	 * @param end
-	 *            the end element
-	 * @return a subset where the elements are less than <code>end</code>
-	 * 
-	 * @exception ClassCastException
-	 *                when the end object cannot be compared with the elements
-	 *                in this TreeSet
-	 * @exception NullPointerException
-	 *                when the end object is null and the comparator cannot
-	 *                handle null
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * Answers a SortedSet of the specified portion of this TreeSet which
+     * contains elements less than the end element. The returned SortedSet is
+     * backed by this TreeSet so changes to one are reflected by the other.
+     * 
+     * @param end
+     *            the end element
+     * @return a subset where the elements are less than <code>end</code>
+     * 
+     * @exception ClassCastException
+     *                when the end object cannot be compared with the elements
+     *                in this TreeSet
+     * @exception NullPointerException
+     *                when the end object is null and the comparator cannot
+     *                handle null
+     */
+    @SuppressWarnings("unchecked")
     public SortedSet<E> headSet(E end) {
-	    // Check for errors
-	    Comparator<? super E> c = backingMap.comparator();
-	    if (c == null) {
-	        ((Comparable<E>) end).compareTo(end);
-	    } else {
-	        c.compare(end, end);
-	    }
-	    return new TreeSet<E>(backingMap.headMap(end));
-	}
-
-	/**
-	 * Answers if this TreeSet has no elements, a size of zero.
-	 * 
-	 * @return true if this TreeSet has no elements, false otherwise
-	 * 
-	 * @see #size
-	 */
-	@Override
+        // Check for errors
+        Comparator<? super E> c = backingMap.comparator();
+        if (c == null) {
+            ((Comparable<E>) end).compareTo(end);
+        } else {
+            c.compare(end, end);
+        }
+        return new TreeSet<E>(backingMap.headMap(end));
+    }
+
+    /**
+     * Answers if this TreeSet has no elements, a size of zero.
+     * 
+     * @return true if this TreeSet has no elements, false otherwise
+     * 
+     * @see #size
+     */
+    @Override
     public boolean isEmpty() {
-		return backingMap.isEmpty();
-	}
+        return backingMap.isEmpty();
+    }
 
-	/**
-	 * Answers an Iterator on the elements of this TreeSet.
-	 * 
-	 * @return an Iterator on the elements of this TreeSet
-	 * 
-	 * @see Iterator
-	 */
-	@Override
+    /**
+     * Answers an Iterator on the elements of this TreeSet.
+     * 
+     * @return an Iterator on the elements of this TreeSet
+     * 
+     * @see Iterator
+     */
+    @Override
     public Iterator<E> iterator() {
-		return backingMap.keySet().iterator();
-	}
+        return backingMap.keySet().iterator();
+    }
 
-	/**
-	 * Answers the last element in this TreeSet.
-	 * 
-	 * @return the last element
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this TreeSet is empty
-	 */
-	public E last() {
-		return backingMap.lastKey();
-	}
-
-	/**
-	 * Removes an occurrence of the specified object from this TreeSet.
-	 * 
-	 * @param object
-	 *            the object to remove
-	 * @return true if this TreeSet is modified, false otherwise
-	 * 
-	 * @exception ClassCastException
-	 *                when the object cannot be compared with the elements in
-	 *                this TreeSet
-	 * @exception NullPointerException
-	 *                when the object is null and the comparator cannot handle
-	 *                null
-	 */
-	@Override
+    /**
+     * Answers the last element in this TreeSet.
+     * 
+     * @return the last element
+     * 
+     * @exception NoSuchElementException
+     *                when this TreeSet is empty
+     */
+    public E last() {
+        return backingMap.lastKey();
+    }
+
+    /**
+     * Removes an occurrence of the specified object from this TreeSet.
+     * 
+     * @param object
+     *            the object to remove
+     * @return true if this TreeSet is modified, false otherwise
+     * 
+     * @exception ClassCastException
+     *                when the object cannot be compared with the elements in
+     *                this TreeSet
+     * @exception NullPointerException
+     *                when the object is null and the comparator cannot handle
+     *                null
+     */
+    @Override
     public boolean remove(Object object) {
-		return backingMap.remove(object) != null;
-	}
+        return backingMap.remove(object) != null;
+    }
 
-	/**
-	 * Answers the number of elements in this TreeSet.
-	 * 
-	 * @return the number of elements in this TreeSet
-	 */
-	@Override
+    /**
+     * Answers the number of elements in this TreeSet.
+     * 
+     * @return the number of elements in this TreeSet
+     */
+    @Override
     public int size() {
-		return backingMap.size();
-	}
+        return backingMap.size();
+    }
 
-	/**
-	 * Answers a SortedSet of the specified portion of this TreeSet which
-	 * contains elements greater or equal to the start element but less than the
-	 * end element. The returned SortedSet is backed by this TreeSet so changes
-	 * to one are reflected by the other.
-	 * 
-	 * @param start
-	 *            the start element
-	 * @param end
-	 *            the end element
-	 * @return a subset where the elements are greater or equal to
-	 *         <code>start</code> and less than <code>end</code>
-	 * 
-	 * @exception ClassCastException
-	 *                when the start or end object cannot be compared with the
-	 *                elements in this TreeSet
-	 * @exception NullPointerException
-	 *                when the start or end object is null and the comparator
-	 *                cannot handle null
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * Answers a SortedSet of the specified portion of this TreeSet which
+     * contains elements greater or equal to the start element but less than the
+     * end element. The returned SortedSet is backed by this TreeSet so changes
+     * to one are reflected by the other.
+     * 
+     * @param start
+     *            the start element
+     * @param end
+     *            the end element
+     * @return a subset where the elements are greater or equal to
+     *         <code>start</code> and less than <code>end</code>
+     * 
+     * @exception ClassCastException
+     *                when the start or end object cannot be compared with the
+     *                elements in this TreeSet
+     * @exception NullPointerException
+     *                when the start or end object is null and the comparator
+     *                cannot handle null
+     */
+    @SuppressWarnings("unchecked")
     public SortedSet<E> subSet(E start, E end) {
         Comparator<? super E> c = backingMap.comparator();
         if (c == null) {
@@ -335,70 +336,71 @@
         throw new IllegalArgumentException();
     }
 
-	/**
-	 * Answers a SortedSet of the specified portion of this TreeSet which
-	 * contains elements greater or equal to the start element. The returned
-	 * SortedSet is backed by this TreeSet so changes to one are reflected by
-	 * the other.
-	 * 
-	 * @param start
-	 *            the start element
-	 * @return a subset where the elements are greater or equal to
-	 *         <code>start</code>
-	 * 
-	 * @exception ClassCastException
-	 *                when the start object cannot be compared with the elements
-	 *                in this TreeSet
-	 * @exception NullPointerException
-	 *                when the start object is null and the comparator cannot
-	 *                handle null
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * Answers a SortedSet of the specified portion of this TreeSet which
+     * contains elements greater or equal to the start element. The returned
+     * SortedSet is backed by this TreeSet so changes to one are reflected by
+     * the other.
+     * 
+     * @param start
+     *            the start element
+     * @return a subset where the elements are greater or equal to
+     *         <code>start</code>
+     * 
+     * @exception ClassCastException
+     *                when the start object cannot be compared with the elements
+     *                in this TreeSet
+     * @exception NullPointerException
+     *                when the start object is null and the comparator cannot
+     *                handle null
+     */
+    @SuppressWarnings("unchecked")
     public SortedSet<E> tailSet(E start) {
-		// Check for errors
-		Comparator<? super E> c = backingMap.comparator();
-		if (c == null) {
+        // Check for errors
+        Comparator<? super E> c = backingMap.comparator();
+        if (c == null) {
             ((Comparable<E>) start).compareTo(start);
         } else {
             c.compare(start, start);
         }
-		return new TreeSet<E>(backingMap.tailMap(start));
-	}
+        return new TreeSet<E>(backingMap.tailMap(start));
+    }
+
+    private void writeObject(ObjectOutputStream stream) throws IOException {
+        stream.defaultWriteObject();
+        stream.writeObject(backingMap.comparator());
+        int size = backingMap.size();
+        stream.writeInt(size);
+        if (size > 0) {
+            Iterator<E> it = backingMap.keySet().iterator();
+            while (it.hasNext()) {
+                stream.writeObject(it.next());
+            }
+        }
+    }
 
-	private void writeObject(ObjectOutputStream stream) throws IOException {
-	    stream.defaultWriteObject();
-	    stream.writeObject(backingMap.comparator());
-	    int size = backingMap.size();
-	    stream.writeInt(size);
-	    if (size > 0) {
-	        Iterator<E> it = backingMap.keySet().iterator();
-	        while (it.hasNext()) {
-	            stream.writeObject(it.next());
-	        }
-	    }
-	}
-
-	@SuppressWarnings("unchecked")
-	private void readObject(ObjectInputStream stream) throws IOException,
-	ClassNotFoundException {
-	    stream.defaultReadObject();
-	    TreeMap<E, E> map = new TreeMap<E, E>((Comparator<? super E>) stream.readObject());
-	    int size = stream.readInt();
-	    if (size > 0) {
-	        E key = (E)stream.readObject();
-	        TreeMap.Entry<E,E> last = new TreeMap.Entry<E,E>(key,key);
-	        map.root = last;
-	        map.size = 1;
-	        for (int i=1; i<size; i++) {
-	            key = (E)stream.readObject();
-	            TreeMap.Entry<E,E> x = new TreeMap.Entry<E,E>(key,key);
-	            x.parent = last;
-	            last.right = x;
-	            map.size++;
-	            map.balance(x);
-	            last = x;
-	        }
-	    }
-	    backingMap = map;
-	}
+    @SuppressWarnings("unchecked")
+    private void readObject(ObjectInputStream stream) throws IOException,
+            ClassNotFoundException {
+        stream.defaultReadObject();
+        TreeMap<E, E> map = new TreeMap<E, E>((Comparator<? super E>) stream
+                .readObject());
+        int size = stream.readInt();
+        if (size > 0) {
+            E key = (E) stream.readObject();
+            TreeMap.Entry<E, E> last = new TreeMap.Entry<E, E>(key, key);
+            map.root = last;
+            map.size = 1;
+            for (int i = 1; i < size; i++) {
+                key = (E) stream.readObject();
+                TreeMap.Entry<E, E> x = new TreeMap.Entry<E, E>(key, key);
+                x.parent = last;
+                last.right = x;
+                map.size++;
+                map.balance(x);
+                last = x;
+            }
+        }
+        backingMap = map;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UUID.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UUID.java?rev=598628&r1=598627&r2=598628&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UUID.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UUID.java Tue Nov
27 05:03:19 2007
@@ -63,8 +63,10 @@
      * Constructs an instance with the specified bits.
      * </p>
      * 
-     * @param mostSigBits The 64 most significant bits of the UUID.
-     * @param leastSigBits The 64 least significant bits of the UUID.
+     * @param mostSigBits
+     *            The 64 most significant bits of the UUID.
+     * @param leastSigBits
+     *            The 64 least significant bits of the UUID.
      */
     public UUID(long mostSigBits, long leastSigBits) {
         super();
@@ -204,54 +206,58 @@
      * Parses a UUID string with the format defined by {@link #toString()}.
      * </p>
      * 
-     * @param uuid The UUID string to parse.
+     * @param uuid
+     *            The UUID string to parse.
      * @return A UUID instance.
-     * @throws NullPointerException if <code>uuid</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>uuid</code> is not formatted
-     *         correctly.
+     * @throws NullPointerException
+     *             if <code>uuid</code> is <code>null</code>.
+     * @throws IllegalArgumentException
+     *             if <code>uuid</code> is not formatted correctly.
      */
     public static UUID fromString(String uuid) {
         if (uuid == null) {
             throw new NullPointerException();
         }
-        
+
         int[] position = new int[5];
         int lastPosition = 1;
         int startPosition = 0;
-        
+
         int i = 0;
-        for (; i < position.length  && lastPosition > 0; i++) {
-        	position[i] = uuid.indexOf("-", startPosition); //$NON-NLS-1$
-        	lastPosition = position[i];
-        	startPosition = position[i] + 1;
+        for (; i < position.length && lastPosition > 0; i++) {
+            position[i] = uuid.indexOf("-", startPosition); //$NON-NLS-1$
+            lastPosition = position[i];
+            startPosition = position[i] + 1;
         }
 
         // should have and only can have four "-" in UUID
-        if(i != position.length || lastPosition != -1)
-        {
-        	throw new IllegalArgumentException(Msg.getString("KA014") + uuid); //$NON-NLS-1$
-        }
-
-		long m1 = Long.parseLong(uuid.substring(0, position[0]), 16);
-		long m2 = Long.parseLong(uuid.substring(position[0]+ 1, position[1]), 16);
-		long m3 = Long.parseLong(uuid.substring(position[1] + 1, position[2]), 16);
-
-		long lsb1 = Long.parseLong(uuid.substring(position[2] + 1, position[3]), 16);
-		long lsb2 = Long.parseLong(uuid.substring(position[3]+ 1), 16);
-
-		long msb = (m1 << 32) | (m2 << 16) | m3;
-		long lsb = (lsb1 << 48) | lsb2;
-		
-		return new UUID(msb, lsb);
-	}
-
-    /**
-	 * <p>
-	 * The 64 least significant bits of the UUID.
-	 * </p>
-	 * 
-	 * @return A long value.
-	 */
+        if (i != position.length || lastPosition != -1) {
+            throw new IllegalArgumentException(Msg.getString("KA014") + uuid); //$NON-NLS-1$
+        }
+
+        long m1 = Long.parseLong(uuid.substring(0, position[0]), 16);
+        long m2 = Long.parseLong(uuid.substring(position[0] + 1, position[1]),
+                16);
+        long m3 = Long.parseLong(uuid.substring(position[1] + 1, position[2]),
+                16);
+
+        long lsb1 = Long.parseLong(
+                uuid.substring(position[2] + 1, position[3]), 16);
+        long lsb2 = Long.parseLong(uuid.substring(position[3] + 1), 16);
+
+        long msb = (m1 << 32) | (m2 << 16) | m3;
+        long lsb = (lsb1 << 48) | lsb2;
+
+        return new UUID(msb, lsb);
+    }
+
+    /**
+     * <p>
+     * The 64 least significant bits of the UUID.
+     * </p>
+     * 
+     * @return A long value.
+     */
     public long getLeastSignificantBits() {
         return leastSigBits;
     }
@@ -312,7 +318,8 @@
      * </p>
      * 
      * @return A long value.
-     * @throws UnsupportedOperationException if {@link #version()} is not 1.
+     * @throws UnsupportedOperationException
+     *             if {@link #version()} is not 1.
      */
     public long timestamp() {
         if (version != 1) {
@@ -328,7 +335,8 @@
      * </p>
      * 
      * @return A long value.
-     * @throws UnsupportedOperationException if {@link #version()} is not 1.
+     * @throws UnsupportedOperationException
+     *             if {@link #version()} is not 1.
      */
     public int clockSequence() {
         if (version != 1) {
@@ -344,7 +352,8 @@
      * </p>
      * 
      * @return A long value.
-     * @throws UnsupportedOperationException if {@link #version()} is not 1.
+     * @throws UnsupportedOperationException
+     *             if {@link #version()} is not 1.
      */
     public long node() {
         if (version != 1) {
@@ -360,7 +369,8 @@
      * significant.
      * </p>
      * 
-     * @param uuid The UUID to compare to.
+     * @param uuid
+     *            The UUID to compare to.
      * @return A value of -1, 0 or 1 if this UUID is less than, equal to or
      *         greater than <code>uuid</code>.
      */
@@ -391,7 +401,8 @@
      * then <code>true</code> is returned.
      * </p>
      * 
-     * @param object The Object to compare to.
+     * @param object
+     *            The Object to compare to.
      * @return A <code>true</code> if this UUID is equal to
      *         <code>object</code> or <code>false</code> if not.
      */
@@ -485,9 +496,12 @@
      * Resets the transient fields to match the behavior of the constructor.
      * </p>
      * 
-     * @param in The InputStream to read from.
-     * @throws IOException if <code>in</code> throws it.
-     * @throws ClassNotFoundException if <code>in</code> throws it.
+     * @param in
+     *            The InputStream to read from.
+     * @throws IOException
+     *             if <code>in</code> throws it.
+     * @throws ClassNotFoundException
+     *             if <code>in</code> throws it.
      */
     private void readObject(ObjectInputStream in) throws IOException,
             ClassNotFoundException {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatConversionException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatConversionException.java?rev=598628&r1=598627&r2=598628&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatConversionException.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatConversionException.java
Tue Nov 27 05:03:19 2007
@@ -20,40 +20,39 @@
 /**
  * The unchecked exception will be thrown out if the format conversion is
  * unknown.
- * 
- * 
  */
 public class UnknownFormatConversionException extends IllegalFormatException {
-	private static final long serialVersionUID = 19060418L;
 
-	private String s;
+    private static final long serialVersionUID = 19060418L;
 
-	/**
-	 * Constructs an UnknownFormatConversionException with the unknown format
-	 * conversion.
-	 * 
-	 * @param s
-	 *            The unknown format conversion
-	 */
-	public UnknownFormatConversionException(String s) {
-		this.s = s;
-	}
+    private String s;
 
-	/**
-	 * Returns the conversion associated with the exception.
-	 * 
-	 * @return The conversion associated with the exception.
-	 */
-	public String getConversion() {
-		return s;
-	}
+    /**
+     * Constructs an UnknownFormatConversionException with the unknown format
+     * conversion.
+     * 
+     * @param s
+     *            The unknown format conversion
+     */
+    public UnknownFormatConversionException(String s) {
+        this.s = s;
+    }
 
-	/**
-	 * Returns the message of the exception.
-	 * 
-	 * @return The message of the exception.
-	 */
-	@Override
+    /**
+     * Returns the conversion associated with the exception.
+     * 
+     * @return The conversion associated with the exception.
+     */
+    public String getConversion() {
+        return s;
+    }
+
+    /**
+     * Returns the message of the exception.
+     * 
+     * @return The message of the exception.
+     */
+    @Override
     public String getMessage() {
         return Msg.getString("K0349", s);
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java?rev=598628&r1=598627&r2=598628&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java
Tue Nov 27 05:03:19 2007
@@ -20,42 +20,41 @@
 
 /**
  * The unchecked exception will be thrown out if there is an unknown flag.
- * 
  */
 public class UnknownFormatFlagsException extends IllegalFormatException {
 
-	private static final long serialVersionUID = 19370506L;
+    private static final long serialVersionUID = 19370506L;
 
-	private String flags;
+    private String flags;
 
-	/**
-	 * Constructs an UnknownFormatFlagsException with the specified flags.
-	 * 
-	 * @param f
-	 *            The specified flags.
-	 */
-	public UnknownFormatFlagsException(String f) {
-		if (null == f) {
-			throw new NullPointerException();
-		}
-		flags = f;
-	}
+    /**
+     * Constructs an UnknownFormatFlagsException with the specified flags.
+     * 
+     * @param f
+     *            The specified flags.
+     */
+    public UnknownFormatFlagsException(String f) {
+        if (null == f) {
+            throw new NullPointerException();
+        }
+        flags = f;
+    }
 
-	/**
-	 * Returns the flags associated with the exception.
-	 * 
-	 * @return The flags associated with the exception.
-	 */
-	public String getFlags() {
-		return flags;
-	}
+    /**
+     * Returns the flags associated with the exception.
+     * 
+     * @return The flags associated with the exception.
+     */
+    public String getFlags() {
+        return flags;
+    }
 
-	/**
-	 * Returns the message associated with the exception.
-	 * 
-	 * @return The message associated with the exception.
-	 */
-	@Override
+    /**
+     * Returns the message associated with the exception.
+     * 
+     * @return The message associated with the exception.
+     */
+    @Override
     public String getMessage() {
         return Msg.getString("K034a", flags);
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Vector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Vector.java?rev=598628&r1=598627&r2=598628&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Vector.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Vector.java Tue Nov
27 05:03:19 2007
@@ -960,7 +960,7 @@
      * 
      * @exception IndexOutOfBoundsException
      *                when <code>start < 0 or <code>end > size()</code>
-     * @exception	IllegalArgumentException when <code>start > end</code>
+     * @exception IllegalArgumentException when <code>start > end</code>
      */
     @Override
     public synchronized List<E> subList(int start, int end) {



Mime
View raw message