* java/util/zip/ZipFile.java (readLeShort): Take and use DataInput as
argument.
(readLeShort): Likewise and use byte[].
(readLeInt): Likewise.
(readEntries): Use new versions of methods and use byte[] for reading
a complete zip entry. Add ZipFile name to exceptions.
(entries): Add ZipFile name to exceptions.
(getEntry): Likewise.
(checkLocalHeader): Use new versions of methods and add ZipFile name
to exceptions.
From-SVN: r58697
2002-09-25 Jesse Rosenstock <jmr@ugcs.caltech.edu>
Fix for PR libgcj/7766:
* java/util/zip/ZipInputStream.java (entryAtEOF): New field.
(getNextEntry): Set it.
(closeEntry): Likewise.
(read): Likewise.
(close): Likewise.
(available): Use it.
From-SVN: r57513
Fix for PR libgcj/6576:
* java/util/ResourceBundle.java (tryBundle): Cache `null' if we
didn't find a given bundle.
(getBundle): Don't require base bundle.
(setParent): Removed old comment.
(tryLocalBundle): Try components even if preceding components were
empty.
From-SVN: r57442
* java/util/zip/InflaterInputStream.java (read): Loop if data has
been read but none output by inflater.
* java/util/zip/natDeflater.cc (reset): Set is_finished.
* java/util/zip/natInflater.cc (reset): Set dist_needed and
is_finished.
* java/util/zip/ZipOutputStream.java: Replaced with Classpath
version.
* java/util/zip/ZipFile.java: Replaced with Classpath version.
* java/util/zip/ZipEntry.java: Replaced with Classpath version.
* java/util/zip/ZipInputStream.java: Replaced with Classpath
version.
* java/util/zip/ZipConstants.java: Replaced with Classpath version.
From-SVN: r54653
* java/lang/natRuntime.cc: Don't include sys/time.h and time.h.
* java/util/natTimeZone.cc: Include sys/time.h and time.h here.
Include platform.h.
From-SVN: r53443
Fixes PR libgcj/6389:
* Makefile.in: Rebuilt.
* Makefile.am (nat_source_files): Added natTimeZone.cc.
* java/util/natTimeZone.cc: New file.
* java/util/TimeZone.java (getDefaultTimeZoneId): New method.
* java/lang/System.java: Merged with Classpath.
* java/lang/Runtime.java: Merged with Classpath.
* java/lang/natSystem.cc (setErr0): Renamed from setErr; don't run
security check.
(setIn0): Renamed from setIn; don't run security check.
(setOut0): Renamed from setOut; don't run security check.
(file_encoding, getpwuid_adaptor, getSystemTimeZone,
init_properties): Moved to natRuntime.cc.
Moved many includes to natRuntime.cc.
(isWordsBigEndian): New method.
* java/lang/natRuntime.cc: Include Long.h, also other includes
previously in natSystem.cc.
(maxMemory): New function.
(exitInternal): Renamed from `_exit'.
(exit): Removed.
(init): Don't set finalize_on_exit.
(exitInternal): Use `finalizeOnExit'.
(file_encoding, getpwuid_adaptor): New functions from
natSystem.cc.
(insertSystemProperties): New method, renamed from
System::init_properties. Don't set user.timezone.
(_load): Don't call checkLink.
(execInternal): New method.
(availableProcessors): Likewise.
(nativeGetLibname): Likewise.
From-SVN: r53429
* java/util/ArrayList.java (addAll(int,Collection)): System.arraycopy
all of the remaining elements.
* java/util/Vector.java (addAll(int,Collection)): Likewise.
(removeRange): If toIndex == fromIndex do
nothing, if toIndex < fromIndex throw IndexOutIfBoundsException.
(removeAll): Always throw NullPointerException when collection is
null.
(retrainAll): Likewise.
From-SVN: r51979
2002-02-14 Mark Wielaard <mark@klomp.org>
* java/math/BigInteger.java: import gnu.java.math.MPN not the whole
package as a workaround for gcj 3.0.x
2002-02-14 Mark Wielaard <mark@klomp.org>
* java/security/BasicPermission.java: extends with fully qualified
classname as workaround for gcj 3.0.4.
2002-02-14 Eric Blake <ebb9@email.byu.edu>
* java/net/DatagramSocketImpl.java (setOption, getOption): Work
around gcj bug of wrong emitted qualifier for inherited method.
* java/net/SocketImpl.java (setOption, getOption): Ditto.
* java/util/WeakHashMap.java (WeakEntrySet): Add non-private
constructor to reduce amount of emitted bytecode. While this
happens to work around a jikes 1.15 bug, it is still a useful
patch even for correct compilers.
* java/rmi/server/RMIClassLoader.java (MyClassLoader): Ditto.
* gnu/java/rmi/server/UnicastRemoteCall.java
(DummyObjectOutputStream, DummyObjectInputStream): Ditto.
2002-02-14 Eric Blake <ebb9@email.byu.edu>
* java/net/DatagramSocketImpl.java: Reformat (no code changes).
* java/net/SocketImpl.java: Ditto.
* java/rmi/server/RMIClassLoader.java: Ditto.
* gnu/java/rmi/server/UnicastRemoteCall.java: Ditto.
2002-02-14 Mark Wielaard <mark@klomp.org>
Thanks to Takashi Okamoto
* java/util/Arrays.java (ArrayList.indexOf()): this.equals().
* java/util/Arrays.java (ArrayList.lastIndexOf()): Likewise.
* java/util/WeakHashMap.java (WeakEntry.getEntry()): this.get().
From-SVN: r49778
2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/BitSet.java (and): Fix off-by-one bug, don't skip part of
the bitset.
(andNot): Likewise.
(xor): Likewise.
2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/LinkedList.java (LinkedListItr.add): Don't skip the next
entry.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* java/util/TreeMap.java (removeNode): Fix bug in node removal.
2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/AbstractCollection.java (containsAll): Use size of the
correct collection for loop bound.
* java/util/AbstractList.java (iterator.next): Increment pos after
calling get on backing list.
(listIterator.next): Likewise.
* java/util/LinkedList.java (addLastEntry): Don't increment size before
checking for size == 0.
(addFirstEntry): Rearrange to match addLastEntry.
(add): Do not increment size before inserting the new entry.
* java/util/AbstractCollection.java (addAll): Use size of the
correct collection for loop bound.
2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/AbstractSet.java (removeAll): Fix scoping thinko.
* java/util/HashMap.java (putAllInternal): Set size here.
* java/util/Hashtable.java (putAllInternal): New method. Copy contents
of a map efficiently without calling put() or putAll().
(Hashtable (map)): Use putAllInternal.
(clone): Likewise.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* java/util/Collections.java:
* java/util/Vector.java:
* java/util/WeakHashMap.java: Fix spelling errors.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* 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-12-15 Eric Blake <ebb9@email.byu.edu>
* java/util/ArrayList.java (checkBoundExclusive),
(checkBoundInclusive): Rename from range??clusive, to match
AbstractList.
* java/util/LinkedList.java (checkBoundsExclusive),
(checkBoundsInclusive): ditto
* java/util/Vector.java (checkBoundExclusive),
(checkBoundInclusive): Move bounds checking into common methods.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* 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.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* java/util/BitSet.java: Improve javadoc.
(cardinality(), clear(), clear(int, int), flip(int)),
(flip(int, int), get(int, int), intersects(BitSet), isEmpty()),
(nextClearBit(int), nextSetBit(int), set(int, boolean)),
(set(int, int), set(int, int, boolean)): Add new JDK 1.4 methods.
(clone): Fix so subclasses clone correctly.
2001-12-15 Eric Blake <ebb9@email.byu.edu>
* 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.
From-SVN: r48035
* java/util/Timer.java (TaskQueue.isStopped): Remove method.
(Scheduler.run): Try to re-schedule task and ignore exception if
queue has been stopped.
From-SVN: r47093
* java/lang/Double.java (parseDouble): Fixed ordering of
modifiers.
* java/lang/reflect/AccessibleObject.java: Javadoc, reindented.
* java/lang/reflect/Member.java: Reindented.
* java/lang/reflect/Modifier.java: Reindented.
(toString): Only trim trailing space if text was added to
StringBuffer.
* java/util/ConcurrentModificationException.java: Javadoc
updates.
* java/util/EmptyStackException.java: Likewise.
* java/util/NoSuchElementException.java: Likewise.
From-SVN: r47018
Fix for PR libgcj/4859:
* java/util/Timer.java (TaskQueue.isStopped): New method.
(Scheduler.run): Don't re-schedule task if queue has been
stopped.
From-SVN: r46994
2001-11-02 Hans Boehm <Hans_Boehm@hp.com>
* java/util/natResourceBundle.cc:getClassContext: return
array of Class instead of array of ClassLoader.
From-SVN: r46727
* java/util/PropertyResourceBundle.java (handleGetObject): Now
public.
* java/util/ListResourceBundle.java (handleGetObject): Now public
and final, per spec.
From-SVN: r46452
* java/util/IdentityHashMap.java (containsKey): Use getHash.
(get): Likewise.
(put): Likewise.
(remove): Likewise.
(getHash): New method.
(tombstone, emptyslot): Now static final.
(put): Correctly determine when to rehash, and correctly rehash.
(containsKey, remove): Test against table length with `>='.
From-SVN: r45841
* java/util/Hashtable.java (Enumerator): Ensure that if
hasMoreElements() returns true, nextElement() will always return
something even if the table has been modified.
From-SVN: r45584
* jni.cc: Include IdentityHashMap.h, not Hashtable.h.
(local_ref_table, global_ref_table): Now IdentityHashMap.
(_Jv_JNI_Init): Updated for new types.
(mark_for_gc): Likewise.
(unmark_for_gc): Likewise.
* gcj/javaprims.h: Rebuilt class list.
* Makefile.in: Rebuilt.
* Makefile.am (core_java_source_files): Added new file.
* java/util/IdentityHashMap.java: New file.
From-SVN: r44929
* java/util/Calendar.java (set): Never recompute fields here. They
will already be set if someone set time explicitly, and it can cause
problems to do so. Don't invalidate AM_PM setting if HOUR is set.
* java/util/GregorianCalendar.java (computeTime): Don't ignore an
HOUR setting if AM_PM is set. Don't try to ensure the HOUR value is
sane.
* java/text/SimpleDateFormat.java (defaultCentury): New field.
(readObject): Call set2DigitYearStart if appropriate so that
defaultCentury is calculated.
(SimpleDateFormat): Don't bother clearing calendar here. Call
computeCenturyStart().
(set2DigitYearStart): Calculate and set defaultCentury.
(format): Don't clone the calendar. Use "calendar" not "theCalendar"
everywhere.
(parse): Likewise. If the pattern is "y" or "yy" and it found exactly
2 numeric digits, use the 80-20 heuristic to parse the value into a
default century based on defaultCenturyStart.
(computeCenturyStart): Rewritten. Call set2DigitYearStart().
From-SVN: r44395
2001-05-10 Tom Tromey <tromey@redhat.com>
* java/util/GregorianCalendar.java: Imported from Classpath.
* gnu/java/locale/LocaleInformation_nl.java: New file from
Classpath.
* gnu/java/locale/LocaleInformation_en.java: Likewise.
* gnu/java/locale/LocaleInformation_de.java: Likewise.
* gnu/java/locale/LocaleInformation.java: Likewise.
* natGregorianCalendar.cc: Removed.
* Makefile.in: Rebuilt.
* Makefile.am (nat_source_files): Removed
natGregorianCalendar.cc.
2001-05-10 Tom Tromey <tromey@redhat.com>
* java/text/SimpleDateFormat.java (computeCenturyStart): New
method.
(defaultCenturyStart): Use it.
(readObject): Likewise.
(SimpleDateFormat): Clear the calendar. Set the grouping on the
number format.
(parse): Copy the calendar before modifying it. Correctly handle
the time zone.
* java/util/Calendar.java (clear): Set field value(s) to 0.
2001-05-10 Jeff Sturm <jsturm@one-point.com>
* Calendar.java (get): Clear areFieldsSet if requested field
is not set.
(set): Unset fields that depend on new value.
From-SVN: r41942
* DeflaterOutputStream.java (deflate): Loop while def.needsInput.
(finish): def.deflate needs to be called in a loop.
(inbuf, inbufLength): New private fields.
(write(int)): Use inbuf.
(write(byte[],int,int): Check if pending output in inbuf.
* ZipOutputStream.java: Don't use Deflater if stored.
Use a Checksum object directly, not via a CheckedOutputStream.
(uncompressed_size): New field,
(closeEntry): Only write data_directory if needed.
(write): If STORED, write directly.
Always update crc, and uncompressed_size.
(write_entry): Fix lots of protocol erors.
From-SVN: r40988
2001-03-24 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/HashMap.java (HashMap): If 0 is given for initialCapacity
paramater, bump it to 1.
* java/util/Hashtable.java (Hashtable): Likewise.
From-SVN: r40812
* java/util/ArrayList.java: Remove RCS keywords from comments
* java/util/BasicMapEntry.java: idem
* java/util/Dictionary.java: idem
* java/util/HashSet.java: idem
* java/util/EventObject.java: reindent
* java/util/Properties.java: idem
* java/util/SortedMap.java: idem
* java/util/Enumeration.java: Merge with Classpath
* java/util/EventListener.java: idem
* java/util/Observable.java: idem
* java/util/Observer.java: idem
* java/util/Stack.java: idem
From-SVN: r40639
2001-03-06 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/TreeSet.java (writeObject): Use a for-loop instead of
Iterator.hasNext().
2001-03-05 Jochen Hoenicke <jochen@gnu.org>
* java/util/TreeMap.java (writeObject): Use defaultWriteObject()
instead of the new JDK1.2 API. This is simpler and makes
back-porting the classes to JDK1.1 trivial.
(readObject): likewise.
From-SVN: r40252
* java/lang/natClass.cc (getSignature): Don't try to dereference
param_types if it is null. Instead, take this to mean "no parameters".
* java/lang/TreeMap.java (TreeIterator.next): Throw
NoSuchElementException in preference to
ConcurrentModificationException.
(TreeIterator.remove): Throw IllegalStateException in preference to
ConcurrentModificationException.
(SubMap.firstKey): Do a better check for empty SubMap, and if it is,
throw a NoSuchElementException.
(SubMap.lastKey): Likewise.
From-SVN: r39658
* java/util/TreeMap.java: New file.
* java/util/TreeSet.java: New file.
* Makefile.am: Add TreeMap and TreeSet. Enable WeakHashMap.
* Makefile.in: Rebuilt.
* java/util/HashSet.java (clone): Use constructor instead of calling
clone on itself.
* java/util/SortedSet.java: Sync with classpath.
* java/util/HashMap.java (hash): Use if statement instead of ternary,
for clarity.
Resolves PR libgcj/1758.
Resolves PR java/1684.
From-SVN: r39657
* java/util/Arrays.java: Removed "cmp" methods.
(qsort): Don't use "cmp".
(med3): Likewise.
2001-02-07 Mark Benvenuto <mcb54@columbia.edu>
* java/util/Arrays.java (qsort): Handle N value of 7 with insertion
sort. Fix for PR java/1895.
From-SVN: r39514
Fix for PR libgcj/1358:
* java/lang/System.java: Update Copyright date properly.
* java/util/Calendar.java: Fix typo in comment.
(set): Set 24-hour clock hour instead of 12-hour clock hour.
* java/util/GregorianCalendar.java (GregorianCalendar): Properly
initialize times. Spec says to set H:M:S values to zero only if
a date is given.
* java/util/TimeZone.java (getDefaultDisplayName): Casts to char
needed for evaluating numbers '0' to '9' in printouts of GMT offsets.
* java/util/natGregorianCalendar.cc (computeTime): Properly handle
timezones and GMT offsets, being careful to account for units of
milliseconds vs. seconds.
From-SVN: r38508
* java/util/BasicMapEntry.java: Re-added.
* java/util/HashMap.java (Entry): Extend BasicMapEntry.
(putAll): Test for BasicMapEntry.
* java/util/Hashtable.java (Entry): Extend BasicMapEntry.
(putAll): Test for BasicMapEntry.
Change references from `HashMap.Entry' to `Entry' in various places.
* Makefile.am: Add BasicMapEntry.java.
* Makefile.in: Rebuilt.
From-SVN: r38410
* java/util/GregorianCalendar.java (GregorianCalendar): Constructors
need to set timezone to a valid non-null value. Partial fix for
PR 331.
From-SVN: r38375
* java/util/ArrayList.java (data): Declare transient.
(serialPersistantFields): Removed.
(readObject): Use defaultReadObject(), not readFields().
(writeObject): Use defaultWriteObject(), not writeFields().
From-SVN: r38328
2000-12-17 Jeff Sturm <jeff.sturm@commerceone.com>
* java/util/Hashtable.java (put): Remove `last' variable.
Link new entry to head of list.
* java/util/HashMap.java (put): Ditto.
From-SVN: r38325
* Makefile.am: Add HashSet.java and java/lang/ref classes.
Remove BasicMapEntry.java and Bucket.java.
* Makefile.in: Rebuilt.
* java/util/HashMap.java: Rewritten.
* java/util/HashSet.java: Imported from classpath.
* java/util/WeakHashMap.java: Imported from classpath.
* java/util/Hashtable.java: Rewritten based on new HashMap code.
* java/util/Bucket.java: Deleted.
* java/util/BasicMapEntry.java: Deleted.
* 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.
* java/util/AbstractCollection.java (toString): Use a StringBuffer.
* java/util/AbstractMap.java (toString): Use StringBuffer.
* java/lang/ref/PhantomReference.java: Imported from classpath.
* java/lang/ref/SoftReference.java: Ditto.
* java/lang/ref/Reference.java: Ditto.
* java/lang/ref/WeakReference.java: Ditto.
* java/lang/ref/ReferenceQueue.java: Ditto.
From-SVN: r38183
* java/text/Collator.java (decomposeCharacter, decmp, strength):
Now package-private, not protected.
* java/text/DateFormatSymbols.java (equals): Now private.
* java/text/DecimalFormatSymbols.java (safeGetChar): Now private.
* java/util/BitSet.java: Class no longer final.
* java/util/Set.java (toArray(Object[])): New method.
From-SVN: r38075
* java/io/FilePermission.java: Made class final per spec.
* java/text/DecimalFormatSymbols.java (setCurrencySymbol): Changed
method name to match spec (fixed typo).
* java/util/LinkedList.java: Implements List.
From-SVN: r37993
* java/util/LinkedList.java (removeFirst): Update `first' field.
Handle the last == first case.
(removeLast): Update `last' field. Handle the last == first case.
From-SVN: r37940
* java/util/zip/InflaterInputStream (read): Don't return -1 unless
the infate() call didn't deliver any output. Throw a ZipException if
the needsDictionary() call returns true.
* java/io/ByteArrayInputStream (read): Remove redundant bounds checks.
* java/io/InputStreamReader: Use the default buffer size for the
contained BufferedInputStream.
From-SVN: r37846
2000-11-27 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/Vector.java (ensureCapacity): Don't increment modCount.
(addElement): Don't increment elementCount twice. Doh.
* java/util/ArrayList.java (add): Only call ensureCapacity if the
array needs to be expanded.
(addAll): Ditto.
* java/util/Collections.java (UnmodifiableCollection): Implement
toString().
(UnmodifiableList): Throw UnsupportedOperationException from
modification methods. Set `l' from the one-parameter constructor.
(UnmodifiableMap): Implement toString().
(SynchronizedCollection): Ditto.
(SynchronizedList): Set `l' from the one-parameter constructor.
(SynchronizedSortedSet): Set `ss' from the one-parameter constructor.
(SynchronizedMap): Implement toString().
From-SVN: r37785
2000-11-23 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/Vector.java: Improve exception messages.
(Vector): Check initialCapacity for IllegalArgumentException.
(tromToSize): Don't check for elementCount == elementData.length
case.
(toArray): Don't try to set null marker if target array is the same
length as the vector.
From-SVN: r37685
Merge with Classpath (changes by Bryce McKinlay)
* java/util/jar/*.java: Reformat all to unofficial standard coding
style. No changes of substance.
From-SVN: r37538
2000-11-02 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/AbstractList.java (remove): Comment out modCount
increment to work around compiler bug.
(add): Ditto.
From-SVN: r37204
2000-11-02 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/AbstractList.java: Throw messages with
IndexOutOfBoundsExceptions.
(listIterator()): Call listIterator(0).
(size): New field. Initialize to size().
(hasNext): Test position against size, not size().
(remove): Increment knownMod by one instead of resetting it from
modCount.
(add): Ditto.
(SubList.upMod): Removed.
(SubList.set): Don't call upMod() or update knownMod.
(SubList.add(int,Object)): Increment modCount instead of calling
upMod().
(SubList.remove): Ditto.
(SubList.addAll): Don't call backingList.size(). Increment size from
c.size().
(SubList.iterator): New method. Call listIterator(0).
(SubList.listIterator): New method. Restore code to return an
anonymous listIterator implementation (with some changes).
* java/util/AbstractSequentialList.java: Throw messages with
IndexOutOfBoundsExceptions.
(addAll): Add a specnote.
* java/util/ArrayList.java (removeRange): Get the math right.
(addAll): Increment modCount _before_ creating iterator.
* java/util/LinkedList.java: Rewritten, mostly.
From-SVN: r37203
2000-10-29 Bryce McKinlay <bryce@albatross.co.nz>
* 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.
From-SVN: r37116
* Makefile.am: Added locale files from Classpath.
* Makefile.in: Rebuilt.
* gnu/java/locale/Calendar.java: New file.
* gnu/java/locale/Calendar_de.java: New file.
* gnu/java/locale/Calendar_en.java: New file.
* gnu/java/locale/Calendar_nl.java: New file.
* java/lang/ClassNotFoundException.java: Replaced with Classpath file.
* java/math/BigDecimal.java (intVal): Renamed from 'num' for
serialization compatibility.
(scale): Made private.
(serialVersionUID): New field.
* java/math/BigInteger.java (ival): Made transient.
(words): Made transient.
(bitCount): New serialization field.
(bitLength): Ditto.
(firstNonzeroByteNum): Ditto.
(lowestSetBit): Ditto.
(magnitude): Ditto.
(signum): Ditto.
(serialVersionUID): New field.
(readObject): New method.
(writeObject): New method.
* java/util/BitSet.java (serialVersionUID): New field.
* java/util/Calendar.java: Replaced with Classpath file.
* java/util/GregorianCalendar.java (GregorianCalendar): Pass result
of getDefault() for TimeZone or Locale instead of passing nulls.
* java/util/Locale.java (serialVersionUID): New field.
(writeObject): New method.
(readObject): New method.
* java/util/SimpleTimeZone.java: Replaced with Classpath file.
Serialization mods.
From-SVN: r37080
* Makefile.am: Removed java/io/Replaceable.java and
java/io/Resolvable.java.
* Makefile.in: Rebuilt.
* gcj/javaprims.h: Removed Replaceable and Resolvable from java.io
namespace.
* java/io/ObjectInputStream.java (processResolution): Fixed typo
in method name.
(processResolution): Handle readResolve method via reflection with
removal of Resolvable interface.
* java/io/ObjectOutputStream.java (writeObject): Handle writeReplace
method via reflection with removal of Replaceable interface.
* java/io/Replaceable.java: Removed.
* java/io/Resolvable.java: Removed.
* java/security/Key.java (serialVersionUID): New field.
* java/security/Provider.java (serialVersionUID): New field.
* java/security/interfaces/DSAPrivateKey.java (serialVersionUID):
New field.
* java/security/interfaces/DSAPublicKey.java (serialVersionUID):
New field.
* java/sql/DataTruncation.java (serialVersionUID): New field.
* java/sql/SQLException.java (serialVersionUID): New field.
* java/sql/SQLWarning.java (serialVersionUID): New field.
* java/util/Date.java (serialVersionUID): New field.
(millis): Made transient.
(readObject): New method.
(writeObject): New method.
Serialization mods.
Note: The interfaces java.io.Replaceable and java.io.Resolvable were only
temporary additions to JDK 1.2 beta versions and were not included
in the JDK 1.2 final. The Serialization spec instructs how to deal
with their methods (via reflection).
From-SVN: r36736
* java/util/zip/ZipFile.java: Implement OPEN_DELETE mode, new constructor,
close can delete the file, finalize calls close.
* java/util/jar/JarFile.java: Constructor that takes mode now calls super.
From-SVN: r36007
2000-08-20 Mark Wielaard <mark@klomp.org>
* java/util/zip/Adler32.java: Make private variables really private
* java/util/zip/CRC32.java: Make private variables really private
* java/util/zip/CheckedInputStream.java: skip() could skip to much bytes
* java/util/zip/InflaterInputStream.java: skip() could skip to much bytes
* java/util/zip/ZipEntry.java: setCompressedSize() didn't check input
* java/util/zip/ZipFile.java: size() new 1.2 method
* java/util/zip/ZipInputStream.java: Use createZipEntry not new ZipEntry.
since 1.2 available() always returns just 1 or 0 when closed
From-SVN: r35826
Sun Aug 20 09:51:48 2000 Anthony Green <green@redhat.com>
* java/net/URLClassLoader.java: Find the JarEntry via the JarFile.
* java/net/JarURLConnection.java: getEntry doesn't take any
arguments. Return null if element is null.
* java/util/zip/ZipFile.java (getInputStream): Read the compressed
size from the archive, not the inflated size.
* java/util/jar/JarFile.java (getEntry): Don't recurse. Call
java.util.zip.ZipFile.getEntry.
* gij.cc (help): Change sourceware reference to
sources.redhat.com.
From-SVN: r35821
2000-04-08 Anthony Green <green@redhat.com>
* java/lang/natObject.cc (_Jv_MonitorEnter): Only perform null
check when we have to.
* gcj/array.h: Mark elements(JArray<T>& x) and elements(JArray<T>*
x) as `inline'.
* java/util/StringTokenizer.java: Minor optimization. Eliminates
one method call.
* java/util/Vector.java (VectorEnumeration.nextElement): Manually
inline hasMoreElements.
From-SVN: r33033
* All files: Updated copyright information.
* COPYING: New file.
* COPYING.LIB: Removed.
* LIBGCJ_LICENSE: We now use GPL + special exception.
From-SVN: r32387
2000-02-28 Mo DeJong <mdejong@cygnus.com>
* java/util/zip/ZipOutputStream.java(closeEntry) : Fixed
error caused by the incorrect casting of a long to an int.
From-SVN: r32257
2000-02-28 Mo DeJong <mdejong@cygnus.com>
* java/util/zip/ZipOutputStream.java(write_entry) : Fixed
SIGSEV caused by use of the wrong instance variable.
From-SVN: r32256
* java/util/Calendar.java (toString): New method.
* java/util/SimpleTimeZone.java (clone): New method.
(toString): New method.
* java/util/TimeZone.java (clone): New method.
* java/text/SimpleDateFormat.java (clone): New method.
* java/text/NumberFormat.java (clone): New method.
(equals): New method.
* java/text/Format.java (clone): New method.
* java/text/DateFormatSymbols.java (DateFormatSymbols): New
constructor.
(clone): New method.
* java/text/DateFormat.java (clone): New method.
* java/text/Collator.java (clone): New method.
From-SVN: r31775
* java/lang/ClassLoader.java (getSystemResource): Use
getSystemClassLoader instead of ClassLoader.system.
(getSystemResourceAsStream): Ditto.
* java/lang/natClassLoader.cc (redirect): Make static and
remove #ifdef INTERPRETER so it is always defined.
(getVMClassLoader0): Remove #ifdef INTERPRETER so it always
returns a VMClassLoader.
* java/util/ResourceBundle.java (trySomeGetBundle): Create a
PropertyResourceBundle if a properties file is found before a
ResourceBundle class.
From-SVN: r30048
* configure: Rebuilt.
* configure.in: Build include/Makefile.
* Makefile.in: Rebuilt.
* Makefile.am (SUBDIRS): Added gcj and include.
(install-data-local): New target.
(extra_headers): New macro.
* include/Makefile.in: New file.
* include/Makefile.am: New file.
* interpret.cc: Don't include gcj/field.h or gcj/cni.h.
* java/lang/reflect/natField.cc: Don't include gcj/field.h or
gcj/cni.h.
* boehm.cc: Don't include java-threads.h or gcj/field.h.
* resolve.cc: Include config.h.
* defineclass.cc: Include config.h.
* include/java-interp.h: Don't include config.h.
* include/jvm.h: Include java-threads.h, Object.h, java-gc.h,
cni.h.
* gcj/javaprims.h: Regenerated namespace decls.
* classes.pl (scan): Don't put `;' after closing brace.
* Makefile.in: Rebuilt.
* Makefile.am (INCLUDES): Added -I for top_srcdir.
* configure.in: Create gcj/Makefile.
* gcj/Makefile.in: New file.
* gcj/Makefile.am: New file.
* java/lang/Object.h: Don't include any other headers.
* gcj/array.h: Renamed from include/java-array.h.
* gcj/field.h: Renamed from include/java-field.h.
* gcj/method.h: Renamed from include/java-method.h.
* gcj/cni.h, gcj/javaprims.h: Moved from include/.
Updated all files to reflect new include structure.
From-SVN: r29278
* java/lang/natSystem.cc (getpwuid_adaptor): New overloaded
function that detects the signature of getpwuid_r.
(init_properties): Use it.
* java/util/natDate.cc (ctime_adaptor): Likewise for ctime_r.
(toString): Use it.
From-SVN: r28790
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed
from _Jv_InternClassStrings.
* prims.cc (_Jv_RunMain): New function.
(JvRunMain): Remove gij-support.
* gij.cc (main): Use _Jv_RunMain.
* java/util/zip/ZipFile.java: Call readDirectory in constructor.
* interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store
argument in temp variable.
(continue1): For all op_x2y insns, use temp variable for
intermediate value. Also remove some comments.
* java/lang/natClass.cc (newInstance): Call _Jv_InitClass.
(forName): Don't call _Jv_InitClass.
* java/lang/Class.java (getResource,getResourceAsStream): Implement.
* java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor.
* java/util/jar/JarInputStream.java: New file.
* java/util/jar/JarEntry.java: New file.
* java/util/jar/JarFile.java: New file.
* java/net/URLClassLoader.java: New file.
* java/net/JarURLConnection.java: New file.
* gnu/gcj/protocol/jar/Handler.java: New file.
* gnu/gcj/protocol/jar/Connection.java: New file.
* java/security/SecureClassLoader.java: New file.
* java/lang/ClassLoader.java (parent): New variable.
(ClassLoader (ClassLoader)): new constructor.
(findClass): New method.
(loadClass): Add default 1.2 implementation.
(getSystemResourceAsBytes, getResourceAsBytes): Removed.
(readfully): Removed.
* gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang.
(findSystemClass): New method.
(VMClassLoader): Constructor rewritten.
(init): New method.
All other methods removed.
* java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader
to gnu::gcj::runtime::VMClassLoader.
(_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry. Also handle
class entries.
(VMClassLoader::findSystemClass): renamed from findBootClass.
* Makefile.am: Add new files.
(FirstThread.h, ThreadGroup.h): Add _Jv_Main friend.
* Makefile.in: Rebuilt.
From-SVN: r28748
* java/net/DatagramSocketImpl.java (localPort): Fixed typo to match JDK.
* java/net/natPlainDatagramSocketImpl.cc (bind): ditto.
* java/text/ChoiceFormat.java (nextDouble(double, boolean)): Method
is not final per JDK.
* java/util/PropertyResourceBundle.java (handleGetObject): Method is
public per JDK.
* java/util/zip/DataFormatException.java: Class extends Exception.
* java/util/zip/Deflater.java (finalize): Method is protected per JDK.
* java/util/zip/ZipEntry.java: Class implements ZipConstants.
* java/util/zip/ZipInputStream.java: ditto.
(closeEntry): Changed method name to match JDK spec.
From-SVN: r27717
* java/util/zip/ZipInputStream.java (fill): New method.
(compressed_len): New instance variable.
(getNextStream): Set it.
(read): Reset inflater on EOF. Only read via `super' if entry is
deflated.
(skip): Only skip via `super' if entry is deflated.
* java/util/zip/Deflater.java (last_input_count): Removed.
* java/util/zip/natDeflater.cc (deflate): Return 0 if input array
is length 0.
(needsInput): Don't use last_input_count.
(setInput): Don't set last_input_count.
* java/util/zip/natInflater.cc (getRemaining): Return correct
result.
(inflate): Return 0 if input array is length 0.
(setInput): Don't set last_input_count.
* java/util/zip/Inflater.java (last_input_count): Removed.
From-SVN: r27105
x
* java/util/Calendar.java (set): First call computeFields if needed.
* java/util/natGregorianCalendar.cc (computeTime): Cast 1000 to jlong.
From-SVN: r26910
* java/io/InputStreamReader.java (read): If length is 0, return
0. Reset `wpos' and `wcount' when buffer has been filled and
emptied.
* java/util/Properties.java (save): Removed `FIXME' comment.
(load): Invalid characters in \u now treated as terminators.
Make sure to append character resulting from `\' handling.
Cast to `char' when appending to key or value.
(skip_ws): Inverted test for whitespace.
From-SVN: r26862
* java/text/DateFormat.java (computeInstance): Separate time
and date styles.
(getDateTimeInstance): Ditto.
(getDateTimeInstance(int,int)): New method.
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Add new classes.
* java/util/PropertyResourceBundle.java: New file.
* gnu/gcj/util/EnumerationChain.java: New file.
From-SVN: r26842
e
* InflaterInputStream.java: New stub class.
* ZipInputStream.java: New class. Partly works.
* ZipConstants.java: Add two (internal) constants.
* ZipEntry.java (timeFromDOS): New static (non-public) method.
* ZipFile.java: Make it mostly work, except for compression.
* ZipOutputStream.java: Start implementation.
From-SVN: r26793
u
* InflaterInputStream.java: New stub class.
* ZipInputStream.java: New class. Partly works.
* ZipConstants.java: Add two (internal) constants.
* ZipEntry.java (timeFromDOS): New static (non-public) method.
* ZipFile.java: Make it mostly work, except for compression.
* ZipOutputStream.java: Start implementation.
From-SVN: r26792
* java/lang/StringBuffer.java (ensureCapacity): Don't resize
vector when shared.
* java/util/Locale.java (Locale(String,String)): Implement in
terms of 3-argument version; variant now defaults to empty
string.
(toString): Assume variant is not null.
(equals): Assume all strings are not null.
(Locale): Throw NullPointerException if any argument is null.
* java/util/ResourceBundle.java (getBundle): Don't try the base
name; now implicit in partialGetBundle call.
(trySomeGetBundle): Search for parent bundles and call setParent
as required.
(partialGetBundle): Added `langStop' argument. Use
`Locale.toString' to compute bundleName.
(resource_cache): New static field.
(partialGetBundle): Cache the returned resource bundle. Now
synchronized.
* gnu/gcj/text/LocaleData_en.java (contents): [collatorRule] Added
missing `<'.
* mauve-libgcj: Enable Collator and RuleBasedCollator.
* java/text/natCollator.cc (decomposeCharacter): `base' now
`const'.
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Added
CollationElementIterator, CollationKey, Collator,
RuleBasedCollator.
(nat_source_files): Added natCollator.cc.
* java/text/RuleBasedCollator.java (ceiNext): No longer static.
(compare): Pass `this' to CollationElementIterator constructor.
(getCollationElementIterator): Likewise.
(ceiNext): Fix off-by-one error when finding initial substring.
(next): Correctly mask off bits when computing return value.
Fixed return values when one string is shorter than the other.
* java/text/CollationElementIterator.java (collator): New field.
(CollationElementIterator): Added collator argument.
(next): Call ceiNext on collator object.
From-SVN: r26707
* java/util/GregorianCalendar.java (setDefaultTime): New method.
(GregorianCalendar): Use it in all constructors.
* java/util/Calendar.java (Calendar): Changed argument name to
`zone' to match code.
* gnu/gcj/text/LocaleData_en.java: Added collatorRule element.
* java/text/CollationKey.java: New file.
* java/text/CollationElementIterator.java: New file.
* java/text/Collator.java: New file.
* java/text/RuleBasedCollator.java: New file.
From-SVN: r26654