Commit Graph

536 Commits

Author SHA1 Message Date
Tom Tromey 0bedbbdf1b For PR java/3562:
* java/lang/Class.h (Class(void)): Now private.  Removed
	implementation.  From dmorsberger@sensysdl.com.

From-SVN: r43781
2001-07-05 15:57:09 +00:00
Jeremy Nimmer e2a6abb6d5 For PR libgcj/3523:
2001-07-01  Jeremy Nimmer  <jwnimmer@alum.mit.edu>

	For PR libgcj/3523:
	* java/io/LineNumberReader.java (reset): Pass correct arguments to
	countLines.

From-SVN: r43683
2001-07-02 05:16:24 +00:00
Tom Tromey 62d73fa83b natFileDescriptorPosix.cc (open): Change error message formatting.
* java/io/natFileDescriptorPosix.cc (open): Change error message
	formatting.  From David Brownell.

From-SVN: r43564
2001-06-26 03:27:57 +00:00
Mark J. Roberts a0d4ddde2c BigInteger.java (byteArrayToIntArray): Don't include extraneous/malformed sign word.
2001-06-19  Mark J. Roberts  <mjr@statesmean.com>

	* java/math/BigInteger.java (byteArrayToIntArray): Don't include
	extraneous/malformed sign word.

From-SVN: r43455
2001-06-19 11:42:03 +00:00
Tom Tromey 6728a61d1f natRuntime.cc (_Jv_FindSymbolInExecutable): Return NULL if no library on the list has the symbol.
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
	NULL if no library on the list has the symbol.
	(init): Call add_library on the program itself.
	* prims.cc (JvRunMain): Initialize Runtime before searching for
	`main'.
	(_Jv_RunMain): Likewise.

From-SVN: r43413
2001-06-15 23:22:02 +00:00
Tom Tromey fc07ebe2a7 re PR libgcj/3144 (java.lang.Date.compareTo() not supported)
Fix for PR libgcj/3144:
	* java/util/Date.java: Merged with Classpath.

From-SVN: r43374
2001-06-14 15:41:57 +00:00
Tom Tromey 4c399c87ef re PR libgcj/3059 (System doesn't set java.home property)
Fix for PR libgcj/3059:
	* java/lang/natSystem.cc (init_properties): Define `java.home'.
	* Makefile.in: Rebuilt.
	* Makefile.am (AM_CXXFLAGS): Define PREFIX.

From-SVN: r43040
2001-06-08 19:09:04 +00:00
Martin Kahlert c90efa7a1c natClass.cc (_Jv_IsAssignableFrom): Ensure that ancestors table index is within allowed bounds.
2001-06-05  Martin Kahlert  <martin.kahlert@infineon.com>
	    Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* java/lang/natClass.cc (_Jv_IsAssignableFrom): Ensure that ancestors
	table index is within allowed bounds. Ensure that we dont try to access
	class itable at a negative offset. Avoid an ancestor table lookup if
	source is a primitive type class.
	(isInstance): Remove redundant isPrimitive() check.

Co-Authored-By: Bryce McKinlay <bryce@waitaki.otago.ac.nz>

From-SVN: r42898
2001-06-05 10:46:36 +01:00
Tom Tromey 0f2257011a PublicKey.java: Extend Key.
* java/security/PublicKey.java: Extend Key.
	* java/security/PrivateKey.java: Extend Key.

From-SVN: r42886
2001-06-04 22:55:49 +00:00
Anthony Green 20f914dc05 !defined(USE_LTDL) fix
From-SVN: r42813
2001-06-02 19:40:53 +00:00
Anthony Green c8fb98139d USE_LIBFFI change
From-SVN: r42791
2001-06-02 08:49:31 +00:00
Jeff Sturm e2f3946854 natFile.cc (get_entry): Removed functions.
* natFile.cc (get_entry): Removed functions.
(performList): Call readdir or readdir_r if HAVE_READDIR_R defined.
Allocate enough storage for d_name if using readdir_r.

From-SVN: r42767
2001-06-01 04:04:10 +00:00
Tom Tromey 66c8aed252 natFileDescriptorPosix.cc (open): Allocate buffer to correct size.
* java/io/natFileDescriptorPosix.cc (open): Allocate buffer to
	correct size.
	(write): Loop until write completes.  From Corey Minyard.

From-SVN: r42749
2001-05-31 17:33:05 +00:00
Laurent Guerby 916f3579cc Rectangle2D.java: fix doc typo.
2001-05-29  Laurent Guerby  <guerby@acm.org>

	* java/awt/geom/Rectangle2D.java: fix doc typo.

From-SVN: r42746
2001-05-31 16:48:15 +00:00
Tom Tromey 5980a00aeb DriverManager.java (getDrivers): Handle case where driver's class loader is null.
* java/sql/DriverManager.java (getDrivers): Handle case where
	driver's class loader is null.  From Corey Minyard.

From-SVN: r42745
2001-05-31 16:18:55 +00:00
Tom Tromey cb894e07ec natString.cc (init): Throw ArrayIndexOutOfBoundsException.
* java/lang/natString.cc (init): Throw
	ArrayIndexOutOfBoundsException.
	(getChars): Likewise.
	(getBytes): Likewise.
	(valueOf): Likewise.

From-SVN: r42531
2001-05-24 18:06:03 +00:00
Tom Tromey cf6b8de459 configure.in: Only allow hash synchronization when POSIX threads are enabled.
* configure.in: Only allow hash synchronization when POSIX threads
	are enabled.
	* java/lang/natObject.cc (alloc_heavy): Properly find `init' field
	of sync info object.

From-SVN: r42530
2001-05-24 18:03:47 +00:00
Tom Tromey 3610e0d548 [multiple changes]
2001-05-23  Tom Tromey  <tromey@redhat.com>

	* posix-threads.cc (_Jv_self_cache): Renamed from self_cache.
	* gcj/Makefile.in: Rebuilt.
	* gcj/Makefile.am (gcj_HEADERS): Added libgcj-config.h.
	* gcj/javaprims.h: Include gcj/libgcj-config.h.
	* gcj/libgcj-config.h.in: New file.
	* libgcj.spec.in (*jc1): Added @HASH_SYNC_SPEC@.
	* configure: Rebuilt.
	* configure.in: Enable hash synchronization by default on some
	platforms.
	(HASH_SYNC_SPEC): New subst.
	(AC_CONFIG_HEADER): Added gcj/libgcj-config.h.
	Correctly use `test -z' instead of `test -n' in a couple places.
	(JV_HASH_SYNCHRONIZATION): Use AC_DEFINE; don't add to
	LIBGCJ_CXXFLAGS.
	* configure.host (enable_java_net_default): Initialize.
	(enable_hash_synchronization_default): New variable.

2001-05-23  Hans Boehm <Hans_Boehm@hp.com>

	* boehm.cc (_Jv_MarkObj): Don't mark sync_info when hash
	synchronization in use.
	(_Jv_MarkArray): Likewise.
	(_Jv_AllocBytes): Don't check return result.
	(handle_out_of_memory): New function.
	(_Jv_InitGC): Set GC_oom_fn.
	(trace_one_vtable): New global.
	(_Jv_AllocTraceOne): New function.
	* configure.in: Added --enable-hash-synchronization.
	* defineclass.cc, prims.cc, resolve.cc, java/lang/natString.cc,
	java/net/natInetAddress.cc: Remove _Jv_AllocBytesChecked.
	* nogc.cc (_Jv_AllocObj): Throw out-of-memory.
	(_Jv_AllocArray): Likewise.
	(_Jv_AllocBytes): Likewise.
	(_Jv_AllocPtrFreeObject): New function.
	(_Jv_AllocTraceOne): Likewise.
	* posix-threads.cc (_Jv_ThreadRegister): Handle slow
	pthread_self().
	(self_cache): New global.
	(_Jv_ThreadSelf_out_of_line): New function.
	* prims.cc (_Jv_AllocBytesChecked): Removed.
	(_Jv_ThrowNoMemory): New function.
	(_Jv_AllocObject): Don't check for null return from allocator.
	(_Jv_NewObjectArray): Likewise.
	(_Jv_AllocPtrFreeObject): New function.
	(_Jv_NewPrimArray): Allocate pointer-free object if possible.
	* include/javaprims.h (_Jv_AllocPtrFreeObject): Declare.
	(_Jv_MonitorEnter, _Jv_MonitorExit): Don't return value.
	* include/boehm-gc.h (_Jv_AllocObj): Define.
	(_Jv_AllocPtrFreeObj): Define.
	* include/jvm.h (_Jv_AllocPtrFreeObj): Declare.
	(_Jv_ThrowNoMemory): Declare.
	(_Jv_AllocTraceOne): Declare.
	(_Jv_AllocBytesChecked): Removed.
	* include/posix-threads.h (_Jv_MutexInit, _Jv_MutexLock,
	_Jv_MutexUnlock): Handle LOCK_DEBUG.
	(_Jv_ThreadSelf): Handle case where system pthread_self() is
	slow.
	* java/lang/Class.h (Class): Declare _Jv_AllocPtrFreeObj as
	friend.
	* java/lang/Object.h (sync_info): Conditional upon presence of
	hash synchronization.
	* java/lang/natObject.cc: Much new code to handle thin locks and
	hash synchronization.
	* java/lang/natString.cc (_Jv_AllocString): Allocate pointer-free
	object if possible.

From-SVN: r42519
2001-05-24 05:40:37 +00:00
Per Bothner c93d7fae7b Implement invocation interface; don't create new thread for main.
From-SVN: r42428
2001-05-21 23:47:48 -07:00
Per Bothner ef0a7b49a9 javaprims.h (_Jv_FormatInt): New declaration.
* gcj/javaprims.h (_Jv_FormatInt):  New declaration.
	* java/lang/natString.cc (_JvFormatInt):  New primitive, with logic
	taken from old Integer.toString code.
	(Integer::valueOf):  Use _Jv_FormatInt.
	* java/lang/Integer.java (toString):  Just use call String.valueOf.
	* java/lang/Long.java (toString):  Fix typo in comment.
	* java/lang/String.java (valueOf(int)):  Make native.
	* java/lang/StringBuffer.java (append(int)):  Make native.
	* java/lang/natStringBuffer.cc:  New file, for append(jint).
	* Makefile.am (ant_source_files):  Add java/lang/natStringBuffer.cc.

From-SVN: r42419
2001-05-21 21:38:37 -07:00
Bryce McKinlay ca1906ff9a [multiple changes]
2001-05-18  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* include/jvm.h: Move "#pragma GCC java_exceptions" to ...
	* gcj/javaprims.h: ... here.
	* gnu/gcj/io/shs.cc: Add "#pragma GCC java_exceptions".

2001-05-17  Martin Kahlert  <martin.kahlert@infineon.com>

	* java/lang/natClass.cc (_Jv_FindIIndex): Fix an off by one error
	with length of ioffset table.
	(_Jv_IsAssignableFrom): Likewise.

From-SVN: r42248
2001-05-18 07:29:11 +01:00
Tom Tromey 26ec4f47ba SimpleDateFormat.java (parse): Handle non-dst time zones.
* java/text/SimpleDateFormat.java (parse): Handle non-dst time
	zones.

From-SVN: r42156
2001-05-16 15:34:46 +00:00
Tom Tromey 6f4226f843 GregorianCalendar.java (computeTime): Only call getTimeZone() once.
* java/util/GregorianCalendar.java (computeTime): Only call
	getTimeZone() once.

From-SVN: r42121
2001-05-15 21:44:24 +00:00
Tom Tromey 127699902e SimpleDateFormat.java (parse): Clear DST_OFFSET and ZONE_OFFSET just before computing the time.
* java/text/SimpleDateFormat.java (parse): Clear DST_OFFSET and
	ZONE_OFFSET just before computing the time.

From-SVN: r42076
2001-05-14 17:40:29 +00:00
Richard Henderson 5a0bf1eed1 configure.in (ia64-*): Don't set SYSDEP_SOURCES.
* configure.in (ia64-*): Don't set SYSDEP_SOURCES.
        * java/lang/natThrowable.cc: Don't use __ia64_backtrace.

From-SVN: r41984
2001-05-11 23:25:03 -07:00
Tom Tromey dac975d3d9 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added Polygon.java.
	* java/awt/Polygon.java: New file.

	* java/awt/geom/AffineTransform.java
	(setToRotation(double,double,double)): New method.
	(AffineTransform): Set type to TYPE_GENERAL_TRANSFORM.
	(setToShear): Likewise.

From-SVN: r41954
2001-05-11 01:03:45 +00:00
Tom Tromey 9622762678 [multiple changes]
2001-05-10  Tom Tromey  <tromey@redhat.com>

	* java/util/GregorianCalendar.java: Imported from Classpath.
	* gnu/java/locale/LocaleInformation_nl.java: New file from
	Classpath.
	* gnu/java/locale/LocaleInformation_en.java: Likewise.
	* gnu/java/locale/LocaleInformation_de.java: Likewise.
	* gnu/java/locale/LocaleInformation.java: Likewise.
	* natGregorianCalendar.cc: Removed.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Removed
	natGregorianCalendar.cc.

2001-05-10  Tom Tromey  <tromey@redhat.com>

	* java/text/SimpleDateFormat.java (computeCenturyStart): New
	method.
	(defaultCenturyStart): Use it.
	(readObject): Likewise.
	(SimpleDateFormat): Clear the calendar.  Set the grouping on the
	number format.
	(parse): Copy the calendar before modifying it.  Correctly handle
	the time zone.

	* java/util/Calendar.java (clear): Set field value(s) to 0.

2001-05-10  Jeff Sturm  <jsturm@one-point.com>

	* Calendar.java (get): Clear areFieldsSet if requested field
	is not set.
	(set): Unset fields that depend on new value.

From-SVN: r41942
2001-05-10 18:13:17 +00:00
Bryce McKinlay 7026707d15 Class.h (_Jv_Self): New union type.
* java/lang/Class.h (_Jv_Self): New union type.
	(Class): Manipulate vtable pointer via _Jv_Self union. Thanks to
	Jeff Sturm and Fergus Henderson.

	* java/lang/ClassLoader.java: Remove dead code fragment.

From-SVN: r41876
2001-05-06 14:42:11 +01:00
Matt Kraai dad362764f natFile.cc (performSetReadOnly): Fix #ifdef test.
2001-04-30  Matt Kraai  <kraai@alumni.carnegiemellon.edu>

	* java/io/natFile.cc (performSetReadOnly): Fix #ifdef test.
	(performDelete): Fix #endif placement.

From-SVN: r41703
2001-04-30 23:09:39 +00:00
Zack Weinberg ad34a822c1 * java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader): Use _Jv_Malloc.
From-SVN: r41651
2001-04-28 01:39:15 +00:00
Bryce McKinlay 0cd99be737 re PR libgcj/2237 (serialization doesn't throw exception on failure)
Fix PR libgcj/2237:
	* java/io/ObjectStreamClass.java (setClass): Calculate
	serialVersionUID for local class and compare it against the UID
	from the Object Stream. Throw InvalidClassException upon mismatch.
	(setUID): Renamed to...
	(getClassUID): this. Return the calculated class UID rather than
	setting uid field directly.
	(getDefinedSUID): Removed.
	* java/io/ObjectInputStream.java (resolveClass): Use the
	three-argument Class.forName().
	* java/io/InvalidClassException (toString): Don't include classname in
	result if it is null.

From-SVN: r41567
2001-04-26 03:02:05 +01:00
Kaveh R. Ghazi 9e65a913b6 natInetAddress.cc (java::net::InetAddress::aton): Wrap use of inet_pton in HAVE_INET6.
* java/net/natInetAddress.cc (java::net::InetAddress::aton):
	Wrap use of inet_pton in HAVE_INET6.

From-SVN: r41547
2001-04-25 20:27:06 +00:00
Bryce McKinlay 889a80aa95 Forgot this file on last commit.
From-SVN: r41544
2001-04-25 16:48:05 +01:00
Bryce McKinlay 28f7d9d05a decl.c (init_decl_processing): Add new class "protectionDomain" field.
gcc/java:

2001-04-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* decl.c (init_decl_processing): Add new class "protectionDomain"
	field.
	* class.c (make_class_data): Set initial value for "protectionDomain".

libjava:

2001-04-25  Bryce McKinlay  <bryce@albatross.co.nz>

	java.security merge and ClassLoader compliance fixes.

	* java/lang/Class.h (Class): Include ProtectionDomain.h.
	New protectionDomain field.
	(forName): Add initialize parameter. Fixes declaration to comply with
	JDK spec.
	* java/lang/natClass.cc (forName): Correct declaration of the three-arg
	variant. Honour	"initialize" flag.
	(getProtectionDomain0): New method.
	* java/lang/Class.java: Fix forName() declaration.
	(getPackage): New method based on Classpath implementation.
	(getProtectionDomain0): New native method decl.
	(getProtectionDomain): New method.
	* java/lang/ClassLoader.java (getParent): Now final.
	(definedPackages): New field.
	(getPackage): New.
	(defineClass): New variant with protectionDomain argument.
	(definePackage): New.
	(getPackages): New.
	(findSystemClass): Now final.
	(getSystemResourceAsStream): Remove redundant "final" modifier.
	(getSystemResource): Remove redundant "final" modifier.
	(getResources): Now final.
	(protectionDomainPermission): New static field.
	(unknownProtectionDomain): Ditto.
	(defaultProtectionDomain): Ditto.
	(getSystemClassLoader): Now non-native.
	* java/util/ResourceBundle.java (tryGetSomeBundle): Use the correct
	arguments for Class.forName().
	* java/lang/Package.java: New file.
	* gnu/gcj/runtime/VMClassLoader.java (getVMClassLoader): Removed.
	(instance): Static initialize singleton.
	(findClass): Override this, not findSystemClass.
	* java/lang/natClassLoader.cc (defineClass0): Set class's
	protectionDomain field as specified.
	(getSystemClassLoader): Removed.
	(findClass): Renamed from findSystemClass. Call the interpreter via
	URLClassLoader.findClass if loading class via dlopen fails.

	* java/security/*.java: java.security import/merge with Classpath.
	* java/security/acl/*.java: Likewise.
	* java/security/interfaces/*.java: Likewise.
	* java/security/spec/*.java: Likewise.
	* java/net/NetPermission.java: Likewise.
	* java/net/SocketPermission.java: Likewise.
	* gnu/java/security/provider/DefaultPolicy.java: Likewise.

	* Makefile.am: Add new classes.
	* Makefile.in: Rebuilt.
	* gcj/javaprims.h: CNI namespace rebuild.

From-SVN: r41543
2001-04-25 16:45:15 +01:00
Tom Tromey efc150d58b Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added Line2D.java.
	* java/awt/geom/Line2D.java: Wrote.

	* java/awt/Menu.java (addNotify): Wrote.

	* java/awt/PopupMenu.java (addNotify): Implemented.
	(show): Likewise.

	* java/awt/Scrollbar.java (addNotify): Call super.addNotify.
	* java/awt/List.java (addNotify): Call super.addNotify.
	* java/awt/Label.java (addNotify): Call super.addNotify.
	* java/awt/FileDialog.java (addNotify): Call super.addNotify.
	* java/awt/Dialog.java (addNotify): Call super.addNotify.
	* java/awt/Choice.java (addNotify): Call super.addNotify.
	* java/awt/CheckboxMenuItem.java (addNotify): Call super.addNotify.
	* java/awt/Checkbox.java (addNotify): Call super.addNotify.

	* java/awt/List.java (replaceItem): Notify peer.

	* java/awt/geom/Rectangle2D.java
	(Float.setRect(float,float,float,float)): New method.

	* java/awt/event/ContainerEvent.java (getContainer): Now returns
	Container.

	* java/awt/RenderingHints.java (Key): Class now public.

	* java/awt/Rectangle.java (Rectangle): Now implements
	Serializable.
	(getPathIterator): Removed.

	* java/awt/GraphicsConfiguration.java (GraphicsConfiguration): New
	constructor.

	* java/awt/FileDialog.java: Wrote.

	* java/awt/EventQueue.java (isDispatchThread): Now public.
	(invokeLater): Likewise.

	* java/awt/Component.java (setCursor): Update peer.
	(getFontMetrics): Use peer.

	* java/awt/ComponentOrientation.java (ComponentOrientation): Class
	now final.

From-SVN: r41492
2001-04-22 17:01:18 +00:00
Tom Tromey 760903c056 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added Line2D.java.
	* java/awt/geom/Line2D.java: Wrote.

	* java/awt/Menu.java (addNotify): Wrote.

	* java/awt/PopupMenu.java (addNotify): Implemented.
	(show): Likewise.

	* java/awt/Scrollbar.java (addNotify): Call super.addNotify.
	* java/awt/List.java (addNotify): Call super.addNotify.
	* java/awt/Label.java (addNotify): Call super.addNotify.
	* java/awt/FileDialog.java (addNotify): Call super.addNotify.
	* java/awt/Dialog.java (addNotify): Call super.addNotify.
	* java/awt/Choice.java (addNotify): Call super.addNotify.
	* java/awt/CheckboxMenuItem.java (addNotify): Call super.addNotify.
	* java/awt/Checkbox.java (addNotify): Call super.addNotify.

	* java/awt/List.java (replaceItem): Notify peer.

	* java/awt/geom/Rectangle2D.java
	(Float.setRect(float,float,float,float)): New method.

	* java/awt/event/ContainerEvent.java (getContainer): Now returns
	Container.

	* java/awt/RenderingHints.java (Key): Class now public.

	* java/awt/Rectangle.java (Rectangle): Now implements
	Serializable.
	(getPathIterator): Removed.

	* java/awt/GraphicsConfiguration.java (GraphicsConfiguration): New
	constructor.

	* java/awt/FileDialog.java: Wrote.

	* java/awt/EventQueue.java (isDispatchThread): Now public.
	(invokeLater): Likewise.

	* java/awt/Component.java (setCursor): Update peer.
	(getFontMetrics): Use peer.

	* java/awt/ComponentOrientation.java (ComponentOrientation): Class
	now final.

From-SVN: r41489
2001-04-22 03:05:39 +00:00
Tom Tromey f825e235a8 List.java: Wrote.
* java/awt/List.java: Wrote.
	* java/awt/Dialog.java: Wrote.

From-SVN: r41476
2001-04-21 02:48:35 +00:00
Warren Levy a6f5b6f958 natSystem.cc (getSystemTimeZone): Adjust for DST.
* java/lang/natSystem.cc (getSystemTimeZone): Adjust for DST.
	* java/text/SimpleDateFormat.java
	(indexInArray): Removed private method.
	(processYear): Removed private method.
	(parseLenient): Removed private method.
	(parseLeadingZeros): Removed private method.
	(parseStrict): Removed private method.
	(expect): Added new private method.
	(parse): Reverted to pre-Classpath merge version with minor fixes.
	* java/util/natGregorianCalendar.cc (computeTime): Handle strict
	calendars.

From-SVN: r41456
2001-04-20 09:43:52 +00:00
Bryce McKinlay 52c2897732 Makefile.am: Make a libtool convenience library.
libffi:
	* Makefile.am: Make a libtool convenience library.
	* Makefile.in: Rebuilt.

libjava:
	* java/io/File.java (normalizePath): New private method.
	(File (String)): Use normalizePath().
	(File (String, String)): Likewise.

	* Makefile.am (libffi_files): Removed.
	(libgcj.la): Link libffi as a convenience library instead of
	refering to its object files directly.
	* Makefile.in: Rebuilt.

From-SVN: r41298
2001-04-12 10:32:50 +01:00
Per Bothner ab9fa4b5d4 natString.cc (_Jv_NewStringUtf8Const): Register finalizer.
* java/lang/natString.cc (_Jv_NewStringUtf8Const):  Register finalizer.
	Recalculate hash, since Utf8Const's hash is only 16 bits.

	* java/lang/natString.cc (_Jv_StringFindSlot, rehash):  Use high-order
	bits of hash to calculate step for chaining.

	* java/lang/natString.cc (intern, _Jv_NewStringUtf8Const):  Rehash
	when 2/3 full, rather than 3/4 full.

From-SVN: r41233
2001-04-10 15:46:11 -07:00
Tom Tromey 0003efa0b3 PrintStream.java (out): Removed field.
* java/io/PrintStream.java (out): Removed field.  Fixes PR
	java/2449.
	(write): Call flush, not out.flush, per spec.
	(close): Flush output stream, per spec.  Handle
	InterruptedIOException.
	(checkError): Likewise.
	(flush, print, write): Handle InterruptedIOException per spec.
	(PrintStream): Don't create BufferedOutputStream.
	(work_bytes): New field.
	(writeChars): Use work_bytes.  Don't assume `out' is a
	BufferedOutputStream.

From-SVN: r41014
2001-04-02 21:16:38 +00:00
Torsten Rueger 5f82d4f21c re PR libgcj/2429 (java.text.MessageFormat should usefully set text on exceptions)
2001-04-02  Torsten Rueger  <torsten.rueger@firsthop.com>

	* java/text/MessageFormat.java (setLocale): Added missing `else'.
	For PR libgcj/2429.

From-SVN: r41012
2001-04-02 19:55:56 +00:00
Bryce McKinlay 8f58baf480 natSystem.cc (init_properties): Revert yesterday's changes to "file.separator"...
* java/lang/natSystem.cc (init_properties): Revert yesterday's changes
	to "file.separator", "path.separator", and "java.io.tmpdir" property
	initialization.
	* java/io/File.java: Likewise.
	* java/io/natFile.cc (init_native): Likewise.
	* java/io/natFileWin32.cc (init_native): Likewise.

From-SVN: r40994
2001-04-02 06:23:10 +01:00
Per Bothner a3b63299e6 natString.cc (intern): If string's data does not point to this String, make a fresh String that does.
* java/lang/natString.cc (intern):  If string's data does not point to
	this String, make a fresh String that does.

	* java/lang/natString.cc (unintern):  Replace by static function.
	* java/lang/String.java (unintern):  Remove method.

From-SVN: r40990
2001-04-01 14:54:10 -07:00
Per Bothner f44b63ae02 DeflaterOutputStream.java (deflate): Loop while def.needsInput.
* DeflaterOutputStream.java (deflate):  Loop while def.needsInput.
	(finish):  def.deflate needs to be called in a loop.
	(inbuf, inbufLength):  New private fields.
	(write(int)): Use inbuf.
	(write(byte[],int,int):  Check if pending output in inbuf.
	* ZipOutputStream.java:  Don't use Deflater if stored.
	Use a Checksum object directly, not via a CheckedOutputStream.
	(uncompressed_size):  New field,
	(closeEntry):  Only write data_directory if needed.
	(write):  If STORED, write directly.
	Always update crc, and uncompressed_size.
	(write_entry):  Fix lots of protocol erors.

From-SVN: r40988
2001-04-01 14:28:45 -07:00
Bryce McKinlay f404754042 1.3-Compliant Implementation of java.io.File.
* java/lang/natSystem.cc (init_properties): Get "file.separator",
	"path.separator", and "java.io.tmpdir" from the File class, instead
	of setting them explicitly.
	* java/io/File.java: Do not canonicalize paths for security manager
	checks. Call init_native() from static initializer. Do not pass path
	argument to native methods. New native method declarations. Some
	security manager checks moved to checkWrite().
	(equals): Check file system case sensitivity and act appropriatly.
	(hashCode): Likewise.
	(isHidden): New method implemented.
	(performList): Changed prototype. Now takes a class argument specifying
	the class of the returned array: Strings or File objects. Also added
	FileFilter argument.
	(listFiles): New variants with "File" return type implemented.
	(createTempFile): Use createNewFile(). Use maxPathLen.
	(setReadOnly): New method implemented.
	(listRoots): Likewise.
	(compareTo): Likewise.
	(setLastModified): Likewise.
	(checkWrite): New method.
	(setPath): Removed.
	* java/io/natFile.cc: Various functions no longer take canonical path
	argument.
	(stat): Handle ISHIDDEN query.
	(isAbsolute): Remove WIN32 cruft.
	(performList): New arguments. Handle returning either File[] or
	String[] arrays. Check with FileFilter or FilenameFilter arguments as
	appropriate. Use an ArrayList, not a Vector, for the temporary list.
	(performSetReadOnly): New method implemented.
	(performListRoots): Likewise.
	(performSetLastModified): Likewise.
	(performCreate): Likewise.
	(init_native): New initialization function.
	* java/io/natFileWin32.cc: Various functions no longer take canonical
	path argument.
	(stat): Add FIXME about ISHIDDEN query.
	(performList): New arguments. Handle returning either File[] or String[]
	arrays. Check with FileFilter or FilenameFilter arguments as
	appropriate. Use an ArrayList, not a Vector, for the temporary list.
	(performSetReadOnly): New. Stubbed.
	(performListRoots): Likewise.
	(performSetLastModified): Likewise.
	(performCreate): Likewise.
	(init_native) New initialization function.
	* configure.in: Check for utime() and chmod().
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.

	Resolves PR libgcj/1759.

From-SVN: r40985
2001-04-01 12:16:40 +01:00
Richard Henderson b3208f56cb exception.cc (java_eh_info): Make value type jthrowable.
* exception.cc (java_eh_info): Make value type jthrowable.
	(_Jv_type_matcher): Remove now unneeded cast.
	(_Jv_Throw): Make argument type jthrowable.  Munge name
	for SJLJ_EXCEPTIONS here ...
	* gcj/cni.h: ... not here.
	(JvThrow): Remove.
	* gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations.

	* defineclass.cc, interpret.cc, jni.cc, posix-threads.cc,
	prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc,
	gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc,
	gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc,
	gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc,
	java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc,
	java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc,
	java/lang/natClass.cc, java/lang/natClassLoader.cc,
	java/lang/natDouble.cc, java/lang/natObject.cc,
	java/lang/natPosixProcess.cc, java/lang/natRuntime.cc,
	java/lang/natString.cc, java/lang/natSystem.cc,
	java/lang/natThread.cc, java/lang/reflect/natArray.cc,
	java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc,
	java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc,
	java/util/zip/natInflater.cc:
	Use throw, not JvThrow or _Jv_Throw.

From-SVN: r40838
2001-03-25 23:05:32 -08:00
Bryce McKinlay f1cd4ab003 HashMap.java (HashMap): If 0 is given for initialCapacity paramater, bump it to 1.
2001-03-24  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/util/HashMap.java (HashMap): If 0 is given for initialCapacity
	paramater, bump it to 1.
	* java/util/Hashtable.java (Hashtable): Likewise.

From-SVN: r40812
2001-03-24 08:05:29 +00:00
Per Bothner 3c45ffa514 natDouble.cc (parseDouble): Cannot use errno to check for errors...
* java/lang/natDouble.cc (parseDouble):  Cannot use errno to
	check for errors, since we don't want to throw exception on
	overflow/underflow.  Instead, trim whitespace, and then check that
	_strtod_r uses up all the rest of the string.

From-SVN: r40800
2001-03-23 16:59:57 -08:00
Per Bothner 7a3155bef7 natClass.cc (_Jv_IsAssignableFrom): Checking the ancestors array is invalid for interfaces...
* java/lang/natClass.cc (_Jv_IsAssignableFrom):  Checking the
	ancestors array is invalid for interfaces, so do that *after*
	check that the target type is not an interface.

From-SVN: r40797
2001-03-23 16:21:24 -08:00