harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r417153 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util: AbstractCollection.java AbstractList.java AbstractMap.java AbstractQueue.java AbstractSequentialList.java AbstractSet.java
Date Mon, 26 Jun 2006 10:10:38 GMT
Author: ndbeyer
Date: Mon Jun 26 03:10:36 2006
New Revision: 417153

URL: http://svn.apache.org/viewvc?rev=417153&view=rev
Log:
Add override annotations and misc code cleanup.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractQueue.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSequentialList.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
Mon Jun 26 03:10:36 2006
@@ -30,14 +30,9 @@
 	 * Constructs a new instance of this AbstractCollection.
 	 */
 	protected AbstractCollection() {
-		// Empty
+		super();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.util.Collection#add(java.lang.Object)
-	 */
 	public boolean add(E object) {
 		throw new UnsupportedOperationException();
 	}
@@ -60,17 +55,14 @@
 	public boolean addAll(Collection<? extends E> collection) {
 		boolean result = false;
 		Iterator<? extends E> it = collection.iterator();
-		while (it.hasNext())
-			if (add(it.next()))
-				result = true;
+		while (it.hasNext()) {
+            if (add(it.next())) {
+                result = true;
+            }
+        }
 		return result;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.util.Collection#clear()
-	 */
 	public void clear() {
 		Iterator<E> it = iterator();
 		while (it.hasNext()) {
@@ -90,13 +82,17 @@
 	public boolean contains(Object object) {
 		Iterator<E> it = iterator();
 		if (object != null) {
-			while (it.hasNext())
-				if (object.equals(it.next()))
-					return true;
+			while (it.hasNext()) {
+                if (object.equals(it.next())) {
+                    return true;
+                }
+            }
 		} else {
-			while (it.hasNext())
-				if (it.next() == null)
-					return true;
+			while (it.hasNext()) {
+                if (it.next() == null) {
+                    return true;
+                }
+            }
 		}
 		return false;
 	}
@@ -111,17 +107,14 @@
 	 */
 	public boolean containsAll(Collection<?> collection) {
 		Iterator<?> it = collection.iterator();
-		while (it.hasNext())
-			if (!contains(it.next()))
-				return false;
+		while (it.hasNext()) {
+            if (!contains(it.next())) {
+                return false;
+            }
+        }
 		return true;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.util.Collection#isEmpty()
-	 */
 	public boolean isEmpty() {
 		return size() == 0;
 	}
@@ -229,8 +222,9 @@
 		int size = size(), index = 0;
 		Iterator<?> it = iterator();
 		Object[] array = new Object[size];
-		while (index < size)
-			array[index++] = it.next();
+		while (index < size) {
+            array[index++] = it.next();
+        }
 		return array;
 	}
 
@@ -270,9 +264,11 @@
 	 * 
 	 * @return the string representation of this Collection
 	 */
-	public String toString() {
-		if (isEmpty())
-			return "[]"; //$NON-NLS-1$
+	@Override
+    public String toString() {
+		if (isEmpty()) {
+            return "[]"; //$NON-NLS-1$
+        }
 
 		StringBuilder buffer = new StringBuilder(size() * 16);
 		buffer.append('[');

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
Mon Jun 26 03:10:36 2006
@@ -25,14 +25,15 @@
  */
 public abstract class AbstractList<E> extends AbstractCollection<E> implements
List<E> {
 
-	protected transient int modCount = 0;
+	protected transient int modCount;
 
 	private class SimpleListIterator implements Iterator<E> {
-		int pos = -1, expectedModCount;
-
+		int pos = -1;
+        int expectedModCount;
 		int lastPosition = -1;
 
 		SimpleListIterator() {
+            super();
 			expectedModCount = modCount;
 		}
 
@@ -60,23 +61,28 @@
 				} catch (IndexOutOfBoundsException e) {
 					throw new IllegalStateException();
 				}
-				if (modCount != expectedModCount)
-					expectedModCount++;
-				if (pos == lastPosition)
-					pos--;
+				if (modCount != expectedModCount) {
+                    expectedModCount++;
+                }
+				if (pos == lastPosition) {
+                    pos--;
+                }
 				lastPosition = -1;
-			} else
-				throw new ConcurrentModificationException();
+			} else {
+                throw new ConcurrentModificationException();
+            }
 		}
 	}
 
 	private final class FullListIterator extends SimpleListIterator implements
 			ListIterator<E> {
 		FullListIterator(int start) {
-			if (0 <= start && start <= size())
-				pos = start - 1;
-			else
-				throw new IndexOutOfBoundsException();
+            super();
+			if (0 <= start && start <= size()) {
+                pos = start - 1;
+            } else {
+                throw new IndexOutOfBoundsException();
+            }
 		}
 
 		public void add(E object) {
@@ -88,10 +94,12 @@
 				}
 				pos++;
 				lastPosition = -1;
-				if (modCount != expectedModCount)
-					expectedModCount++;
-			} else
-				throw new ConcurrentModificationException();
+				if (modCount != expectedModCount) {
+                    expectedModCount++;
+                }
+			} else {
+                throw new ConcurrentModificationException();
+            }
 		}
 
 		public boolean hasPrevious() {
@@ -127,8 +135,9 @@
 				} catch (IndexOutOfBoundsException e) {
 					throw new IllegalStateException();
 				}
-			} else
-				throw new ConcurrentModificationException();
+			} else {
+                throw new ConcurrentModificationException();
+            }
 		}
 	}
 
@@ -142,7 +151,8 @@
 	private static class SubAbstractList<E> extends AbstractList<E> {
 		private final AbstractList<E> fullList;
 
-		private int offset, size;
+		private int offset;
+        private int size;
 
 		private static final class SubAbstractListIterator<E> implements
 				ListIterator<E> {
@@ -150,10 +160,12 @@
 
 			private final ListIterator<E> iterator;
 
-			private int start, end;
+			private int start;
+            private int end;
 
 			SubAbstractListIterator(ListIterator<E> it, SubAbstractList<E> list,
 					int offset, int length) {
+                super();
 				iterator = it;
 				subList = list;
 				start = offset;
@@ -175,8 +187,9 @@
 			}
 
 			public E next() {
-				if (iterator.nextIndex() < end)
-					return iterator.next();
+				if (iterator.nextIndex() < end) {
+                    return iterator.next();
+                }
 				throw new NoSuchElementException();
 			}
 
@@ -185,15 +198,17 @@
 			}
 
 			public E previous() {
-				if (iterator.previousIndex() >= start)
-					return iterator.previous();
+				if (iterator.previousIndex() >= start) {
+                    return iterator.previous();
+                }
 				throw new NoSuchElementException();
 			}
 
 			public int previousIndex() {
 				int previous = iterator.previousIndex();
-				if (previous >= start)
-					return previous - start;
+				if (previous >= start) {
+                    return previous - start;
+                }
 				return -1;
 			}
 
@@ -209,25 +224,30 @@
 		}
 
 		SubAbstractList(AbstractList<E> list, int start, int end) {
+            super();
 			fullList = list;
 			modCount = fullList.modCount;
 			offset = start;
 			size = end - start;
 		}
 
-		public void add(int location, E object) {
+		@Override
+        public void add(int location, E object) {
 			if (modCount == fullList.modCount) {
 				if (0 <= location && location <= size) {
 					fullList.add(location + offset, object);
 					size++;
 					modCount = fullList.modCount;
-				} else
-					throw new IndexOutOfBoundsException();
-			} else
-				throw new ConcurrentModificationException();
+				} else {
+                    throw new IndexOutOfBoundsException();
+                }
+			} else {
+                throw new ConcurrentModificationException();
+            }
 		}
 
-		public boolean addAll(int location, Collection<? extends E> collection) {
+		@Override
+        public boolean addAll(int location, Collection<? extends E> collection) {
 			if (modCount == fullList.modCount) {
 				if (0 <= location && location <= size) {
 					boolean result = fullList.addAll(location + offset,
@@ -243,7 +263,8 @@
 			throw new ConcurrentModificationException();
 		}
 
-		public boolean addAll(Collection<? extends E> collection) {
+		@Override
+        public boolean addAll(Collection<? extends E> collection) {
             if (modCount == fullList.modCount) {
                 boolean result = fullList.addAll(offset + size, collection);
                 if (result) {
@@ -255,31 +276,37 @@
             throw new ConcurrentModificationException();
         }
 
-		public E get(int location) {
+		@Override
+        public E get(int location) {
 			if (modCount == fullList.modCount) {
-				if (0 <= location && location < size)
-					return fullList.get(location + offset);
+				if (0 <= location && location < size) {
+                    return fullList.get(location + offset);
+                }
 				throw new IndexOutOfBoundsException();
 			}
 			throw new ConcurrentModificationException();
 		}
 
-		public Iterator<E> iterator() {
+		@Override
+        public Iterator<E> iterator() {
 			return listIterator(0);
 		}
 
-		public ListIterator<E> listIterator(int location) {
+		@Override
+        public ListIterator<E> listIterator(int location) {
 			if (modCount == fullList.modCount) {
-				if (0 <= location && location <= size)
-					return new SubAbstractListIterator<E>(fullList
+				if (0 <= location && location <= size) {
+                    return new SubAbstractListIterator<E>(fullList
 							.listIterator(location + offset), this, offset,
 							size);
+                }
 				throw new IndexOutOfBoundsException();
 			}
 			throw new ConcurrentModificationException();
 		}
 
-		public E remove(int location) {
+		@Override
+        public E remove(int location) {
 			if (modCount == fullList.modCount) {
 				if (0 <= location && location < size) {
 					E result = fullList.remove(location + offset);
@@ -292,35 +319,41 @@
 			throw new ConcurrentModificationException();
 		}
 
-		protected void removeRange(int start, int end) {
+		@Override
+        protected void removeRange(int start, int end) {
 			if (start != end) {
 				if (modCount == fullList.modCount) {
 					fullList.removeRange(start + offset, end + offset);
 					size -= end - start;
 					modCount = fullList.modCount;
-				} else
-					throw new ConcurrentModificationException();
+				} else {
+                    throw new ConcurrentModificationException();
+                }
 			}
 		}
 
-		public E set(int location, E object) {
+		@Override
+        public E set(int location, E object) {
 			if (modCount == fullList.modCount) {
-				if (0 <= location && location < size)
-					return fullList.set(location + offset, object);
+				if (0 <= location && location < size) {
+                    return fullList.set(location + offset, object);
+                }
 				throw new IndexOutOfBoundsException();
 			}
 			throw new ConcurrentModificationException();
 		}
 
-		public int size() {
+		@Override
+        public int size() {
 			return size;
 		}
 
 		void sizeChanged(boolean increment) {
-			if (increment)
-				size++;
-			else
-				size--;
+			if (increment) {
+                size++;
+            } else {
+                size--;
+            }
 			modCount = fullList.modCount;
 		}
 	}
@@ -330,6 +363,7 @@
 	 * 
 	 */
 	protected AbstractList() {
+        super();
 	}
 
 	/**
@@ -374,7 +408,8 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to this List
 	 */
-	public boolean add(E object) {
+	@Override
+    public boolean add(E object) {
 		add(size(), object);
 		return true;
 	}
@@ -402,8 +437,9 @@
 	 */
 	public boolean addAll(int location, Collection<? extends E> collection) {
 		Iterator<? extends E> it = collection.iterator();
-		while (it.hasNext())
-			add(location++, it.next());
+		while (it.hasNext()) {
+            add(location++, it.next());
+        }
 		return !collection.isEmpty();
 	}
 
@@ -417,7 +453,8 @@
 	 * @see List#isEmpty
 	 * @see List#size
 	 */
-	public void clear() {
+	@Override
+    public void clear() {
 		removeRange(0, size());
 	}
 
@@ -434,19 +471,23 @@
 	 * 
 	 * @see #hashCode
 	 */
-	public boolean equals(Object object) {
-		if (this == object)
-			return true;
+	@Override
+    public boolean equals(Object object) {
+		if (this == object) {
+            return true;
+        }
 		if (object instanceof List) {
 			List<?> list = (List) object;
-			if (list.size() != size())
-				return false;
+			if (list.size() != size()) {
+                return false;
+            }
 
 			Iterator<?> it1 = iterator(), it2 = list.iterator();
 			while (it1.hasNext()) {
 				Object e1 = it1.next(), e2 = it2.next();
-				if (!(e1 == null ? e2 == null : e1.equals(e2)))
-					return false;
+				if (!(e1 == null ? e2 == null : e1.equals(e2))) {
+                    return false;
+                }
 			}
 			return true;
 		}
@@ -475,7 +516,8 @@
 	 * 
 	 * @see #equals
 	 */
-	public int hashCode() {
+	@Override
+    public int hashCode() {
 		int result = 1;
 		Iterator<?> it = iterator();
 		while (it.hasNext()) {
@@ -497,13 +539,17 @@
 	public int indexOf(Object object) {
 		ListIterator<?> it = listIterator();
 		if (object != null) {
-			while (it.hasNext())
-				if (object.equals(it.next()))
-					return it.previousIndex();
+			while (it.hasNext()) {
+                if (object.equals(it.next())) {
+                    return it.previousIndex();
+                }
+            }
 		} else {
-			while (it.hasNext())
-				if (it.next() == null)
-					return it.previousIndex();
+			while (it.hasNext()) {
+                if (it.next() == null) {
+                    return it.previousIndex();
+                }
+            }
 		}
 		return -1;
 	}
@@ -517,7 +563,8 @@
 	 * 
 	 * @see Iterator
 	 */
-	public Iterator<E> iterator() {
+	@Override
+    public Iterator<E> iterator() {
 		return new SimpleListIterator();
 	}
 
@@ -533,13 +580,17 @@
 	public int lastIndexOf(Object object) {
 		ListIterator<?> it = listIterator(size());
 		if (object != null) {
-			while (it.hasPrevious())
-				if (object.equals(it.previous()))
-					return it.nextIndex();
+			while (it.hasPrevious()) {
+                if (object.equals(it.previous())) {
+                    return it.nextIndex();
+                }
+            }
 		} else {
-			while (it.hasPrevious())
-				if (it.previous() == null)
-					return it.nextIndex();
+			while (it.hasPrevious()) {
+                if (it.previous() == null) {
+                    return it.nextIndex();
+                }
+            }
 		}
 		return -1;
 	}
@@ -640,16 +691,12 @@
 		throw new UnsupportedOperationException();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.util.List#subList(int, int)
-	 */
 	public List<E> subList(int start, int end) {
 		if (0 <= start && end <= size()) {
 			if (start <= end) {
-				if (this instanceof RandomAccess)
-					return new SubAbstractListRandomAccess<E>(this, start, end);
+				if (this instanceof RandomAccess) {
+                    return new SubAbstractListRandomAccess<E>(this, start, end);
+                }
 				return new SubAbstractList<E>(this, start, end);
 			}
 			throw new IllegalArgumentException();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
Mon Jun 26 03:10:36 2006
@@ -32,7 +32,7 @@
      * Constructs a new instance of this AbstractMap.
      */
     protected AbstractMap() {
-        /* empty */
+        super();
     }
 
     /**
@@ -99,11 +99,6 @@
         return false;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.util.Map#entrySet()
-     */
     public abstract Set<Map.Entry<K, V>> entrySet();
 
     /**
@@ -118,6 +113,7 @@
      * 
      * @see #hashCode
      */
+    @Override
     public boolean equals(Object object) {
         if (this == object) {
             return true;
@@ -175,6 +171,7 @@
      * 
      * @see #equals
      */
+    @Override
     public int hashCode() {
         int result = 0;
         Iterator<Map.Entry<K, V>> it = entrySet().iterator();
@@ -205,14 +202,17 @@
     public Set<K> keySet() {
         if (keySet == null) {
             keySet = new AbstractSet<K>() {
+                @Override
                 public boolean contains(Object object) {
                     return containsKey(object);
                 }
 
+                @Override
                 public int size() {
                     return AbstractMap.this.size();
                 }
 
+                @Override
                 public Iterator<K> iterator() {
                     return new Iterator<K>() {
                         Iterator<Map.Entry<K, V>> setIterator = entrySet()
@@ -331,6 +331,7 @@
      * 
      * @return the string representation of this Map
      */
+    @Override
     public String toString() {
         if (isEmpty()) {
             return "{}"; //$NON-NLS-1$
@@ -362,22 +363,20 @@
         return buffer.toString();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.util.Map#values()
-     */
     public Collection<V> values() {
         if (valuesCollection == null) {
             valuesCollection = new AbstractCollection<V>() {
+                @Override
                 public int size() {
                     return AbstractMap.this.size();
                 }
 
+                @Override
                 public boolean contains(Object object) {
                     return containsValue(object);
                 }
 
+                @Override
                 public Iterator<V> iterator() {
                     return new Iterator<V>() {
                         Iterator<Map.Entry<K, V>> setIterator = entrySet().iterator();
@@ -409,6 +408,7 @@
      *                if the receiver's class does not implement the interface
      *                Cloneable.
      */
+    @Override
     @SuppressWarnings("unchecked")
     protected Object clone() throws CloneNotSupportedException {
         AbstractMap<K, V> result = (AbstractMap<K, V>) super.clone();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractQueue.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractQueue.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractQueue.java
Mon Jun 26 03:10:36 2006
@@ -19,7 +19,7 @@
  * 
  * An abstract class which gives out skeletal implementations for some methods
  * in Queue which include add, remove, and element that are based on offer,
- * poll, and peek except that they throw exception to indicate the occurence of
+ * poll, and peek except that they throw exception to indicate the occurrence of
  * some error instead of the return value of false or null.
  * 
  * @param <E>
@@ -33,6 +33,7 @@
      * 
      */
     protected AbstractQueue() {
+        super();
     }
 
     /**
@@ -44,6 +45,7 @@
      * @throws IllegalStateException if the element is not allowed to be added
      *         to the queue.
      */
+    @Override
     public boolean add(E o) {
         if (null == o) {
             throw new NullPointerException();
@@ -72,6 +74,7 @@
      * @throws IllegalArgumentException If the collection to be added to the
      *         queue is the queue itself.
      */
+    @Override
     public boolean addAll(Collection<? extends E> c) {
         if (null == c) {
             throw new NullPointerException();
@@ -119,6 +122,7 @@
     /**
      * Removes all elements of the queue.
      */
+    @Override
     public void clear() {
         E o;
         do {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSequentialList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSequentialList.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSequentialList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSequentialList.java
Mon Jun 26 03:10:36 2006
@@ -28,7 +28,7 @@
 	 * Constructs a new instance of this AbstractSequentialList.
 	 */
 	protected AbstractSequentialList() {
-		/*empty*/
+		super();
 	}
 
 	/**
@@ -55,7 +55,8 @@
 	 *                when the object is null and this List does not support
 	 *                null elements
 	 */
-	public void add(int location, E object) {
+	@Override
+    public void add(int location, E object) {
 		listIterator(location).add(object);
 	}
 
@@ -79,7 +80,8 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public boolean addAll(int location, Collection<? extends E> collection) {
+	@Override
+    public boolean addAll(int location, Collection<? extends E> collection) {
 		ListIterator<E> it = listIterator(location);
 		Iterator<? extends E> colIt = collection.iterator();
 		int next = it.nextIndex();
@@ -100,7 +102,8 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public E get(int location) {
+	@Override
+    public E get(int location) {
 		try {
 			return listIterator(location).next();
 		} catch (NoSuchElementException e) {
@@ -116,7 +119,8 @@
 	 * 
 	 * @see Iterator
 	 */
-	public Iterator<E> iterator() {
+	@Override
+    public Iterator<E> iterator() {
 		return listIterator(0);
 	}
 
@@ -134,7 +138,8 @@
 	 * 
 	 * @see ListIterator
 	 */
-	public abstract ListIterator<E> listIterator(int location);
+	@Override
+    public abstract ListIterator<E> listIterator(int location);
 
 	/**
 	 * Removes the object at the specified location from this List.
@@ -148,7 +153,8 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public E remove(int location) {
+	@Override
+    public E remove(int location) {
 		try {
 			ListIterator<E> it = listIterator(location);
 			E result = it.next();
@@ -178,7 +184,8 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public E set(int location, E object) {
+	@Override
+    public E set(int location, E object) {
 		ListIterator<E> it = listIterator(location);
 		E result = it.next();
 		it.set(object);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java?rev=417153&r1=417152&r2=417153&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java
Mon Jun 26 03:10:36 2006
@@ -28,7 +28,7 @@
 	 * Constructs a new instance of this AbstractSet.
 	 */
 	protected AbstractSet() {
-		/*empty*/
+		super();
 	}
 
 	/**
@@ -42,9 +42,11 @@
 	 * 
 	 * @see #hashCode
 	 */
-	public boolean equals(Object object) {
-		if (this == object)
-			return true;
+	@Override
+    public boolean equals(Object object) {
+		if (this == object) {
+            return true;
+        }
 		if (object instanceof Set) {
 			Set<?> s = (Set) object;
 			return size() == s.size() && containsAll(s);
@@ -60,7 +62,8 @@
 	 * 
 	 * @see #equals
 	 */
-	public int hashCode() {
+	@Override
+    public int hashCode() {
 		int result = 0;
 		Iterator<?> it = iterator();
 		while (it.hasNext()) {
@@ -81,7 +84,8 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Collection is not supported
 	 */
-	public boolean removeAll(Collection<?> collection) {
+	@Override
+    public boolean removeAll(Collection<?> collection) {
 		boolean result = false;
 		if (size() <= collection.size()) {
 			Iterator<?> it = iterator();
@@ -93,8 +97,9 @@
 			}
 		} else {
 			Iterator<?> it = collection.iterator();
-			while (it.hasNext())
-				result = remove(it.next()) || result;
+			while (it.hasNext()) {
+                result = remove(it.next()) || result;
+            }
 		}
 		return result;
 	}



Mime
View raw message