/[classpath]/classpath/java/util/AbstractList.java
ViewVC logotype

Diff of /classpath/java/util/AbstractList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by brawer, Tue Apr 30 13:59:10 2002 UTC revision 1.21 by ericb, Tue May 7 05:13:05 2002 UTC
# Line 1  Line 1 
1  /* AbstractList.java -- Abstract implementation of most of List  /* AbstractList.java -- Abstract implementation of most of List
2     Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 613  while (i.hasNext()) Line 613  while (i.hasNext())
613    
614  /**  /**
615   * This class follows the implementation requirements set forth in   * This class follows the implementation requirements set forth in
616   * {@link AbstractList#subList(int, int)}. Some compilers have problems   * {@link AbstractList#subList(int, int)}. It matches Sun's implementation
617   * with AbstractList.this.modCount if this class is nested in AbstractList,   * by using a non-public top-level class in the same package.
  * even though the JLS defines that to be legal, so we make it a top-level  
  * class.  
618   *   *
619   * @author Original author unknown   * @author Original author unknown
620   * @author Eric Blake <ebb9@email.byu.edu>   * @author Eric Blake <ebb9@email.byu.edu>
621   */   */
622  class SubList extends AbstractList  class SubList extends AbstractList
623  {  {
624    private final AbstractList backingList;    // Package visible, for use by iterator.
625    private final int offset;    /** The original list. */
626    private int size;    final AbstractList backingList;
627      /** The index of the first element of the sublist. */
628      final int offset;
629      /** The size of the sublist. */
630      int size;
631    
632    /**    /**
633     * Construct the sublist.     * Construct the sublist.
# Line 649  class SubList extends AbstractList Line 651  class SubList extends AbstractList
651     * @throws ConcurrentModificationException if the backing list has been     * @throws ConcurrentModificationException if the backing list has been
652     *         modified externally to this sublist     *         modified externally to this sublist
653     */     */
654    // This will get inlined, since it is private.    // This can be inlined. Package visible, for use by iterator.
655    private void checkMod()    void checkMod()
656    {    {
657      if (modCount != backingList.modCount)      if (modCount != backingList.modCount)
658        throw new ConcurrentModificationException();        throw new ConcurrentModificationException();

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26