From 0662d7053a08078b08d9cca058714f14f3f2fbcd Mon Sep 17 00:00:00 2001 From: tromey Date: Tue, 18 Jun 2002 15:40:16 +0000 Subject: * gcj/javaprims.h: Updated class declaration list. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added PropertyPermissionCollection.java. * java/lang/Thread.java (group, name): Now package-private. * java/lang/ThreadGroup.java: Re-merge with Classpath. * java/util/AbstractList.java: Likewise. * java/util/AbstractMap.java: Likewise. * java/util/Calendar.java: Likewise. * java/util/Collections.java: Likewise. * java/util/HashMap.java: Likewise. * java/util/Hashtable.java: Likewise. * java/util/LinkedHashMap.java: Likewise. * java/util/LinkedList.java: Likewise. * java/util/List.java: Likewise. * java/util/ListResourceBundle.java: Likewise. * java/util/Map.java: Likewise. * java/util/Observable.java: Likewise. * java/util/Properties.java: Likewise. * java/util/PropertyPermission.java: Likewise. * java/util/PropertyPermissionCollection.java: Likewise. * java/util/PropertyResourceBundle.java: Likewise. * java/util/Random.java: Likewise. * java/util/SimpleTimeZone.java: Likewise. * java/util/StringTokenizer.java: Likewise. * java/util/TimerTask.java: Likewise. * java/util/TreeMap.java: Likewise. * java/util/WeakHashMap.java: Likewise. * java/util/jar/Attributes.java: Likewise. * java/util/jar/JarException.java: Likewise. * java/util/jar/Manifest.java: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54743 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/util/AbstractList.java | 46 ++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'libjava/java/util/AbstractList.java') diff --git a/libjava/java/util/AbstractList.java b/libjava/java/util/AbstractList.java index 1c2d1de65ab..be0bc307a56 100644 --- a/libjava/java/util/AbstractList.java +++ b/libjava/java/util/AbstractList.java @@ -1,5 +1,5 @@ /* AbstractList.java -- Abstract implementation of most of List - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -237,20 +237,22 @@ public abstract class AbstractList extends AbstractCollection implements List } /** - * Obtain a hash code for this list. In order to obey the general contract of - * the hashCode method of class Object, this value is calculated as follows: - *
-   *   hashCode = 1;
-   *   Iterator i = list.iterator();
-   *   while (i.hasNext())
-   *     {
-   *       Object obj = i.next();
-   *       hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
-   *     }
-   * 
+ * Obtains a hash code for this list. In order to obey the general + * contract of the hashCode method of class Object, this value is + * calculated as follows: + * +
hashCode = 1;
+Iterator i = list.iterator();
+while (i.hasNext())
+{
+  Object obj = i.next();
+  hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
+}
+ * * This ensures that the general contract of Object.hashCode() is adhered to. * * @return the hash code of this list + * * @see Object#hashCode() * @see #equals(Object) */ @@ -611,19 +613,21 @@ public abstract class AbstractList extends AbstractCollection implements List /** * This class follows the implementation requirements set forth in - * {@link AbstractList#subList(int, int)}. Some compilers have problems - * with AbstractList.this.modCount if this class is nested in AbstractList, - * even though the JLS defines that to be legal, so we make it a top-level - * class. + * {@link AbstractList#subList(int, int)}. It matches Sun's implementation + * by using a non-public top-level class in the same package. * * @author Original author unknown * @author Eric Blake */ class SubList extends AbstractList { - private final AbstractList backingList; - private final int offset; - private int size; + // Package visible, for use by iterator. + /** The original list. */ + final AbstractList backingList; + /** The index of the first element of the sublist. */ + final int offset; + /** The size of the sublist. */ + int size; /** * Construct the sublist. @@ -647,8 +651,8 @@ class SubList extends AbstractList * @throws ConcurrentModificationException if the backing list has been * modified externally to this sublist */ - // This will get inlined, since it is private. - private void checkMod() + // This can be inlined. Package visible, for use by iterator. + void checkMod() { if (modCount != backingList.modCount) throw new ConcurrentModificationException(); -- cgit v1.2.1