summaryrefslogtreecommitdiff
path: root/java/util/AbstractCollection.java
Commit message (Collapse)AuthorAgeFilesLines
* 2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>Andrew John Hughes2006-12-101-23/+25
| | | | * Merge of generics-branch to HEAD (woohoo!)
* Fixes bug #25769 reported by Artemus Harper <subanark@gmail.com>Mark Wielaard2006-02-021-4/+12
| | | | | * java/util/AbstractCollection.java (toString): Only use Iterator, check whether collection contains itself.
* * all files: Update for new FSF address.Mark Wielaard2005-07-021-2/+2
|
* 2005-02-16 Michael Koch <konqueror@gmx.de>Michael Koch2005-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/applet/Applet.java, java/beans/AppletInitializer.java, java/beans/ExceptionListener.java, java/beans/PropertyChangeEvent.java, java/beans/PropertyChangeListenerProxy.java, java/beans/PropertyChangeSupport.java, java/beans/PropertyDescriptor.java, java/beans/VetoableChangeListenerProxy.java, java/beans/VetoableChangeSupport.java, java/io/BufferedInputStream.java, java/io/BufferedReader.java, java/io/ByteArrayInputStream.java, java/io/ByteArrayOutputStream.java, java/io/CharArrayReader.java, java/io/CharArrayWriter.java, java/io/CharConversionException.java, java/io/DataInput.java, java/io/DataInputStream.java, java/io/DataOutput.java, java/io/DataOutputStream.java, java/io/EOFException.java, java/io/FileInputStream.java, java/io/FileNotFoundException.java, java/io/FileOutputStream.java, java/io/FilenameFilter.java, java/io/FilterInputStream.java, java/io/FilterOutputStream.java, java/io/FilterReader.java, java/io/FilterWriter.java, java/io/IOException.java, java/io/InputStream.java, java/io/InputStreamReader.java, java/io/InterruptedIOException.java, java/io/LineNumberInputStream.java, java/io/LineNumberReader.java, java/io/ObjectStreamException.java, java/io/OptionalDataException.java, java/io/OutputStream.java, java/io/OutputStreamWriter.java, java/io/PrintStream.java, java/io/PrintWriter.java, java/io/PushbackInputStream.java, java/io/PushbackReader.java, java/io/RandomAccessFile.java, java/io/Reader.java, java/io/SequenceInputStream.java, java/io/Serializable.java, java/io/StreamCorruptedException.java, java/io/StreamTokenizer.java, java/io/StringBufferInputStream.java, java/io/StringWriter.java, java/io/SyncFailedException.java, java/io/UTFDataFormatException.java, java/io/UnsupportedEncodingException.java, java/io/WriteAbortedException.java, java/io/Writer.java, java/lang/AbstractMethodError.java, java/lang/ArithmeticException.java, java/lang/ArrayIndexOutOfBoundsException.java, java/lang/ArrayStoreException.java, java/lang/AssertionError.java, java/lang/Boolean.java, java/lang/Byte.java, java/lang/ClassCastException.java, java/lang/ClassCircularityError.java, java/lang/ClassLoader.java, java/lang/ClassNotFoundException.java, java/lang/CloneNotSupportedException.java, java/lang/Cloneable.java, java/lang/Comparable.java, java/lang/Compiler.java, java/lang/Double.java, java/lang/Error.java, java/lang/Exception.java, java/lang/ExceptionInInitializerError.java, java/lang/Float.java, java/lang/IllegalAccessError.java, java/lang/IllegalAccessException.java, java/lang/IllegalArgumentException.java, java/lang/IllegalMonitorStateException.java, java/lang/IllegalStateException.java, java/lang/IllegalThreadStateException.java, java/lang/IncompatibleClassChangeError.java, java/lang/IndexOutOfBoundsException.java, java/lang/InheritableThreadLocal.java, java/lang/InstantiationError.java, java/lang/InstantiationException.java, java/lang/Integer.java, java/lang/InternalError.java, java/lang/InterruptedException.java, java/lang/LinkageError.java, java/lang/Long.java, java/lang/NegativeArraySizeException.java, java/lang/NoClassDefFoundError.java, java/lang/NoSuchFieldError.java, java/lang/NoSuchFieldException.java, java/lang/NoSuchMethodError.java, java/lang/NoSuchMethodException.java, java/lang/NullPointerException.java, java/lang/Number.java, java/lang/NumberFormatException.java, java/lang/OutOfMemoryError.java, java/lang/Process.java, java/lang/Runnable.java, java/lang/Runtime.java, java/lang/RuntimeException.java, java/lang/RuntimePermission.java, java/lang/SecurityException.java, java/lang/SecurityManager.java, java/lang/Short.java, java/lang/StackOverflowError.java, java/lang/StackTraceElement.java, java/lang/StringBuffer.java, java/lang/StringIndexOutOfBoundsException.java, java/lang/ThreadDeath.java, java/lang/ThreadGroup.java, java/lang/Throwable.java, java/lang/UnsatisfiedLinkError.java, java/lang/UnsupportedOperationException.java, java/lang/VerifyError.java, java/lang/VirtualMachineError.java, java/lang/reflect/AccessibleObject.java, java/lang/reflect/Array.java, java/lang/reflect/InvocationTargetException.java, java/lang/reflect/Member.java, java/lang/reflect/Modifier.java, java/lang/reflect/Proxy.java, java/lang/reflect/ReflectPermission.java, java/lang/reflect/UndeclaredThrowableException.java, java/math/BigInteger.java, java/nio/ByteBufferHelper.java, java/nio/channels/IllegalBlockingModeException.java, java/nio/charset/spi/CharsetProvider.java, java/security/AccessControlException.java, java/security/AllPermission.java, java/security/BasicPermission.java, java/security/DigestException.java, java/security/DigestInputStream.java, java/security/DigestOutputStream.java, java/security/GeneralSecurityException.java, java/security/Guard.java, java/security/GuardedObject.java, java/security/InvalidAlgorithmParameterException.java, java/security/InvalidKeyException.java, java/security/InvalidParameterException.java, java/security/Key.java, java/security/KeyException.java, java/security/KeyManagementException.java, java/security/KeyStoreException.java, java/security/MessageDigestSpi.java, java/security/NoSuchAlgorithmException.java, java/security/NoSuchProviderException.java, java/security/Permission.java, java/security/PermissionCollection.java, java/security/Permissions.java, java/security/Principal.java, java/security/PrivateKey.java, java/security/PrivilegedActionException.java, java/security/ProviderException.java, java/security/PublicKey.java, java/security/SecureRandom.java, java/security/SecureRandomSpi.java, java/security/SignatureException.java, java/security/SignatureSpi.java, java/security/SignedObject.java, java/security/Signer.java, java/security/UnrecoverableKeyException.java, java/security/UnresolvedPermission.java, java/security/acl/AclNotFoundException.java, java/security/acl/LastOwnerException.java, java/security/acl/NotOwnerException.java, java/security/cert/CertPath.java, java/security/cert/CertPathBuilderException.java, java/security/cert/CertPathValidatorException.java, java/security/cert/CertStoreException.java, java/text/BreakIterator.java, java/text/ChoiceFormat.java, java/text/CollationElementIterator.java, java/text/CollationKey.java, java/text/Collator.java, java/text/DateFormat.java, java/text/DateFormatSymbols.java, java/text/FieldPosition.java, java/text/Format.java, java/text/MessageFormat.java, java/text/ParseException.java, java/text/ParsePosition.java, java/text/StringCharacterIterator.java, java/util/AbstractCollection.java, java/util/AbstractList.java, java/util/AbstractMap.java, java/util/AbstractSequentialList.java, java/util/AbstractSet.java, java/util/ArrayList.java, java/util/Arrays.java, java/util/BitSet.java, java/util/Collection.java, java/util/Collections.java, java/util/Comparator.java, java/util/ConcurrentModificationException.java, java/util/EmptyStackException.java, java/util/Enumeration.java, java/util/EventListener.java, java/util/EventListenerProxy.java, java/util/EventObject.java, java/util/HashMap.java, java/util/HashSet.java, java/util/Hashtable.java, java/util/IdentityHashMap.java, java/util/Iterator.java, java/util/LinkedHashSet.java, java/util/LinkedList.java, java/util/List.java, java/util/ListIterator.java, java/util/ListResourceBundle.java, java/util/Map.java, java/util/MissingResourceException.java, java/util/NoSuchElementException.java, java/util/Observable.java, java/util/Observer.java, java/util/Properties.java, java/util/PropertyPermissionCollection.java, java/util/RandomAccess.java, java/util/Set.java, java/util/SortedMap.java, java/util/SortedSet.java, java/util/Stack.java, java/util/StringTokenizer.java, java/util/TooManyListenersException.java, java/util/TreeMap.java, java/util/TreeSet.java, java/util/Vector.java, java/util/logging/Level.java, java/util/prefs/BackingStoreException.java: Fixed @author tag all over.
* * java/util/AbstractCollection.java, java/util/AbstractList.java,Andrew John Hughes2004-08-171-5/+13
| | | | | | | | | | java/util/AbstractMap.java, java/util/AbstractSequentialList.java, java/util/ArrayList.java, java/util/Arrays.java, java/util/BitSet.java, java/util/Calendar.java, java/util/Collection.java, java/util/ListIterator.java, java/util/Map.java, java/util/SortedSet.java: Added additional exceptions to documentation, along with some additions and corrections.
* Add License clarificationMark Wielaard2002-01-221-5/+16
|
* * java/util/AbstractCollection.java (addAll): Use size of theBryce McKinlay2001-11-231-1/+1
| | | | correct collection for loop bound.
* * java/util/AbstractCollection.java (containsAll): Use size of theBryce McKinlay2001-11-231-1/+2
| | | | | | | correct collection for loop bound. * java/util/AbstractList.java (iterator.next): Increment pos after calling get on backing list. (listIterator.next): Likewise.
* 2001-10-25 Eric Blake <ebb9@email.byu.edu>Eric Blake2001-10-251-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/util/AbstractCollection.java (removeAllInternal), (retainAllInternal): Add hooks for use by ArrayList. * java/util/AbstractList.java: Minor code updates. Fix some scoping. * java/util/AbstractMap.java: ditto * java/util/ArrayList.java (readObject, writeObject): ditto (removeAllInternal, retainAllInternal): Optimize. * java/util/Arrays.java: ditto * java/util/Collections.java: ditto. Change order of parameters to equals(Object, Object) to match specs. * java/util/Dictionary.java: Improve javadoc. (Dictionary): Add explicit constructor. * java/util/HashMap.java: Improve javadoc. Rearrange methods to follow order in JDK. Cleanups related to recent code migration to AbstractMap. Fix some scoping. (entrySet): Cache the result. (modCount): Ensure that this is updated correctly. * java/util/HashSet.java: Improve javadoc. Fix some scoping. (init): Add hooks for LinkedHashSet. (map): Use "" instead of Boolean.TRUE in backing map. Use package-private API where possible for less overhead. (readObject, writeObject): Fix serialization. * java/util/Hashtable.java: Improve javadoc. Fix some scoping. (entrySet, keySet, values): Cache the result. (modCount): Ensure that this is updated correctly. (contains, remove): Fix NullPointer checking to match specs. (class Enumeration): Make more like HashIterator. * java/util/IdentityHashMap.java: Minor code updates. (modCount): Ensure that this is updated correctly. (readObject, writeObject): Fix serialization. * java/util/LinkedHashMap.java: Minor code updates. Cleanups related to recent code migration to AbstractMap. * java/util/LinkedHashSet.java: New file. * java/util/LinkedList.java: (readObject, writeObject): Fix serialization. * java/util/Makefile.am: List recently added files. * java/util/Stack.java: Minor code updates. * java/util/TreeMap.java: Improve javadoc. Overhaul the class to be more efficient. Fix some scoping. Rearrange the methods. (nil): Ensure that this can be thread-safe, and make it a static final. Initialize it to be more useful as a sentinal node. (Node): Specify color in constructor. (deleteFixup, insertFixup): Improve comments and algorithm. (fabricateTree): Redesign with less overhead. (lowestGreaterThan): Add parameter first to make SubMap easier. (removeNode): Patch hole where nil was being modified. Choose predecessor instead of successor so in-place swap works. (class VerifyResult, verifyTree, verifySub, verifyError): Remove this dead code after verifying the class works. (class SubMap): Rewrite several algorithms to avoid problems with comparing nil. * java/util/TreeSet.java: Improve javadoc. Fix some scoping. (clone): Fix ClassCastException when cloning subSet(). (readObject, writeObject): Fix serialization. * java/util/WeakHashMap.java: Improve javadoc. Fix some scoping. (NULL_KEY): Make it compare as null, for ease elsewhere. (Class WeakEntry): Rename from Entry, to avoid shadowing Map.Entry. Add missing toString. (modCount): Ensure that this is updated correctly. (clear, containsValue, keySet, putAll, values, WeakHashMap(Map)): Add missing methods and constructor.
* 2001-10-18 Eric Blake <ebb9@email.byu.edu>Eric Blake2001-10-191-118/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/util/AbstractCollection.java: Improve javadoc. (AbstractCollection()): Make constructor protected. (equals(Object, Object), hashCode(Object)): Add utility methods. * java/util/AbstractList.java: Improve javadoc. (AbstractList()): Make constructor protected. (indexOf(Object)): Call listIterator(), not listIterator(int). (iterator()): Follow Sun's requirement to not use listIterator(0). (listIterator(int)): Make AbstractListItr anonymous. (subList(int, int)): Add support for RandomAccess. (SubList.add(int, Object), SubList.remove(Object)): Fix bug with modCount tracking. (SubList.addAll(Collection)): Add missing method. (SubList.listIterator(int)): Fix bugs in indexing, modCount tracking. (class RandomAccessSubList): Add new class. * java/util/AbstractMap.java: Improve javadoc. (keys, values, KEYS, VALUES, ENTRIES): Consolidate common map fields. (AbstractMap()): Make constructor protected. (equals(Object, Object), hashCode(Object)): Add utility methods. (equals(Object)): Change algorithm to entrySet().equals(m.entrySet()), as documented by Sun. (keySet(), values()): Cache the collections. * java/util/AbstractSequentialList.java: Improve javadoc. (AbstractSequentialList()): Make constructor protected. * java/util/AbstractSet.java: Improve javadoc. (AbstractSet()): Make constructor protected. (removeAll(Collection)): Add missing method. * java/util/Arrays.java: Improve javadoc, rearrange method orders. (defaultComparator): Remove, in favor of Collections.compare(Object, Object, Comparator). (binarySearch, equals, sort): Fix natural order comparison of floats and doubles. Also improve Object comparison - when comparator is null, use natural order. (fill, sort): Add missing checks for IllegalArgumentException. (sort, qsort): Fix sorting bugs, rework the code for more legibility. (mergeSort): Inline into sort(Object[], int, int, Comparator). (class ArrayList): Rename from ListImpl, and make compatible with JDK serialization. Add methods which more efficiently override those of AbstractList. * java/util/Collections: Improve javadoc. (isSequential(List)): Add and use a method for deciding between RandomAccess and sequential algorithms on lists. (class Empty*, class Synchronized*, class Unmodifiable*): Make compliant with JDK serializability. (class Singleton*, class CopiesList, class RevereseComparator), (class UnmodifiableMap.UnmodifiableEntrySet), (class *RandomAccessList): New classes for serial compatibility. (class Empty*, class Singleton*, class CopiesList): Add methods which more efficiently override those of Abstract*. (search): Inline into binarySearch(List, Object, Comparator). (binarySearch): Make sequential search only do log(n) comparisons, instead of n. (copy(List, List)): Do bounds checking before starting. (indexOfSubList, lastIndexOfSubList, list, replaceAll, rotate), (swap): Add new JDK 1.4 methods. (binarySearch, max, min, sort): Allow null comparator to represent natural ordering. (reverse(List)): Avoid unnecessary swap. (shuffle(List, Random)): Do shuffle in-place for RandomAccess lists. (SingletonList.get): Fix logic bug. (SingletonMap.entrySet): Make the entry immutable, and cache the returned set. (SynchronizedCollection, SynchronizedMap, UnmodifiableCollection), (UnmodifiableMap): Detect null pointer in construction. (SynchronizedMap, UnmodifiableMap): Cache collection views. * java/util/BasicMapEntry: Improve javadoc.
* * java/util/HashMap.java: Rewritten.Bryce McKinlay2001-02-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/util/Hashtable.java: Rewritten based on new HashMap code. * java/util/TreeMap.java: Rewritten. * java/util/Bucket.java: Deleted. * java/util/BasicMapEntry.java: Remove unneccessary comments. (equals): Simplified. Made final. (getKey): Made final. (getValue): Likewise. (toString): New method. * java/util/Collections.java (search): Use a for-loop, not iterator hasNext(). (copy): Use a for-loop. Throw an IndexOutOfBoundsException if run out of elements in source. (max): Use a for-loop. (min): Ditto. (reverse): Keep track of positions instead of using Iterator's nextIndex() and previousIndex(). (shuffle(List)): Initialize defaultRandom if required using double-check thread safety idiom. Call two-argument shuffle method using defaultRandom. (defaultRandom): New field. (shuffle(List, Random)): Use a for-loop. Keep track of pos instead of using previousIndex() and nextIndex(). (singletonMap(iterator)): Use a HashMap.Entry, not BasicMapEntry. (ReverseComparator): New static class. (reverseOrder): Return static instance of ReverseComparator. * java/util/AbstractCollection.java (toString): Use a StringBuffer. * java/util/AbstractMap.java (toString): Use StringBuffer.
* 2000-10-29 Bryce McKinlay <bryce@albatross.co.nz>Bryce McKinlay2000-10-301-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/util/AbstractCollection.java (addAll): Use size() instead of hasNext() in iterator loop. (clear): Ditto. (contains): Ditto. Simplify loop. (containsAll): Ditto. (remove): Ditto. (removeAll): Ditto. (retainAll): Ditto. (toArray): Ditto. (toString): Ditto. Use string concatenation operators, not StringBuffer. * java/util/AbstractList.java (addAll): Use size() instead of hasNext() in iterator loop. (equals): Ditto. (hashCode): Ditto. (indexOf): Ditto. Don't take null check outside of the loop. (iterator): Return an AbstractListItr instead of anonymous class. (lastIndexOf): Use a for loop bounded by size() instead of hasPrevious() in iterator loop. (listIterator): Return an AbstractListItr. (removeRange): Remove bounds checking code and docs. (AbstractListItr): New inner class. Code moved here from listIterator(). (SubList.iterator): Removed. Use default implementation from AbstractList instead. (SubList.listIterator): As above. * java/util/AbstractMap.java (clear): Use a for loop bounded by size() instead of hasNext() in iterator loop. (containsValue): Ditto. (equals): Ditto. (get): Ditto. (put): Ditto. (putAll): Ditto. (remove): Ditto. (toString): Ditto. Use string concatenation operators, not StringBuffer. * java/util/AbstractSequentialList.java (addAll): Use a for loop bounded by size() instead of hasNext() in iterator loop. * java/util/AbstractSet.java (hashCode): Don't catch exception as part of normal execution flow. Do an explicit null check instead. * java/util/ArrayList.java (_iSize): Rename to `size'. (_arData): Rename to `data'. (get): Check lower bounds also. Simplify IndexOutOfBoundsException message. (remove): Ditto. (removeRange): Make protected. Don't check bounds. (add): Check lower bounds also. Simplify IndexOutOfBoundsException message. (addAll (Collection)): Use a size-bounded for loop instead of hasNext() check. (addAll (int, Collection)): Check lower bounds. Simplify exception string. (clone): Clone the data array too. (indexOf): Inline doesEqual(). (lastIndexOf): Ditto. (clear): Don't set array data to null. (set): Check lower bounds. Simplify exception string. (toArray): Correct comment. (trimToSize): Don't update modCount, this is not a structural change. Add comment.
* 2000-10-29 Bryce McKinlay <bryce@albatross.co.nz>Bryce McKinlay2000-10-301-98/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/util/AbstractCollection.java (addAll): Use size() instead of hasNext() in iterator loop. (clear): Ditto. (contains): Ditto. Simplify loop. (containsAll): Ditto. (remove): Ditto. (removeAll): Ditto. (retainAll): Ditto. (toArray): Ditto. (toString): Ditto. Use string concatenation operators, not StringBuffer. * java/util/AbstractList.java (addAll): Use size() instead of hasNext() in iterator loop. (equals): Ditto. (hashCode): Ditto. (indexOf): Ditto. Don't take null check outside of the loop. (iterator): Return an AbstractListItr instead of anonymous class. (lastIndexOf): Use a for loop bounded by size() instead of hasPrevious() in iterator loop. (listIterator): Return an AbstractListItr. (removeRange): Remove bounds checking code and docs. (AbstractListItr): New inner class. Code moved here from listIterator(). (SubList.iterator): Removed. Use default implementation from AbstractList instead. (SubList.listIterator): As above. * java/util/AbstractMap.java (clear): Use a for loop bounded by size() instead of hasNext() in iterator loop. (containsValue): Ditto. (equals): Ditto. (get): Ditto. (put): Ditto. (putAll): Ditto. (remove): Ditto. (toString): Ditto. Use string concatenation operators, not StringBuffer. * java/util/AbstractSequentialList.java (addAll): Use a for loop bounded by size() instead of hasNext() in iterator loop. * java/util/AbstractSet.java (hashCode): Don't catch exception as part of normal execution flow. Do an explicit null check instead. * java/util/ArrayList.java (_iSize): Rename to `size'. (_arData): Rename to `data'. (get): Check lower bounds also. Simplify IndexOutOfBoundsException message. (remove): Ditto. (removeRange): Make protected. Don't check bounds. (add): Check lower bounds also. Simplify IndexOutOfBoundsException message. (addAll (Collection)): Use a size-bounded for loop instead of hasNext() check. (addAll (int, Collection)): Check lower bounds. Simplify exception string. (clone): Clone the data array too. (indexOf): Inline doesEqual(). (lastIndexOf): Ditto. (clear): Don't set array data to null. (set): Check lower bounds. Simplify exception string. (toArray): Correct comment. (trimToSize): Don't update modCount, this is not a structural change. Add comment. * java/util/BitSet.java: Merged with classpath, new JDK 1.2 methods implemented. (toString): Declare `bit' as long, not int. (data): Made package-private, not private.
* 2000-10-26 Bryce McKinlay <bryce@albatross.co.nz>Bryce McKinlay2000-10-261-18/+18
| | | | | * java/util/*.java: Fix indentation on copyright notices. * java/util/jar/*.java: Ditto.
* 2000-10-24 Bryce McKinlay <bryce@albatross.co.nz>Bryce McKinlay2000-10-241-95/+135
| | | | | | * java/util/*.java: Reformat all to unofficial standard coding style. No changes of substance. * java/util/jar/*.java: Ditto.
* Change license to libgcc-like terms.Paul Fisher2000-03-151-18/+26
| | | | Update copyright lines to contain correct years.
* Fully qualified references to UnsupportedOperationException to pleaseAaron M. Renn1998-12-191-1/+1
| | | | JavaDeps
* [one commit for multiple Collections files] Several fixes for completeness,Stuart Ballard1998-11-091-36/+42
| | | | | | updating to beta4 spec (with some RC1 enhancements too), and more doc comments. Note that all changes are untested because my time availability is nil, but they shouldn't be far from working.
* Initial version. Many doc comments missing, some functionality missing.Stuart Ballard1998-06-261-0/+325