* 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
* java/lang/natClass.cc (_Jv_CheckCast): add class names to exception
* gnu/gcj/runtime/FirstThread.java (main): replace / with . in jarMainClassName
From-SVN: r40604
* java/lang/natString.cc (rehash): Don't bother with memset;
_Jv_AllocBytes returns zero'd memory. Use _Jv_AllocBytesChecked.
Use UNMASK_PTR.
(UNMASK_PTR): New macro.
(intern): Unmask pointer before returning it. Register finalizer
for the string.
(unintern): Handle case where
(MASK_PTR): New macro.
(PTR_MAKSED): Likewise.
(_Jv_NewStringUtf8Const): Use UNMASK_PTR.
From-SVN: r40593
2001-03-01 Andrew Haley <aph@redhat.com>
* java/lang/natThrowable.cc (printRawStackTrace): Copy the
stackTrace buffer to a correctly aligned pointer array.
From-SVN: r40456
2001-03-12 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Runtime.java (_exit): Declare new package-private native.
* java/lang/natRuntime.cc (_exit): Implemented. Same as exit() but
without a security manager check.
(exit): Call _exit after security check.
* prims.cc (JvRunMain): Call Runtime._exit to shutdown the runtime
"naturally".
* java/lang/System.java (setSecurityManager): If a security manager
is already in place, call checkPermission.
* java/lang/ThreadGroup.java (uncaughtException): If printStackTrace()
throws an exception, try to deal with it gracefully.
* java/lang/ExceptionInInitializerError.java (printStackTrace):
Only try to print the subordinate stack trace if "exception" is set.
Print our class name first.
From-SVN: r40401
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/math/BigInteger.java
* gnu/gcj/math/MPN.java (rshift0): New method handles zero shift count.
(rshift(int[],int[],int,int): Removed - not needed.
(gcd): Use rshift0 rather than rshift.
* java/math/BigInteger.java (setShiftRight): Likewise.
(divide): Simplify by using rshift0.
(divide): Zero-extend results if high-order bit set.
From-SVN: r40177
* configure.in: Add support for --enable-java-awt configure option.
Use --enable-java-awt=xlib to build the xlib peers (libgcjx).
* Makefile.am: Make libgcjx conditional on XLIB_AWT, instead of NO_X.
* Makefile.in: Rebuilt.
* configure: Rebuilt.
From-SVN: r39970
* java/io/CharArrayReader.java (CharArrayReader): Throw
IllegalArgumentException if constructor arguments are illegal.
(ready): Return false if no more characters can be read.
* java/io/ByteArrayInputStream.java (ByteArrayInputStream): Likewise.
From-SVN: r39876
* java/io/DataInputStream.java: update copyright notice
* java/io/PrintWriter.java: idem
* java/io/Reader.java: idem
* java/io/StreamTokenizer.java: idem
* java/io/StringReader.java: idem
* java/lang/reflect/ReflectPermission.java: idem
From-SVN: r39798
* 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
Fix for PR libgcj/1351:
* posix.cc (_Jv_select): Throw InterruptedIOException if thread is
interrupted.
Include Thread.h and InterruptedIOException.h.
From-SVN: r39639
2001-02-12 Jeff Sturm <jeff.sturm@commerceone.com>
Tom Tromey <tromey@redhat.com>
* interpret.cc (continue1): [insn_invokevirtual] Do an explicit
null pointer check.
Co-Authored-By: Tom Tromey <tromey@redhat.com>
From-SVN: r39607
From paul@dawa.demon.co.uk. Fix for PR libgcj/1913:
* java/io/InputStreamReader.java (ready, read): Throw IOException
if stream has been closed.
From-SVN: r39553
Fix for PR libgcj/1906:
* java/text/MessageFormat.java (setLocale): Use named class
literals.
(forName): Removed.
(format(Object,StringBuffer,FieldPosition)): Special case if
argument is an Object[].
From-SVN: r39529
* 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
gcc/java:
* Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
of macros used when compiling jvspec.c.
* jvspec.c (lang_specific_driver): Link with the shared
libgcc by default.
libjava:
* libgcj.spec.in: Don't force static libgcc into the executable.
* configure.in (FORCELIBGCCSPEC): Removed.
From-SVN: r39449
* java/io/ObjectInputStream.java (read): AND byte with 0xff to make
result unsigned.
(read (byte[], int, int)): Only call readNextBlock() if the block
buffer would actually be overrun. Increment blockDataPosition.
(callReadMethod): Propagate exceptions from invocation target.
* java/io/ObjectOutputStream.java (callWriteMethod): Propagate
exceptions from invocation target.
From-SVN: r39293
* jni.cc (_Jv_JNI_GetAnyMethodID): Rewrite signature from external
to internal representation.
(_Jv_JNI_GetAnyFieldID): Likewise. Also, only use
_Jv_FindClassFromSignature.
From-SVN: r39289
* java/lang/Class.h (isInterface): Move implementation from
natClass.cc. Declare inline.
(Class): Add default constructor.
* java/lang/Object.h: Update comments.
* java/lang/natClass.cc (initializeClass): Use _Jv_InitClass to
initialize superclass, saving a call if super is already initialized.
From-SVN: r39091
2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
All files with updated copyright.
* prims.cc (class _Jv_PrimClass): Removed.
(init_prim_class): New function.
(DECLARE_PRIM_TYPE): Rewritten. `java::lang::Class' replaces
`_Jv_PrimClass' in primitive type declarations. Assign to the
value returned by `init_prim_class.'
* gcj/array.h: `java::lang::Class' replaces `_Jv_PrimClass' in
primitive type declarations.
(JvPrimClass): Cast to `jclass' removed.
* java/lang/Class.h (Class): New constructor.
(Class): New copy constructor.
(initializePrim): New prototype.
(_Jv_PrimClass): Field removed.
* java/lang/Object.h (struct _JvObjectPrefix): New virtuals
nacd_1 and nacd_2 (for compatibility with the new C++ ABI.)
(class java::lang::Object): `finalize' moved up front.
* java/lang/natClass.cc
(isAssignableFrom): Turned outline.
(isInstance): Likewise.
(isInterface): Likewise, fixed indentation.
(initializePrim): New function.
(New C++ ABI compatibility patch:
http://sources.redhat.com/ml/java-patches/2001-q1/msg00065.html)
From-SVN: r39032
Fix for PR libgcj/1596:
* java/math/BigDecimal.java (divide): Check newScale for validity.
Ensure that BigInteger.pow() is called with a non-negative value.
(setScale (int)): New public method.
(setScale (int,int)): New public method.
From-SVN: r38861
2001-01-09 Oskar Liljeblad <osk@hem.passagen.se>
Fix for PR libgcj/1338:
* java/io/StreamTokenizer.java (nextToken): Handle // and /* before
commentChar. Fixed typos in comments.
From-SVN: r38830
* class.c (make_class_data): Push initial value for "arrayclass".
* decl.c (init_decl_processing): Add new class field "arrayclass".
In libjava:
* java/lang/Class.h (_Jv_InitClass): Use __builtin_expect.
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass.
(_Jv_GetArrayClass): New inline function.
(arrayclass): New field.
* prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayClass. Don't use
_Jv_GetArrayElementFromElementType.
(_Jv_NewPrimArray): Ditto.
(_Jv_PrimClass constructor): Initialize "depth", "ancestors", and
"idt" for completeness. Initialze "arrayclass" using _Jv_NewArrayClass.
Set Modifier::ABSTRACT.
* java/lang/natClassLoader.cc (_Jv_NewClass): Initialize "arrayclass".
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void.
Now synchronized. Array classes are now referenced from
elementClass->arrayclass. Don't use _Jv_FindClassInCache.
Set array classes' accessibility flags correctly. Optimize so that
all array classes share the same IDT.
* java/lang/reflect/natArray.cc (newInstance): Use _Jv_GetArrayClass.
* java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Ditto.
* java/lang/natClass.cc (_getFields): Increment offset. Prevent fields
in superclasses from overwriting classes own fields.
(_Jv_IsAssignableFrom): Check for NULL source idt instead of calling
Modifier::isAbstract().
(null_idt): New static field.
(_Jv_PrepareConstantTimeTables): Optimize case where class implements
no interfaces.
(_Jv_IndexOf): Made inline.
* boehm.cc (_Jv_MarkObj): Mark "arrayclass" field.
From-SVN: r38808
* java/io/PipedInputStream: Rewrote to be simpler and more correct.
* java/io/PipedOutputStream: Updated to match new PipedInputStream.
* java/io/PipedReader: New implementation based on new
PipedInputStream.
* java/io/PipedWriter: Updated to match new PipedOutputStream.
From-SVN: r38708
* configure.in: Rename THREADLIB to THREADLIBS.
* Makefile.am (LINK): Add $(THREADLIBS) to libtool command line. This
ensures that we link the correct version of the linuxthreads semaphore
functions.
* Makefile.in: Rebuilt.
* configure: Rebuilt.
* linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the
list of signals which are not blocked during suspend in the NO_SIGNALS
case.
For libjava:
* Makefile.am (libgcj_la_LIBADD): Add $(THREADLIBS). This ensures that
the correct versions of various linuxthreads functions get linked.
* Makefile.in: Rebuilt.
* java/lang/natThread.cc (finalize_native): New static function. Call
_Jv_ThreadDestroyData.
(initialize_native): Register finalizer for "data".
* include/posix-threads.h (_Jv_ThreadInitData): New simpler prototype.
(_Jv_ThreadDestroyData): New prototype.
* include/win32-threads.h: Ditto.
* include/no-threads.h: Ditto.
* posix-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): New function. Free native thread "data" and
move mutex and condition variable destroy code from:
(really_start): ...here.
(_Jv_ThreadStart): Set PTHREAD_CREATE_DETACHED.
* win32-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): Implemented.
* nogc.cc (_Jv_AllocObject): Use "void *" not "ptr_t".
(_Jv_AllocArray): Ditto.
From-SVN: r38557
2000-12-27 Jeff Sturm <jeff.sturm@commerceone.com>
* java/sql/DriverManager.java (getConnection): Don't set
user/password properties if null.
From-SVN: r38516
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/lang/Throwable.java (trace_enabled): New static field.
* java/lang/natThrowable.cc (fillInStackTrace): Do nothing if
trace_enabled not set.
* prims.cc (main_init): Turn off trace_enabled while creating
default exception objects.
From-SVN: r38442
* 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
* COPYING: Update to current
ftp://ftp.gnu.org/pub/gnu/Licenses/COPYING-2.0 (fixes references
to 19yy as example year in copyright notice).
From-SVN: r38340
* 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
* java/lang/Character.java: Updated UnicodeBlock constants.
* scripts/blocks.pl: Special case private use and surrogate
areas. Updated URL.
From-SVN: r38269
* Makefile.in: Rebuilt.
* Makefile.am (GCJ_WITH_FLAGS): New macro, includes --encoding
option.
(GCJCOMPILE): Use it.
(JAVAC): Likewise.
From-SVN: r38219
* 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/awt/geom/Point2D.java: Added protected constructor.
(equals): New method.
(Float.setLocation(float,float)): New method.
* java/awt/geom/Dimension2D.java: Added protected constructor.
* java/awt/geom/AffineTransform.java: Made all constants public.
(concatenate): Fixed typo in name.
* java/awt/event/WindowAdapter.java: Class now abstract.
* java/awt/event/KeyEvent.java (CHAR_UNDEFINED): Now final.
* java/awt/event/FocusEvent.java: Extend ComponentEvent, not
AWTEvent.
From-SVN: r37988
* 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
* java/text/DateFormatSymbols.java (zoneStringsDefault): Added
more time zone entries.
* java/text/SimpleDateFormat.java (format): Added case for
TIMEZONE_FIELD.
From-SVN: r37824
2000-11-28 Bryce McKinlay <bryce@abatross.co.nz>
* java/io/DataInputStream.java: Merge classpath docs. Call in.read()
directly rather than read() in all cases. Make primitive read
implementations more efficient, as defined in JDK online docs.
(skipBytes): Behave like the JDK's implementation.
* java/io/BufferedReader.java: Merge classpath docs. Check for a
closed stream with checkStatus() whenever an IOException can be
thrown.
(checkStatus): New private method.
From-SVN: r37810
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
* prims.cc (_Jv_NewObjectArray): Use const_cast to initialize
length field of array.
(_Jv_NewPrimArray): Likewise.
* gcj/array.h (__JArray): `length' field now const. Added
constructor.
From-SVN: r37771
* prims.cc (_Jv_NewObjectArray): Use palcement new to create
array.
(_Jv_NewPrimArray): Likewise.
Include <new>.
* gcj/array.h (__JArray): `length' field now const. Added
constructor.
(class JArray): Added constructor.
From-SVN: r37718
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
* java/beans/PropertyChangeSupport.java (propertyListeners): Made
transient.
(listeners): Made transient.
(source): Renamed from 'bean'.
(children): New field for serialization.
(propertyChangeSupportSerializedDataVersion): Ditto.
(serialVersionUID): Ditto.
(writeObject): New serialization method.
(readObject): New serialization method.
* java/beans/VetoableChangeSupport.java (propertyListeners): Made
transient.
(listeners): Made transient.
(source): Renamed from 'bean'.
(children): New field for serialization.
(vetoableChangeSupportSerializedDataVersion): Ditto.
(serialVersionUID): Ditto.
(writeObject): New serialization method.
(readObject): New serialization method.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Fixed assert
to allow constructor to have a return type (i.e. the class that the
constructor constructs).
Serialization mods.
From-SVN: r37506
* java/io/ObjectInputStream.java (readObject): Added code to
conditionally dump out the serialized data.
Handle ENDBLOCKDATA case a bit more gracefully since the current
behavior doesn't seem to work as expected.
(readStreamHeader): Added code for serialized data dumper.
(readNextBlock): Ditto.
(readFields): Ditto.
(dump): New private static field for turning on/off dumper.
(setDump): New native method.
(dumpElement): New native method.
(dumpElementln): New native method.
* java/io/natObjectInputStream.cc (setDump): New method.
(dumpElement): New method.
(dumpElementln): New method.
Serialization dumper. Enable by configuring with --enable-libgcj-debug
and calling java.io.ObjectInputStream.setDump(true) in your test program.
The output will be generated as the object is deserialized (i.e. the
readObject() method is executed).
From-SVN: r37223
* java/net/InetAddress.java (addr): Renamed from 'address'.
(address): New field to match Serialized Form doc.
(hostName): Renamed from 'hostname' to match Serialized Form doc.
(family): New serialization field.
(serialVersionUID): New field.
(readObject): New method.
(writeObject): New method.
(getFamily): New native method.
(InetAddress): Set family.
* java/net/natInetAddress.cc (getFamily): New method.
(addr): Renamed from 'address'.
(hostName): Renamed from 'hostname' to match Serialized Form doc.
* java/net/natPlainDatagramSocketImpl.cc (addr): Renamed from 'address'.
* java/net/natPlainSocketImpl.cc (addr): Renamed from 'address'.
Serialization mod.
From-SVN: r37222
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
* scripts/encodings.pl: Added `ASCII' alias.
* Makefile.in: Rebuilt.
* Makefile.am (convert_source_files): Added new files.
* gnu/gcj/convert/Input_ASCII.java: New file.
* gnu/gcj/convert/Output_ASCII.java: New file.
* gnu/gcj/convert/Output_8859_1.java (write): Use `?' to represent
out-of-range characters.
* gnu/gcj/convert/natIconv.cc (iconv_init): New method.
(read): Swap bytes if required. Treat `count' as character count,
not byte count.
(write): Likewise. Also, handle case where iconv fails on a given
character.
(init): Put encoding into exception.
* gnu/gcj/convert/IOConverter.java (iconv_byte_swap): New global.
(static): Call iconv_init. Rebuilt alias list.
(iconv_init): New private method.
From-SVN: r37190
* Makefile.in: Rebuilt.
* Makefile.am (install-exec-hook): Only make a single symlink, and
remove the destination before making the link.
* configure: Rebuilt.
* configure.in: Call AC_PROG_LN_S.
From-SVN: r37189
* jni.cc: Added include of java/lang/ThreadGroup.h.
* gcj/javaprims.h: Removed Replaceable and Resolvable from namespace
per change of 2000-10-05.
From-SVN: r37173
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
2000-10-25 Bryce McKinlay <bryce@albatross.co.nz>
* Makefile.am (GCJCOMPILE): Pass --tag=GCJ to libtool.
(core_java_source_files): Put java.lang, java.io, and java.util here.
(ordinary_java_source_files): Order so that core_java_source_files are
built first.
(java_source_files): Reorder so that special_java_source_files are
built first.
* configure.in: Don't pass -I flag to gcj.
* Makefile.in: Rebuilt.
* configure: Rebuilt.
From-SVN: r37060
* Makefile.am: Added rules for libgcjx library.
* Makefile.in: Rebuilt.
* configure.in: Added check for X.
* configure: Rebuilt.
* gnu/awt/LightweightRedirector.java: New file.
* gnu/awt/j2d/AbstractGraphicsState.java: New file.
* gnu/awt/j2d/DirectRasterGraphics.java: New file.
* gnu/awt/j2d/Graphics2DImpl.java: New file.
* gnu/awt/j2d/IntegerGraphicsState.java: New file.
* gnu/awt/j2d/MappedRaster.java: New file.
* gnu/awt/xlib/XCanvasPeer.java: New file.
* gnu/awt/xlib/XEventLoop.java: New file.
* gnu/awt/xlib/XEventQueue.java: New file.
* gnu/awt/xlib/XFontMetrics.java: New file.
* gnu/awt/xlib/XFramePeer.java: New file.
* gnu/awt/xlib/XGraphics.java: New file.
* gnu/awt/xlib/XGraphicsConfiguration.java: New file.
* gnu/awt/xlib/XPanelPeer.java: New file.
* gnu/awt/xlib/XToolkit.java: New file.
* gnu/gcj/xlib/Clip.java: New file.
* gnu/gcj/xlib/Colormap.java: New file.
* gnu/gcj/xlib/Display.java: New file.
* gnu/gcj/xlib/Drawable.java: New file.
* gnu/gcj/xlib/Font.java: New file.
* gnu/gcj/xlib/GC.java: New file.
* gnu/gcj/xlib/Pixmap.java: New file.
* gnu/gcj/xlib/Screen.java: New file.
* gnu/gcj/xlib/Visual.java: New file.
* gnu/gcj/xlib/WMSizeHints.java: New file.
* gnu/gcj/xlib/Window.java: New file.
* gnu/gcj/xlib/WindowAttributes.java: New file.
* gnu/gcj/xlib/XAnyEvent.java: New file.
* gnu/gcj/xlib/XButtonEvent.java: New file.
* gnu/gcj/xlib/XColor.java: New file.
* gnu/gcj/xlib/XConfigureEvent.java: New file.
* gnu/gcj/xlib/XConnectException.java: New file.
* gnu/gcj/xlib/XEvent.java: New file.
* gnu/gcj/xlib/XException.java: New file.
* gnu/gcj/xlib/XExposeEvent.java: New file.
* gnu/gcj/xlib/XID.java: New file.
* gnu/gcj/xlib/XImage.java: New file.
* gnu/gcj/xlib/XUnmapEvent.java: New file.
* gnu/gcj/xlib/natClip.cc: New file.
* gnu/gcj/xlib/natColormap.cc: New file.
* gnu/gcj/xlib/natDisplay.cc: New file.
* gnu/gcj/xlib/natDrawable.cc: New file.
* gnu/gcj/xlib/natFont.cc: New file.
* gnu/gcj/xlib/natGC.cc: New file.
* gnu/gcj/xlib/natPixmap.cc: New file.
* gnu/gcj/xlib/natScreen.cc: New file.
* gnu/gcj/xlib/natVisual.cc: New file.
* gnu/gcj/xlib/natWMSizeHints.cc: New file.
* gnu/gcj/xlib/natWindow.cc: New file.
* gnu/gcj/xlib/natWindowAttributes.cc: New file.
* gnu/gcj/xlib/natXAnyEvent.cc: New file.
* gnu/gcj/xlib/natXButtonEvent.cc: New file.
* gnu/gcj/xlib/natXColor.cc: New file.
* gnu/gcj/xlib/natXConfigureEvent.cc: New file.
* gnu/gcj/xlib/natXException.cc: New file.
* gnu/gcj/xlib/natXExposeEvent.cc: New file.
* gnu/gcj/xlib/natXImage.cc: New file.
* gnu/gcj/xlib/natXUnmapEvent.cc: New file.
* java/awt/EventDispatchThread.java: Start thead on creation.
From-SVN: r37005
* gnu/gcj/text/LocaleData_en.java (monetarySeparator): Added.
* java/sql/Date.java (serialVersionUID): New field.
* java/sql/Time.java (serialVersionUID): New field.
* java/sql/Timestamp.java (serialVersionUID): New field.
* java/text/ChoiceFormat.java (serialVersionUID): New field.
* java/text/DateFormat.java (getDateTimeInstance (int)): Removed.
* java/text/DateFormatSymbols.java (serialVersionUID): New field.
* java/text/DecimalFormat.java (serialVersionOnStream): New field.
(readObject): New serialization method.
* java/text/DecimalFormatSymbols.java (monetarySeparator): New field.
(serialVersionOnStream): New field.
(readObject): New serialization method.
(getMonetaryDecimalSeparator): New method.
(setMonetaryDecimalSeparator): New method.
* java/text/NumberFormat.java (maxFractionDigits): New field.
(maxIntegerDigits): New field.
(minFractionDigits): New field.
(minIntegerDigits): New field.
(serialVersionOnStream): New field.
(serialVersionUID): New field.
(readObject): New serialization method.
(writeObject): New serialization method.
* java/text/SimpleDateFormat.java (defaultCenturyStart): Initialized.
(serialVersionOnStream): New field.
(serialVersionUID): New field.
(readObject): New serialization method.
Serialization mods.
From-SVN: r36831
2000-10-09 Alexandre Oliva <aoliva@redhat.com>
* configure.in (GCJ): Avoid bogus error message when looking for
(and not finding) gcj in the build tree.
* configure: Rebuilt.
2000-10-09 Tom Tromey <tromey@cygnus.com>
* configure: Rebuilt.
* configure.in: Include sys/types.h when checking for socklen_t.
From Arno J. Klaassen.
From-SVN: r36811
2000-10-09 Bryce McKinlay <bryce@albatross.co.nz>
* include/jvm.h: Enable __builtin_expect().
* name-finder.cc (lookup): Don't trust dladdr() if the address is from
the main program. Fix for PR libgcj/341.
From-SVN: r36794
* 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
2000-09-30 Tom Tromey <tromey@cygnus.com>
* posix-threads.cc (_Jv_CondWait): Check to see if we are
interrupted before modifying the cv's wait set.
From-SVN: r36680
2000-09-30 Hans Boehm <boehm@acm.org>
Bryce McKinlay <bryce@albatross.co.nz>
Implement bitmap descriptor based marking for Boehm GC.
* configure.in: Define JC1GCSPEC. Set it if boehm-gc is used.
* configure: Rebuilt.
* libgcj.spec.in: Pass JC1GCSPEC to jc1.
* include/jvm.h (struct _Jv_VTable): New field `gc_descr'. New inline
method get_finalizer().
(struct _Jv_ArrayVTable): Ditto. Declare method array with
NUM_OBJECT_METHODS elements instead of NUM_OBJECT_METHODS + 1.
(_Jv_AllocObj): Add new jclass parameter.
(_Jv_AllocArray): Ditto.
(_Jv_BuildGCDescr): New prototype.
* prims.cc (_Jv_AllocObject): Rename parameter `c' to `klass'. Pass
`klass' to _Jv_AllocObj. Don't set the new object's vtable. Use
get_finalizer() instead of direct finalizer vtable offset.
(_Jv_NewObjectArray): Rename parameter `clas' to `klass'. Pass
`klass' to _Jv_AllocArray. Don't set the new array's vtable.
(_Jv_NewPrimArray): Call _Jv_FindArrayClass before _Jv_AllocObj.
Pass `klass' to _Jv_AllocObj. Don't set the new array's vtable.
* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): New #defines.
(_Jv_ResolvePoolEntry): Use METHOD_NOT_THERE and METHOD_INACCESSIBLE.
(_Jv_DetermineVTableIndex): Ditto.
(_Jv_PrepareClass): Ditto. Remove offset-by-one adjustments from vtable
calculations to account for new gc_descr field.
* boehm.cc: #include gc_gcj.h.
(obj_kind_x, obj_free_list): `#if 0'-ed away.
(_Jv_MarkObj): Check that vtable doesn't point to a cleared object.
New commentary from HB. Mark the classes vtable.
(_Jv_MarkArray): Check that vtable doesn't point to a cleared object.
(GC_DEFAULT_DESCR): New #define.
(_Jv_BuildGCDescr): New function. Use GC_DEFAULT_DESCR, for now.
(_Jv_AllocObj): New parameter `klass'. Use GC_GCJ_MALLOC ().
(_Jv_AllocArray): New parameter `klass'. Allocate with GC_MALLOC and
scan conservativly if size is less than min_heap_addr. Set vtable
pointer of new object before returning.
(_Jv_AllocBytes): Use GC_MALLOC_ATOMIC, not GC_GENERIC_MALLOC.
(_Jv_InitGC): Call GC_init_gcj_malloc(). Don't set up marking and
allocation for obj_kind_x.
* nogc.cc (_Jv_BuildGCDescr): New function. Return 0.
(_Jv_AllocObj): Set vtable on returned object.
(_Jv_AllocArray): Ditto.
* java/lang/Class.h (_Jv_NewObjectArray): No longer a friend.
(_Jv_NewPrimArray): Ditto.
(_Jv_AllocObj): Declare as a friend.
(_Jv_AllocArray): Ditto.
* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Copy gc_descr
from &ObjectClass into new array class. Remove offset-by-one
adjustments from `method' size calculations to account for gc_descr
field.
Co-Authored-By: Bryce McKinlay <bryce@albatross.co.nz>
From-SVN: r36679
* defineclass.cc: Include alloca.h only if HAVE_ALLOCA_H.
* java/lang/natDouble.cc: Likewise.
* java/lang/reflect/natMethod.cc: Likewise.
* interpret.cc: Likewise. Fix NULLCHECKs that tested a _Jv_word.
From-SVN: r36404
2000-09-13 Alexandre Oliva <aoliva@redhat.com>
* configure.in (LIBDATASTARTSPEC): Use `%s' to search for
libgcjdata.a.
(GCJ): Support single-tree builds. Add -B`pwd`/ and -I$srcdir.
* acinclude.m4: Arrange for automake to not bring in a new
libtool.m4 for LT_AC_PROG_GCJ. AC_SUBST GCJ.
* Makefile.am: Leave it up to automake to subst GCJ.
* aclocal.m4, configure, Makefile.in: Rebuilt.
From-SVN: r36392
* java/lang/reflect/natArray.cc (BooleanClass): New define.
(get): Ensure Boolean class is initialized.
* java/lang/reflect/natField.cc (BooleanClass): New define.
(get): Ensure Boolean class is initialized.
From-SVN: r36391
2000-09-13 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/String.java (CASE_INSENSITIVE_ORDER): New static field.
Initialize with anonymous class.
(compareToIgnoreCase): New method.
* java/lang/ThreadGroup.java (had_uncaught_exception): New field.
(uncaughtException): Set had_uncaught_exception.
* prims.cc (JvRunMain): Check value of had_uncaught_exception and
exit with error status if set.
(_Jv_RunMain): Ditto.
From-SVN: r36385
* gnu/gcj/convert/BytesToUnicode.java (getDefaultDecoder): Let
default decoder use iconv.
* gnu/gcj/convert/UnicodeToBytes.java (getDefaultEncoder):
Let default encoder use iconv.
* configure: Rebuilt.
* configure.in: Check for nl_langinfo and <langinfo.h>.
* java/lang/natSystem.cc (file_encoding): New function.
(DEFAULT_FILE_ENCODING): Define to file_encoding() if possible.
From-SVN: r36306
2000-09-06 Jeff Sturm <jeff.sturm@appnet.com>
* include/jvm.h (_Jv_HashCode): Cast object ptr to `unsigned long'
to avoid long long division.
From-SVN: r36215
* java/lang/reflect/Constructor.java (toString): Use `getName' for
parameter types.
* java/lang/reflect/Method.java (toString): Use `getName' for
return type.
From-SVN: r36214
* java/lang/natPosixProcess.cc (fail): New function.
(cleanup): New function.
(startProcess): Use them. Create pipe so child can communicate
exec failure back to parent.
From-SVN: r36202
Fix for PR java.io/203:
* java/io/File.java (createTempFile): Obey directory argument.
Use java.io.tmpdir if needed. Don't leave FileDescripators open.
* java/lang/natSystem.cc (init_properties): Use TMPDIR environment
variable to set java.io.tmpdir on non-WIN32 systems.
From-SVN: r36143
2000-09-01 Andrew Haley <aph@redhat.com>
* java/io/StreamTokenizer.java: Don't throw a
NumberFormatException if a field is numeric as far as the
StreamTokenizer is concerned but not as far as Double.valueOf() is
concerned: return a zero instead.
For gcj/141.
From-SVN: r36100
* 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-26 Anthony Green <green@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (java/lang/ClassLoader.h): Make _Jv_RunMain a
friend.
* prims.cc: Include ClassLoader.h.
(_Jv_RunMain): When executing jar files, classpath must be the jar
file only. Lose our reference to the system ClassLoader in order
to get a new one with the correct classpath.
* java/lang/natSystem.cc (init_properties): When executing a jar
file, only use the jar file for java.class.path.
* gnu/gcj/runtime/VMClassLoader.java: Use the canonical file name
for bytecode archives.
* gnu/gcj/runtime/FirstThread.java: Handle case where manifest
exists, but not Main-Class.
From-SVN: r35999