Commit Graph

264 Commits

Author SHA1 Message Date
Per Bothner f9edddabe7 Change to sometimes include class name in ClassFormatError message.
From-SVN: r40030
2001-02-23 20:15:31 -08:00
Per Bothner b80b8cfd29 Throwable.java (CPlusPlusDemangler): Pass -s java to c++filt to select java-style output.
* java/lang/Throwable.java (CPlusPlusDemangler):  Pass -s java to
	c++filt to select java-style output.

From-SVN: r40027
2001-02-23 19:52:49 -08:00
Tom Tromey 0cbd398014 ThreadGroup.java (activeCount): Only include threads which are alive.
* java/lang/ThreadGroup.java (activeCount): Only include threads
	which are alive.
	(enumerate): Likewise.

From-SVN: r39922
2001-02-20 18:05:57 +00:00
Bryce McKinlay 3d1c878854 Integer.java (getInteger): Return default argument if property is not set.
* java/lang/Integer.java (getInteger): Return default argument if
	property is not set. Don't call decode with null argument.
	* java/lang/Long.java (getLong): Likewise.

From-SVN: r39870
2001-02-19 03:43:12 +00:00
Mark Wielaard f74fd2bbc1 DataInputStream.java: update copyright notice
* 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
2001-02-17 13:59:13 +00:00
Anthony Green c220009946 defineclass.cc: Don't include alloca.h.
2001-02-15  Anthony Green  <green@redhat.com>

	* defineclass.cc: Don't include alloca.h.
	(prepare_pool_entry): Convert alloca to __builtin_alloca.
	* interpret.cc (run_normal): Ditto.
        (continue1): Ditto.
	* java/lang/natDouble.cc (parseDouble): Ditto.

From-SVN: r39719
2001-02-15 14:03:14 +00:00
Bryce McKinlay 97a4d32ec6 natClass.cc (getSignature): Don't try to dereference param_types if it is null.
* 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
2001-02-14 05:32:31 +00:00
Bryce McKinlay 0e206b71aa Double.java (doubleToRawLongBits): Now native.
* java/lang/Double.java (doubleToRawLongBits): Now native.
	* java/lang/Float.java (floatToRawIntBits): Likewise.
	* java/lang/natDouble.cc (doubleToRawLongBits): New method.
	* java/lang/natFloat.cc (floatToRawIntBits): Likewise.

From-SVN: r39572
2001-02-09 22:13:33 +00:00
Bryce McKinlay c97036e4c3 Byte.java: Remove redundant instanceof and null checks.
* java/lang/Byte.java: Remove redundant instanceof and null checks.
	* java/lang/Integer.java: Likewise.
	* java/lang/Long.java: Likewise.
	* java/lang/Short.java: Likewise.
	* java/lang/Double.java: Likewise.
	(doubleToRawLongBits): New method.
	* java/lang/Float.java: As above.
	(floatToRawIntBits): New method.

From-SVN: r39556
2001-02-09 02:56:38 +00:00
Tom Tromey 1c8b24ad46 * java/lang/Float.java (parseFloat): New method.
From-SVN: r39555
2001-02-09 02:21:27 +00:00
Joseph Myers 7e5fd99fd3 gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
gcc/java/:
	* gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.

libffi/:
	* include/ffi.h.in: Change sourceware.cygnus.com references to
	gcc.gnu.org.

libjava/:
	* README, gij.cc, java/lang/natClass.cc, java/lang/natSystem.cc:
	Change sources.redhat.com and sourceware.cygnus.com references to
	gcc.gnu.org.

From-SVN: r39531
2001-02-08 01:49:53 +00:00
Warren Levy 5bb1db008c natSystem.cc (getSystemTimeZone): Only use tm_gmtoff and timezone if they are available on the system.
* java/lang/natSystem.cc (getSystemTimeZone): Only use tm_gmtoff
	and timezone if they are available on the system.

From-SVN: r39283
2001-01-26 21:57:08 +00:00
Tom Tromey f07f528411 * java/lang/sf_fabs.c: Use uint32_t, not __uint32_t.
From-SVN: r39269
2001-01-25 19:07:18 +00:00
Tom Tromey 295504e3a7 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (c_source_files): Added sf_fabs.c.
	* java/lang/sf_fabs.c: New file.

From-SVN: r39238
2001-01-24 17:43:25 +00:00
Bryce McKinlay 607adf67a0 Class.h (isInterface): Move implementation from natClass.cc.
* 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-17 10:22:33 +00:00
Alexandre Petit-Bianco ed8cc5fdf8 prims.cc (init_prim_class): Deleted.
2001-01-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* prims.cc (init_prim_class): Deleted.
	(DECLARE_PRIM_TYPE): Rewritten.
	* java/lang/Class.h (stdio.h): Include removed.
	(stddef.h): Included.
	(java/lang/reflect/Modifier.h): Likewise.
	(Class): Contructor now takes arguments, initializes fields.
	(initializePrim): Prototype deleted.
	* java/lang/natClass.cc (initializePrim): Deleted.

(http://sources.redhat.com/ml/java-patches/2001-q1/msg00081.html)

From-SVN: r39088
2001-01-17 00:13:06 -08:00
Alexandre Petit-Bianco 2feccc205e All files with updated copyright.
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
2001-01-15 00:11:40 -08:00
Tom Tromey b755792e3c natSystem.cc: Include locale.h if it exists.
* java/lang/natSystem.cc: Include locale.h if it exists.
	* configure: Rebuilt.
	* configure.in: Check for locale.h.

From-SVN: r38957
2001-01-12 19:16:05 +00:00
Warren Levy 3824a48600 re PR libgcj/1411 (natTimeZone.cc should be removed)
Fix for PR libgcj/1411:
	* Makefile.am: Removed java/util/natTimeZone.cc.
	* Makefile.in: Rebuilt.
	* gnu/gcj/text/LocaleData_en_US.java (zoneStringsDefault): Added
	missing localized timezone names.
	* java/lang/System.java (getDefaultTimeZoneId): New private method.
	* java/lang/natSystem.cc (getSystemTimeZone): New private method.
	(init_properties): Set user.timezone property.
	* java/text/DateFormatSymbols.java (zoneStringsDefault): Added
	default timezone names; removed non-standard ones.  Use standard
	ID names per JCL.
	* java/util/Date.java (toGMTString): Removed zoneGMT variable.
	(UTC): Ditto.
	* java/util/TimeZone.java: Add standard ID names per JCL; removed
	non-standard ones.
	(getDefaultTimeZoneId): Removed.
	(zoneGMT): Removed.
	(getDefaultTimeZoneId): Removed.
	* java/util/natTimeZone.cc: Removed.

From-SVN: r38816
2001-01-09 07:07:51 +00:00
Bryce McKinlay 5bb11b2e20 In gcc/java:
* 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
2001-01-08 23:28:56 +00:00
Anthony Green bc6d273e64 Fix bug in URLConnection and correct javadoc annotations in StringBuffer.
From-SVN: r38781
2001-01-07 20:01:46 +00:00
Bryce McKinlay 7ae30a9196 * java/lang/Thread.java: Update comment.
From-SVN: r38697
2001-01-05 00:31:45 +00:00
Bryce McKinlay e301621d19 For boehm-gc:
* 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-30 12:18:39 +00:00
Warren Levy ed55bdc47f re PR libgcj/1358 (java.util.Date.toString() doesn't seem to behave properly.)
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
2000-12-28 05:55:56 +00:00
Bryce McKinlay 6147e9d0c9 re PR libgcj/1516 (Method.invoke won't accept boolean parameters)
Fix for PR libgcj/1516:
	* java/lang/reflect/natMethod.cc (primitives): Remove void entry.
	Add boolean entry.
	(can_widen): Declared inline. Remove redundant checks for void
	arguments and char->short conversion. Add special case for boolean
	conversions.
	(ffi_type): Declared inline.
	(_Jv_CallAnyMethodA): Move unwrapping logic inside isPrimitive() block.

From-SVN: r38506
2000-12-28 04:34:33 +00:00
Bryce McKinlay 867e24ad3d natClass.cc (_Jv_IsAssignableFrom): Primitive TYPEs can not be assigned to Object.
* java/lang/natClass.cc (_Jv_IsAssignableFrom): Primitive TYPEs can
	not be assigned to Object.

From-SVN: r38505
2000-12-28 04:33:53 +00:00
Joseph Myers 93b0dee779 * java/lang/mprec.h: Change C9X reference to refer to C99.
From-SVN: r38481
2000-12-23 23:38:51 +00:00
Bryce McKinlay 86a42a5f24 Throwable.java (trace_enabled): New static field.
* 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
2000-12-22 06:19:24 +00:00
Tom Tromey 8eb1306fb7 * java/lang/Thread.java (checkAccess): Now final.
From-SVN: r38273
2000-12-15 06:15:49 +00:00
Tom Tromey 4ca70ccd2a * java/lang/RuntimePermission.java: Class now final.
From-SVN: r38272
2000-12-15 06:13:35 +00:00
Tom Tromey 9acffced80 Character.java: Updated UnicodeBlock constants.
* java/lang/Character.java: Updated UnicodeBlock constants.
	* scripts/blocks.pl: Special case private use and surrogate
	areas.  Updated URL.

From-SVN: r38269
2000-12-15 05:53:39 +00:00
Bryce McKinlay 488d42af6f Makefile.am: Add HashSet.java and java/lang/ref classes.
* 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
2000-12-11 03:47:48 +00:00
Warren Levy d5323b9905 StringBuffer.java (insert(int,char[])): Avoid NullPointerException so proper check of offset can be done.
* java/lang/StringBuffer.java (insert(int,char[])): Avoid
	NullPointerException so proper check of offset can be done.

From-SVN: r38132
2000-12-08 13:08:36 +00:00
Bryce McKinlay 64fc0133eb natDouble.cc: Include fdlibm.h, not mprec.h.
* java/lang/natDouble.cc: Include fdlibm.h, not mprec.h. From
	Edgar Villanueva <edgarvil@home.com>.

From-SVN: r37991
2000-12-04 08:22:34 +00:00
Bryce McKinlay db5e49032b natMath.cc: Declare fabsf() function.
2000-12-02  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natMath.cc: Declare fabsf() function.
	* java/lang/mprec.h: Don't include math.h.
	* java/lang/dtoa.c: Include string.h.
	* java/lang/natString.cc (toLowerCase): Initialize ch to prevent
	compiler warning.

From-SVN: r37938
2000-12-02 00:28:44 +00:00
Bryce McKinlay 5662d5333a natSystem.cc (init_properties): Set user.language and user.region.
2000-11-29  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natSystem.cc (init_properties): Set user.language and
	user.region.
	* configure.in: Check for setlocale.
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.

From-SVN: r37842
2000-11-29 04:53:37 +00:00
Tom Tromey 0cf17a8051 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (core_java_source_files): Added
	RuntimePermission.java.
	* java/lang/RuntimePermission.java: Imported from Classpath.
	* java/lang/Thread.java (getContextClassLoader): Now
	synchronized.  Added security code.
	(setContextClassLoader): Likewise.

From-SVN: r37772
2000-11-27 04:07:48 +00:00
Anthony Green 31280fb7c4 prims.cc (_Jv_NewObjectArray): Undo placement change.
2000-11-25  Anthony Green  <green@redhat.com>

	* prims.cc (_Jv_NewObjectArray): Undo placement change.
	(_Jv_NewPrimArray): Likewise.
	* gcj/array.h (__JArray): Undo const change.  Removed constructor.
	(class JArray): Removed constructor.

	* java/lang/Thread.java (context_class_loader): New private data.
	(getContextClassLoader): New method.
	(setContextClassLoader): New method.
	(Thread): Initialize context_class_loader.

	* java/net/URLClassLoader.java: Import java.util.Enumeration.
	(getResource): Rename to findResource.
	(findResource): New method.  Used to be getResource.
	(getResourceAsStream): Deleted.
	(jarFileize): Extracted logic from URLClassLoader constructor into
	this new private method.
	(addURL): New protected method.
	(URLClassLoader): Call jarFileize.  Use addElement instead of
	insertElementAt.
	(findResources): New method.

	* java/lang/ClassLoader.java: Import java.util.Enumeration.
	(getResource): Implement correct logic.
	(findResource): New method.
	(getResources): New method.
	(findClass): Create a ClassNotFoundException with the name of the
	class rather than nothing at all.
	(defineClass) Only throw ClassFormatError.

	* java/lang/Class.java (forName): New method.
	* java/lang/Class.h (forName): New method.
	* java/lang/natClass.cc (forName): New method.

From-SVN: r37751
2000-11-26 03:58:56 +00:00
Bryce McKinlay 213858c013 System.java (setProperties): Only call init_properties() if properties is null.
2000-11-24  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/System.java (setProperties): Only call init_properties()
	if properties is null.
	(getProperties): Ditto.
	(getProperty): Ditto.
	(setProperty): Call init_properties if properties are null.
	(prop_init): Remove field.
	* java/lang/natSystem.cc (init_properties): Synchronize the entire
	method. Check for null properties after synchronizing instead of
	prop_init flag. Set the properties field last for thread safety.

	* java/io/ObjectInputStream.java (ObjectInputStream): If DEBUG is set,
	test for gcj.dumpobjects property and enable object stream dumping
	if it is set.
	(dumpElement): No longer native.
	(dumpElementln): Ditto.
	(setDump): Do not define.
	* java/io/natObjectInputStream.cc (dumpElement): Removed.
	(dumpElementln): Removed.
	(setDump): Removed.

2000-11-24  Bryce McKinlay  <bryce@albatross.co.nz>

	* configure: Rebuilt.
	* Makefile.in: Rebuilt.
	* Makefile.am (built_java_source_files): Add Configuration.java.
	* configure.in: Add Configuration.java to CONFIG_FILES. Set
	LIBGCJDEBUG substitution if --enable-libgcj-debug is specified.
	Create `gnu' directory in the build tree.
	* gnu/classpath/Configuration.java.in: New file.

From-SVN: r37749
2000-11-26 01:48:04 +00:00
Tom Tromey 4de5a4d99a Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (core_java_source_files): Added new files.
	* java/lang/reflect/ReflectPermission.java: New class.
	* java/io/FileFilter.java: From Classpath
	* java/io/FilePermission.java: From Classpath.

From-SVN: r37586
2000-11-20 18:25:41 +00:00
Tom Tromey f967de33d7 AccessibleObject.java (isAccessible, [...]): Now public.
* java/lang/reflect/AccessibleObject.java (isAccessible,
	setAccessible): Now public.

From-SVN: r37540
2000-11-18 02:30:29 +00:00
Tom Tromey 9839499072 natString.cc: Include Locale.h.
* java/lang/natString.cc: Include Locale.h.
	(toUpperCase): Added `locale' argument.  Handle locale
	sensitivity.
	(toLowerCase): Added `locale' argument.  Handle locale
	sensitivity.
	(ESSET, CAPITAL_S, SMALL_I, CAPITAL_I_WITH_DOT, SMALL_DOTLESS_I,
	CAPITAL_I): New defines.
	* java/lang/String.java (CASE_INSENSITIVE_ORDER): Now public and
	final.
	Import Locale.
	(toUpperCase, toLowerCase): New methods.  Variants which accept
	locale now native.

	* java/lang/ExceptionInInitializerError.java (printStackTrace):
	New methods.

	* java/util/PropertyPermission.java: Re-merged from Classpath.

	* java/text/RuleBasedCollator.java (getCollationElementIterator):
	New method.
	* java/text/StringCharacterIterator.java: Reindented.
	(setText): New method.

From-SVN: r37539
2000-11-18 02:29:13 +00:00
Tom Tromey 98182da528 PushbackReader.java: Merged with Classpath.
* java/io/PushbackReader.java: Merged with Classpath.
	* java/util/Arrays.java: Updated from Classpath.

	* scripts/blocks.pl: New file.
	* java/lang/Character.java (Subset): New class.
	(UnicodeBlock): New class.

	* java/lang/Math.java (toDegrees, toRadians): New methods.

	* java/lang/Float.java: Implement Comparable.
	(compareTo): New methods.
	* java/lang/Double.java: Implement Comparable.
	(compareTo): New methods.

From-SVN: r37512
2000-11-17 04:51:25 +00:00
Warren Levy 3cd22508eb PropertyChangeSupport.java (propertyListeners): Made transient.
* 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
2000-11-16 21:34:48 +00:00
Warren Levy df98a50bb0 Makefile.am: Added locale files from Classpath.
* 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-27 10:33:46 +00:00
Bryce McKinlay ce2ab205ae ThreadGroup.java (uncaughtException): Print thread name with stack dump.
* java/lang/ThreadGroup.java (uncaughtException): Print thread name
        with stack dump.

From-SVN: r37047
2000-10-25 09:11:47 +01:00
Tom Tromey 1d336a099d natField.cc (BooleanClass): Don't define.
* java/lang/reflect/natField.cc (BooleanClass): Don't define.
	* java/lang/reflect/natArray.cc (BooleanClass): Don't define.
	* java/lang/Class.h (Object): Added `class$' field.
	* java/lang/Object.h (Object): Added `class$' field.
	* defineclass.cc (ClassClass): Use `class$' form.
	(ClassObject): Likewise.
	* resolve.cc (ClassObject): Use `class$' form.
	(ObjectClass): Likewise.
	* interpret.cc (ClassError): Removed.
	* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Use
	`class$' form.
	(IntegerClass): Likewise.
	* java/net/natPlainSocketImpl.cc (BooleanClass): Use `class$'
	form.
	* java/lang/natClassLoader.cc (CloneableClass): Use `class$' form.
	(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
	SerializableClass): Likewise.
	Include Serializable.h, Cloneable.h.
	* java/lang/natSystem.cc (SystemClass): Removed.
	(init_properties): Use `class$' form.
	* java/lang/natObject.cc (CloneableClass): Removed.
	(clone): Use `class$' form.
	* java/lang/natClass.cc (CloneableClass): Use `class$' form.
	(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
	ConstructorClass): Likewise.
	* java/lang/reflect/natMethod.cc (ObjectClass): Use `class$' form.
	(ClassClass, VoidClass, ByteClass, ShortClass, CharacterClass,
	IntegerClass, LongClass, FloatClass, DoubleClass): Likewise.
	* java/io/natObjectInputStream.cc (ObjectClass): Use `class$'
	form.
	(ClassClass): Likewise.
	* include/jvm.h (StringClass): Use `class$' form.
	* prims.cc (ObjectClass): Removed.
	(_Jv_RunMain): Use `class$' form.
	(_Jv_AllocObject): Likewise.
	* jni.cc (ClassClass): Use `class$' form.
	(ThrowableClass): Likewise.
	(ObjectClass): Likewise.
	(MethodClass): Likewise.
	(ThreadGroupClass): Likewise.
	(NativeThreadClass): Likewise.
	* boehm.cc (ObjectClass): Removed.
	(ClassClass): Removed.
	(_Jv_MarkObj): Use `class$' form.
	* gcj/field.h (JvFieldIsRef): Use `class$' form.
	Include RawData.h.

From-SVN: r36740
2000-10-06 01:49:32 +00:00
Hans Boehm bf3b8e42e2 Implement bitmap descriptor based marking for Boehm GC.
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
2000-09-30 10:56:58 +01:00
Alexandre Petit-Bianco aca8c6e8a3 natSystem.cc (file_encoding): Added return statement.
2000-09-26  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* java/lang/natSystem.cc (file_encoding): Added return statement.

From-SVN: r36647
2000-09-26 12:00:28 -07:00
Alexandre Oliva 064a791cf5 * java/lang/natRuntime.cc (lt_preloaded_symbols): Define as `extern'.
From-SVN: r36405
2000-09-14 07:56:28 +00:00
Alexandre Oliva e7e18a21d2 defineclass.cc: Include alloca.h only if HAVE_ALLOCA_H.
* 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-14 07:51:56 +00:00
Tom Tromey 96fa18eb49 natArray.cc (BooleanClass): New define.
* 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 18:15:42 +00:00
Bryce McKinlay 0f94c029e9 String.java (CASE_INSENSITIVE_ORDER): New static field.
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
2000-09-13 07:36:25 +01:00
Tom Tromey 14203c9cac Field.java (toString): Don't rely on Class.toString.
* java/lang/reflect/Field.java (toString): Don't rely on
	Class.toString.

From-SVN: r36341
2000-09-11 22:49:29 +00:00
Tom Tromey fe5e3b9714 BytesToUnicode.java (getDefaultDecoder): Let default decoder use iconv.
* 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-11 00:35:51 +00:00
Warren Levy bc6ccd3316 PropertyChangeEvent.java (serialVersionUID): Added.
* java/beans/PropertyChangeEvent.java (serialVersionUID): Added.
	* java/beans/PropertyVetoException.java (serialVersionUID): Added.
	* java/io/File.java (writeObject): Added.
	(readObject): Added.
	(serialVersionUID): Added.
	* java/io/ObjectOutputStream.java (writeObject): Initialized
	fieldsAlreadyWritten before recursion rather than after.
	* java/io/ObjectStreamClass.java (serialVersionUID): Added.
	* java/io/OptionalDataException.java (serialVersionUID): Added.
	(OptionalDataException): Made package private.
	* java/io/SyncFailedException.java (SyncFailedException): Removed
	default constructor to match spec.
	* java/lang/Boolean.java (serialVersionUID): Added.
	* java/lang/Byte.java (serialVersionUID): Added.
	* java/lang/Character.java (serialVersionUID): Added.
	* java/lang/Double.java (serialVersionUID): Added.
	* java/lang/Float.java (serialVersionUID): Added.
	* java/lang/Integer.java (serialVersionUID): Added.
	* java/lang/Long.java (serialVersionUID): Added.
	* java/lang/Number.java (serialVersionUID): Added.
	* java/lang/Short.java (serialVersionUID): Added.
	* java/lang/String.java (serialVersionUID): Added.
	* java/lang/ThreadDeath.java (ThreadDeath): Removed constructor
	to match spec.
	* java/lang/reflect/InvocationTargetException.java
	(serialVersionUID): Added.
	* java/net/URL.java (handler): Made transient.
	(hashCode): Added field for serialization, per spec. and use
	cached value if available.
	(serialVersionUID): Added.
	(URL): Initialize hashCode.
	(set): Adjust hashCode.
	(readObject): New Method to initialize the protocol handler when
	deserializing.
	(writeObject): New method.
	* java/text/BreakIterator.java: Removed 'implements Serializable'.
	* java/text/Collator.java: Removed 'implements Serializable'.
	* java/util/GregorianCalendar.java (serialVersionUID): Added.
	* java/util/Properties.java (serialVersionUID): Added.
	* java/util/Random.java (serialVersionUID): Added.
	(seed): Made private.
	(nextNextGaussian): Made private.
	(haveNextNextGaussian): Made private.
	* java/util/Stack.java (serialVersionUID): Added.
	* java/util/TimeZone.java (serialVersionUID): Added.
	* java/util/Vector.java (serialVersionUID): Added.

Serialization mods.

From-SVN: r36272
2000-09-08 19:37:09 +00:00
Bryce McKinlay f52c723967 Makefile.am (Thread.h): Don't be friends with native threads functions.
2000-09-07  Bryce McKinlay  <bryce@albatross.co.nz>

	* Makefile.am (Thread.h): Don't be friends with native threads
	functions.
	* Makefile.in: Rebuilt.
	* java/lang/Thread.java (interrupt_flag): Make package-private.

From-SVN: r36234
2000-09-07 13:09:41 +01:00
Tom Tromey 9579ea7efd Constructor.java (toString): Use `getName' for parameter types.
* 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
2000-09-06 22:24:34 +00:00
Tom Tromey bcf98e48ef natMethod.cc (_Jv_CallAnyMethodA): Accept null `args' if method takes no parameters.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Accept null
	`args' if method takes no parameters.

From-SVN: r36209
2000-09-06 21:20:45 +00:00
Tom Tromey 8ee4db6f3a Fix for PR java.lang/339:
* 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
2000-09-06 18:14:15 +00:00
Bryce McKinlay 820112852a natIconv.cc (read): Remove unused local.
2000-09-05  Bryce McKinlay  <bryce@albatross.co.nz>

	* gnu/gcj/convert/natIconv.cc (read): Remove unused local.
	(write): Ditto.
	* gnu/gcj/runtime/FileDeleter.java (deleteOnExitNow): Check for null
	stack. Synchronize.
	* java/lang/fdlibm.h: #undef __P if previously defined.
	* java/lang/natSystem.cc (currentTimeMillis): Remove unused local.
	* java/net/natPlainDatagramSocketImpl.cc (send): Remove unreachable
	block.
	(mcastGrp): Ditto.

From-SVN: r36158
2000-09-05 12:05:59 +01:00
Anthony Green a1fa0b27e7 re GNATS java.io/203 (File.createTempFile doesn't close descriptor)
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-04 20:57:18 +00:00
Anthony Green 890a31f478 File.java (deleteOnExit): New method.
* java/io/File.java (deleteOnExit): New method.
        * gnu/gcj/runtime/FileDeleter.java: New class.
        * java/lang/natRuntime.cc (exit): Call
        FileDeleter.deleteOnExitNow()
        * Makefile.am: Add FileDeleter.java.
        * Makefile.in: Rebuilt.

From-SVN: r36141
2000-09-04 16:55:48 +00:00
Anthony Green 6aaeb97551 Makefile.in: Rebuilt.
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
2000-08-26 19:25:13 +00:00
Anthony Green 1a558147d1 natSystem.cc (init_properties): Change sourceware reference to sources.redhat.com.
Sun Aug 20 21:02:48 2000  Anthony Green  <green@redhat.com>

	* java/lang/natSystem.cc (init_properties): Change sourceware
	reference to sources.redhat.com.

	* include/java-props.h: Add _Jv_Jar_Class_Path.
	* prims.cc: Ditto.  Set it from	`gij -jar file' option.

	* java/lang/natSystem.cc (init_properties): Set java.class.path
	from
	{gij -jar file}:{CLASSPATH variable}:{-Djava.class.path= or .}

	* java/util/PropertyPermission.java: Import from GNU Classpath.
	* Makefile.in: Rebuilt.
	* Makefile.am: Add java/util/PropertyPermission.java.
	* java/lang/System.java: Add setProperty method.

	* gij.cc (main): Add -jar option to execute jar files.
	(help): Describe -jar option.
	* prims.cc (_Jv_RunMain): Add support for jar execution mode.
	* gnu/gcj/tools/Gij.java: New file.
	* include/jvm.h: Add is_jar argument to _Jv_RunMain.
	* gnu/gcj/runtime/FirstThread.java (main): New method.

	* java/util/jar/Attributes.java: Correct comment spelling.

From-SVN: r35829
2000-08-21 06:05:20 +00:00
Alexandre Petit-Bianco 0fcbfa82cf natClass.cc (finit_name): Initialized with `finit$'.
2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * java/lang/natClass.cc (finit_name): Initialized with `finit$'.
        (finit_leg_name): New global.
        (java::lang::Class::getDeclaredMethods): Test for `finit$' or
        `$finit$'. This is a backward compatibility hack.
        (java::lang::Class::_getMethods): Likewise.

(http://sources.redhat.com/ml/java-discuss/2000-08/msg00031.html
 See also the matching compiler patch:
 http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00664.html)

From-SVN: r35769
2000-08-17 14:56:29 -07:00
Tom Tromey d7ec12ae74 Method.java (hashCode): Use getName().
* java/lang/reflect/Method.java (hashCode): Use getName().
	(toString): Likewise.
	* java/lang/reflect/natMethod.cc (getType): Initialize
	exception_types.

From-SVN: r35561
2000-08-08 03:34:51 +00:00
Tom Tromey 8ac80386ca PipedInputStream.java (read(byte[],int,int)): Mostly rewrote.
* java/io/PipedInputStream.java (read(byte[],int,int)): Mostly
	rewrote.
	(receive): Streamlined.

From-SVN: r35556
2000-08-07 19:59:48 +00:00
Tom Tromey f536cd95fb Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (libgcj_la_SOURCES): Added posix.cc.
	* java/net/natPlainSocketImpl.cc: Include posix.h.
	(accept): Use _Jv_select.
	* java/net/natPlainDatagramSocketImpl.cc: Include posix.h.
	(receive): Use _Jv_select.
	* java/io/natFileDescriptorPosix.cc: Include posix.h.
	(available): Use _Jv_select.
	* java/lang/natSystem.cc: Include posix.h.
	(currentTimeMillis): Use _Jv_gettimeofday.
	* include/posix.h: New file.
	* posix.cc: New file.

From-SVN: r35435
2000-08-02 21:54:04 +00:00
Bryce McKinlay 79c2c6da2c [multiple changes]
2000-08-02  Bryce McKinlay  <bryce@albatross.co.nz>

        * interpret.cc (_Jv_InterpMethod::continue1): Type of `fun' changed
	to match C declaration in ffi.h.
	* Makefile.am: Add java/awt/Button.java.
	* Makefile.in: Rebuilt.

2000-07-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
        cast of the second argument to `ffi_raw_call' changed to match
        prototype.

2000-07-26  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
        argument to `ffi_raw_call' changed to match prototype.

From-SVN: r35418
2000-08-02 04:25:13 +01:00
Warren Levy 7db51521a0 mauve-libgcj: Activated serialization tests.
* mauve-libgcj: Activated serialization tests.
	* gcj/field.h (getModifiers): Mask off unknown flags.
	* gnu/java/security/provider/SHA.java (munch): Reset buffer to 0 so
	spurious bits don't cause discrepancies.
	* java/io/ObjectOutputStream.java: Fixed typo in comment.
	* java/io/ObjectStreamClass.java: Fixed typos in comments.
	(lookup): Applied patch from Brian Jones <cbj@gnu.org> to optimize.
	(hasClassInitializer): Call getDeclaredMethod instead of getMethod.
	* java/lang/Throwable.java (serialVersionUID): New field.
	* java/lang/reflect/Modifier.java (ALL_FLAGS): Preserve STRICT if used.
	* java/lang/reflect/natConstructor.cc (getModifiers): Mask off
	unknown flags.
	* java/lang/reflect/natMethod.cc: Ditto.
	* java/security/Key.java (serialVersionUID): Removed field for now.
	* java/security/interfaces/DSAPrivateKey.java (serialVersionUID): Ditto.
	* java/security/interfaces/DSAPublicKey.java (serialVersionUID): Ditto.

Serialization mods.

From-SVN: r35302
2000-07-27 23:57:07 +00:00
Tom Tromey 5e5c1371d3 natClassLoader.cc (_Jv_PrepareCompiledClass): Only initialize String fields for interpreted classes.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Only
	initialize String fields for interpreted classes.  Fixes bug
	reported by Hans Boehm.

From-SVN: r35150
2000-07-20 19:31:16 +00:00
Jeff Sturm 5cc80caa27 natThrowable.cc (fillInStackTrace): Check for zero return from backtrace().
2000-07-19  Jeff Sturm  <jeff.sturm@appnet.com>

	* java/lang/natThrowable.cc (fillInStackTrace): Check for
	zero return from backtrace().

From-SVN: r35135
2000-07-19 14:37:56 +00:00
Tom Tromey 4ea9cbf197 natClassLoader.cc (_Jv_PrepareCompiledClass): Initialize static final String fields.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass):
	Initialize static final String fields.

From-SVN: r34910
2000-07-07 20:54:32 +00:00
Bryce McKinlay 06772c7d0e ThreadGroup.java: Added synchronized flag to many methods.
* ThreadGroup.java: Added synchronized flag to many methods.
	(destroyed_flag): Removed.
	(isDestroyed, removeGroup, removeThread): Test for parent == null.
	(activeCount): Added spec note.

From-SVN: r34750
2000-06-28 07:03:11 +01:00
Tom Tromey 260e1a2bb0 * java/lang/Double.java (valueOf): Call parseDouble().
From-SVN: r34737
2000-06-27 18:35:54 +00:00
Warren Levy 7b245d2461 PropertyChangeEvent.java (oldVal): Renamed to oldValue.
* java/beans/PropertyChangeEvent.java (oldVal): Renamed to oldValue.
	(newVal): Renamed to newValue.
	* java/beans/PropertyVetoException.java (changeEvent): Renamed to evt.
	* java/beans/beancontext/BeanContextServiceRevokedEvent.java
	(revokeNow): Renamed to invalidateRefs.
	* java/io/OptionalDataException.java: Updated FIXME.
	(eof): New placeholder field.
	(length); Ditto.
	* java/io/WriteAbortedException.java (message): Made transient.
	* java/lang/ClassNotFoundException.java: Updated comments for JDK 1.2.
	* java/lang/Throwable.java (stackTrace): Made transient.
	* java/net/InetAddress.java: Made Serializable.
	* java/security/KeyPair.java: Made Serializable.
	* java/security/Provider.java: Replaced with Classpath version that
	implements serialization and proper methods.
	* java/text/ChoiceFormat.java (strings): Renamed to choiceFormats.
	(limits): Renamed to choiceLimits.

Serialization changes per:
http://java.sun.com/products/jdk/1.2/docs/api/serialized-form.html

From-SVN: r34726
2000-06-27 05:10:03 +00:00
Tom Tromey cf036e712c natDouble.cc (parseDouble): Renamed from doubleValueOf.
* java/lang/natDouble.cc (parseDouble): Renamed from
	doubleValueOf.
	* java/lang/Double.java (parseDouble): Renamed from
	doubleValueOf.  Now public.

From-SVN: r34679
2000-06-24 18:11:01 +00:00
Andrew Haley 56e3dd2cea ieeefp.h: Handle ia64, fr30, mcore.
* java/lang/ieeefp.h: Handle ia64, fr30, mcore.
	* java/lang/natThrowable.cc: On IA-64, use __ia64_backtrace.

From-SVN: r34667
2000-06-23 19:53:33 +00:00
Tom Tromey 782c59d653 natMethod.cc: Include <alloca.h>.
* java/lang/reflect/natMethod.cc: Include <alloca.h>.
	* java/lang/natDouble.cc: Always include <alloca.h>.
	Fix for PR libgcj/267.

From-SVN: r34665
2000-06-23 17:39:00 +00:00
Bryce McKinlay 0ee935e162 ThreadGroup.java (add(Thread)): Rename to addThread() to comply with classpath VM spec.
2000-06-21  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/ThreadGroup.java (add(Thread)): Rename to addThread() to
	comply with classpath VM spec.
	(add(Group)): Rename to addGroup().
	* java/lang/Thread.java (Thread): Use addThread().
	* java/lang/natThread.cc (finish_): Use removeThread().

From-SVN: r34627
2000-06-21 04:55:35 +01:00
Bryce McKinlay 6dfd8a7790 ThreadGroup.java: Merged with classpath.
2000-06-20  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/ThreadGroup.java: Merged with classpath.
	* prims.cc (_Jv_RunMain): Don't use 
ain_group'.
	* gnu/gcj/runtime/FirstThread.java: Remove ThreadGroup constructor
	argument.
	* java/lang/Thread.java (Thread): Bootstrap initial thread from
	ThreadGroup.root if Thread.currentThread is null. Honour the
	ThreadGroup's max priority setting.

From-SVN: r34615
2000-06-20 14:30:14 +01:00
Tom Tromey d4d17e95f1 re GNATS gcj/260 ("Klass.class" expression should cause Klass to be initialized)
* java/lang/natClass.cc (forName): Removed dead code.  Initialize
	returned class.  For PR gcj/260.

From-SVN: r34590
2000-06-18 22:14:06 +00:00
Bryce McKinlay 1bf8972740 2000-06-15 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR java.lang/258:
	* prims.cc (_Jv_PrimClass): Set state of primitive class to
	JV_STATE_DONE, to prevent accidental initialization.
	* java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
	_Jv_InterfaceAssignableFrom if target is an interface and source is
	an interface or an abstract class. Remove redundant initializeClass
	calls. Remove duplicate if_idt test.
	(_Jv_InterfaceAssignableFrom): New function.
	* java/lang/Class.h (_Jv_InterfaceAssignableFrom): Prototype.

From-SVN: r34563
2000-06-15 13:04:50 +01:00
Bryce McKinlay d655f87d6f 2000-06-15 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR java.lang/258:
	* prims.cc (_Jv_PrimClass): Set state of primitive class to
	JV_STATE_DONE, to prevent accidental initialization.
	* java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
	_Jv_InterfaceAssignableFrom if target is an interface and source is
	an interface or an abstract class. Remove redundant initializeClass
	calls. Remove duplicate if_idt test.
	* java/lang/Class.h (_Jv_InterfaceAssignableFrom): New function.

From-SVN: r34562
2000-06-15 12:58:18 +01:00
Tom Tromey c74e221410 prims.cc (DECLARE_PRIM_TYPE): Define a vtable as well.
* prims.cc (DECLARE_PRIM_TYPE): Define a vtable as well.
	(_Jv_PrimClass): Set `methods' by calling _Jv_FindArrayClass.
	* include/jvm.h (struct _Jv_ArrayVTable): Declare.
	(NUM_OBJECT_METHODS): New define.
	* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
	`array_vtable' parameter.  Added assertion.
	* java/lang/Class.h (_Jv_FindArrayClass): Added `array_vtable'
	parameter.

From-SVN: r34312
2000-05-31 23:50:37 +00:00
Tom Tromey efc7058478 name-finder.h: Include <sys/wait.h>.
* include/name-finder.h: Include <sys/wait.h>.
	(_Jv_name_finder::pid): Now of type `pid_t'.
	(_Jv_name_finder::~_Jv_name_finder): Call waitpid().
	* java/lang/Throwable.java (CPlusPlusDemangler.close): Call
	`proc.waitFor()'.

From-SVN: r34279
2000-05-30 23:26:02 +00:00
Bryce McKinlay 1c02a3d964 re GNATS libgcj/226 (implicit __builtin_expect) and GNATS gcj/228 (compressed JAR files)
2000-05-20  Bryce McKinlay  <bryce@albatross.co.nz>

	Fix for PR libgcj/226:
	* java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect,
	since this is an installed header.

	Fix for PR libgcj/228:
	* java/util/zip/ZipFile (getInputStream): Create inflater with
	nowrapper option.

	* java/util/zip/natInflater.cc (inflate): Throw zlib's error message
	with DataFormatException.

From-SVN: r34064
2000-05-21 00:30:46 +01:00
Tom Tromey 6c80c45e30 Jumbo patch:
* Imported beans and serialization
* Updated IA-64 port
* Miscellaneous bug fixes

From-SVN: r34028
2000-05-19 17:55:34 +00:00
Bryce McKinlay fc5b21380e Thread.java: Declare `data' as Object, not RawData.
2000-05-18  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/Thread.java: Declare `data' as Object, not RawData.
	* java/lang/natThread.java (initialize_native): Cast `data' to
	jobject.
	* gnu/gcj/RawData.java: Clarify documentation.

From-SVN: r33981
2000-05-18 11:08:25 +01:00
Bryce McKinlay ac83e16bc4 StringBuffer.java (replace): Calculate length for arraycopy() correctly.
2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/StringBuffer.java (replace): Calculate length for
	arraycopy() correctly.

From-SVN: r33822
2000-05-10 12:13:17 +01:00
Bryce McKinlay fe517fb2c9 StringBuffer.java (delete): Call arrayCopy() correctly.
2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/StringBuffer.java (delete): Call arrayCopy() correctly.
	Avoid arrayCopy() call where possible. Update `count' _after_ calling
	arrayCopy().
	(replace): Reimplemented. Fix javadoc.
	(reverse): Call ensureCapacity_unsynchronized().
	(StringBuffer (String)): Use DEFAULT_CAPACITY.

From-SVN: r33819
2000-05-10 11:15:13 +01:00
Tom Tromey 2238de654f StringBuffer.java (toString): Don't mark buffer as shared.
* java/lang/StringBuffer.java (toString): Don't mark buffer as
	shared.
	(insert(int,char[],int,int): New method.
	(delete): New method from Classpath.
	(deleteCharAt): Likewise.
	(substring): Likewise.
	(shared): No longer private.
	Added JavaDoc comments from Classpath.
	* java/lang/String.java (String(StringBuffer)): Ensure `buffer' is
	shared.

From-SVN: r33809
2000-05-09 22:46:58 +00:00
Bryce McKinlay 9d4c21486c natClass.cc (isInstance): Use __builtin_expect.
2000-05-05  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natClass.cc (isInstance): Use __builtin_expect.
	(_Jv_IsAssignableFrom): Ditto.
	(_Jv_IsInstanceOf): Ditto.
	(_Jv_CheckCast): Ditto.
	(_Jv_CheckArrayStore): Ditto.
	* java/lang/Class.h (_Jv_InitClass): Ditto.
	* java/lang/natObject.cc (_Jv_MonitorEnter): __builtin_expect `false',
	not `0'.
	(notify): Ditto.
	(notifyAll): Ditto.
	(wait): Ditto.
	(_Jv_MonitorExit): Ditto.
	* boehm.cc (_Jv_MarkObj): Ditto.
	(_Jv_MarkObj): Ditto.
	(_Jv_MarkArray): Ditto.
	* prims.cc (_Jv_AllocObject): Ditto.
	(_Jv_NewObjectArray): Ditto.
	(_Jv_NewPrimArray): Ditto.
	(_Jv_Malloc): Ditto.
	(_Jv_Realloc): Ditto.
	(_Jv_MallocUnchecked): Ditto.
	(_Jv_divI): Ditto.
	(_Jv_remI): Ditto.
	(_Jv_divJ): Ditto.
	(_Jv_remJ): Ditto.

From-SVN: r33698
2000-05-05 03:56:14 +01:00
Tom Tromey f70b7142c2 Locale.java (Locale): Don't explicitly check for null.
* java/util/Locale.java (Locale): Don't explicitly check for
	null.
	* java/util/Hashtable.java (containsKey): Don't explicitly check
	for null.
	(get): Likewise.
	* java/util/BitSet.java (and, or, xor): Don't explicitly check for
	null.
	* java/util/zip/ZipEntry.java (ZipEntry): Don't explicitly check
	for null.
	* java/text/StringCharacterIterator.java
	(StringCharacterIterator): Don't check for null.
	* java/text/ChoiceFormat.java (setChoices): Don't explicitly check
	for null pointer.
	* java/net/MulticastSocket.java (joinGroup): Don't explicitly
	check for null pointer.
	(leaveGroup): Likewise.
	* java/net/DatagramPacket.java (DatagramPacket): Removed erroneous
	comment.
	(setData): Likewise.
	* java/lang/ThreadGroup.java (ThreadGroup): Don't explicitly check
	for `p==null'.

From-SVN: r33671
2000-05-04 15:50:34 +00:00
Bryce McKinlay 065ccab369 String.java (toString): Remove `final' hack.
2000-04-28  Bryce McKinlay  <bryce@albatross.co.nz>

	* libjava/java/lang/String.java (toString): Remove `final' hack.

From-SVN: r33508
2000-04-28 08:56:34 +01:00
Anthony Green 1143c0a03f + 2000-04-22 Anthony Green <green@cygnus.com> + + * include/jvm.h (__builtin_expect): Define as unused for now.
+ 2000-04-22  Anthony Green  <green@cygnus.com>
+
+ 	* include/jvm.h (__builtin_expect): Define as unused for now.
+ 	* java/lang/natObject.cc (_Jv_MonitorEnter): Add __builtin_expect.
+ 	(notify): Ditto.
+ 	(notifyAll): Ditto.
+ 	(wait): Ditto.
+ 	(_Jv_MonitorExit): Ditto.
+ 	* boehm.cc (_Jv_MarkObj): Ditto.
+ 	(_Jv_MarkObj): Ditto.
+ 	(_Jv_MarkArray): Ditto.
+ 	(_Jv_AllocBytes): Ditto.
+ 	* prims.cc (_Jv_AllocObject): Ditto.
+ 	(_Jv_NewObjectArray): Ditto.
+ 	(_Jv_NewPrimArray): Ditto.
+ 	(_Jv_Malloc): Ditto.
+ 	(_Jv_Realloc): Ditto.
+ 	(_Jv_MallocUnchecked): Ditto.
+ 	(_Jv_divI): Ditto.
+ 	(_Jv_remI): Ditto.
+ 	(_Jv_divJ): Ditto.
+ 	(_Jv_remJ): Ditto.
+
+ 	* include/Makefile.in: Rebuilt.
+ 	* include/Makefile.am (include_HEADERS): Add jvmpi.h.
+

From-SVN: r33339
2000-04-22 17:09:39 +00:00
Tom Tromey 7234f9bc03 re GNATS libgcj/15 (_REENTRANT should be defined more consistently)
Fix for PR libgcj/15:
	* java/util/natGregorianCalendar.cc (_REENTRANT,
	_POSIX_PTHREAD_SEMANTICS): Don't define.
	* java/net/natInetAddress.cc (_REENTRANT): Don't define.
	* java/lang/natSystem.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS):
	Don't define.
	* java/io/natFile.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS): Don't
	define.
	* configure: Rebuilt.
	* configure.in: If using POSIX threads, define _REENTRANT if
	needed.  Define _POSIX_PTHREAD_SEMANTICS.  Don't define
	GETHOSTBYNAME_R_NEEDS_REENTRANT.

From-SVN: r33318
2000-04-21 20:38:43 +00:00
Tom Tromey 18fcc4961b re GNATS libgcj/212 (build is broken on Linux/Alpha)
Fix for PR libgcj/212:
	* gcj/javaprims.h (_Jv_word, _Jv_word2): Removed definitions.
	* include/jvm.h (_Jv_word, _Jv_word2): Define.
	* java/lang/Class.h (_Jv_word): Declare.

From-SVN: r33292
2000-04-20 22:24:33 +00:00
Tom Tromey cc309dd512 natString.cc (intern): Temporarily disable finalizer registration.
* java/lang/natString.cc (intern): Temporarily disable finalizer
	registration.

From-SVN: r33127
2000-04-12 21:17:00 +00:00