classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

more java.util


From: Eric Blake
Subject: more java.util
Date: Sun, 21 Oct 2001 21:59:28 -0600

I made another commit to java.util, this time to the List related
files.  Again, my biggest change was standardizing the javadoc and
formatting, but I also patched a few bugs.

2001-10-21  Eric Blake  <address@hidden>

        * java/util/AbstractList.java:
        (modCount): Make sure it is updated in all needed places.
        * java/util/ArrayList.java: Improve javadoc. Implements
        RandomAccess. Add serialVersionUID. Reorder methods.
        (modCount): Make sure it is updated in all needed places.
        (rangeExclusive, rangeInclusive): Add common methods for bounds
        check.
        (isEmpty): Add missing method.
        * java/util/Collections.java: (class SynchronizedList): Make
        package visible.
        * java/util/ConcurrentModificationException.java: Improve
        javadoc.
        * java/util/EmptyStackException.java: Improve javadoc.
        * java/util/LinkedList.java: Improve javadoc.
        (modCount): Make sure it is updated in all needed places.
        (rangeExclusive, rangeInclusive): Add common methods for bounds
        check.
        * java/util/NoSuchElementException.java: Improve javadoc.
        * java/util/Stack.java: Improve javadoc. Fix synchronization
        issues.
        (modCount): Make sure it is updated in all needed places.
        * java/util/Vector.java: Improve javadoc. Fix synchronization
        issues. Implements RandomAccess. Reorder methods.
        (modCount): Make sure it is updated in all needed places.
        (setSize): Fix according to specifications: this does not dictate
        the backing array size.
        (removeAll, retainAll): Faster implementations.

Still outstanding in my local tree are modifications to the Set/Map
classes.  In the meantime, feel free to point out any bugs in my recent
commits.

I've noticed two main styles in java.util .java layouts, which probably
extend to other files.  One style lists public methods in alphabetical
order, the other lists them in the same order as the JDK web pages.  Is
there a preference as to which is better?  Also, is there a preference
as to whether field declarations should come before or after methods? 
I've sort of leaning to this approach (in part because it is similar to
the JDK web page layout):

class Foo
{
  static fields (constants first)
  instance fields
  constructors
  abstract methods
  other public methods, in alphabetical order
  helper (package-)private methods
  nested classes
}

Any preferences one way or another? Or flames in my general direction
for messing things up? If one layout style is preferred as the standard,
it would be a nice thing to document on the Classpath website and the
HACKING instructions.

-- 
This signature intentionally left boring.

Eric Blake             address@hidden
  BYU student, free software programmer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]