2003-12-25 Michael Koch <konqueror@gmx.de>
* java/net/ServerSocket.java bind():
If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as
address to bind to.
From-SVN: r75023
* java/io/ObjectInputStream.java
(getField): Handle transient and non persistent fields.
(readClassDescriptor): Better error handling, use the right
class loader.
(readFields): Fields marked as not present in the stream
or not to be set are not read and set.
* java/io/ObjectInputStream.java
(readFields): Changed implementation of GetField.
(readClassDescriptor): Documented.
* java/io/ObjectOutputStream.java
(writeClassDescriptor): Added condition when to write class super
class information.
From-SVN: r74985
2003-12-22 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/GtkChoicePeer.java (postItemEvent): Rename to... (choicePostItemEvent): Change signature to more specific String object.
* java/awt/Choice.java (add): Generate ItemEvent for the first item
added.
(insert): Generate ItemEvent if insertion caused
selection to change.
(remove): Generate ItemEvent if removal cause selection to change.
(removeAll): Change algorithm to prevent generation of ItemEvents.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
(connect_choice_item_selectable_hook): Change argument type.
Fix argument value.
Make sure resources are feed by registering callback.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append): Adjust call to the
above function.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add): Ditto.
(item_activate): Ditto.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove): Destroy removed
menuitem.
(item_removed): New function. Free resources.
* jni/gtk-peer/gtkpeer.h (item_event_hook_info): Change member type and
name.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): Obtain MethodID for
choicePostItemEvent.
From-SVN: r74979
(selectThreadMutex): New field.
(selectThread): New field.
(unhandledWakeup): New field.
(implCloseSelector): Added skeleton code which
synchronizes as per Sun JRE JavaDoc.
(keys): Throw ClosedSelectorException if selector
is closed.
(selectNow): Added comment that we're faking out
an immediate select with a one-microsecond-timeout one.
(select): Use 0 instead of -1 for infinite timeout.
(implSelect): Changed comment in declaration.
(select): Added synchronized to method declaration.
Added synchronization and wakeup support as per Sun
JRE JavaDoc.
(selectedKeys): Throw ClosedSelectorException if selector
is closed.
(wakeup): Implemented.
(deregisterCancelledKeys): Synchronize on cancelled key
set before deregistering.
(register): Synchronize on key set before registering.
* java/nio/channels/spi/AbstractSelector.java
Added import for java.nio.channels.ClosedSelectorException.
(close): Added synchronized to method declaration.
(cancelledKeys): Throw ClosedSelectorException if selector
is closed.
(cancelKey): Synchronize on cancelled key set before key.
From-SVN: r74879
2003-12-20 Guilhem Lavaux <guilhem@kaffe.org>
* gnu/java/net/URLParseError.java: New file.
* gnu/java/net/protocol/jar/Handler.java
(parseURL): Throw URLParseError if needed, fix '/' handling.
* java/net/URL.java (URL): Catch URLParseError and
transform it into a MalformedURLException.
From-SVN: r74877
2003-12-19 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/FlowLayout.java (layoutContainer): Let components
assume their preferred height. Centre components vertically.
From-SVN: r74844
2003-12-19 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/ChannelInputStream.java: New file.
* java/nio/channels/Channels.java (newInputStream): Implemented.
* java/nio/channels/FileChannelImpl.java
(readImpl): Only put data into buffer if something was read.
* Makefile.am (ordinary_java_source_files):
Added gnu/java/nio/ChannelInputStream.java.
* Makefile.in: Regenerated.
From-SVN: r74842
2003-12-18 Fernando Nasser <fnasser@redhat.com>
* java/awt/List.java (replaceItem): Prevent selection to move with
replace and minimize flickering.
From-SVN: r74814
* java/io/ObjectInputStream.java
(lookupClass): New method.
(currentLoader): New method.
(inputGetObjectStreamClasses): New method.
(assignNewHandle): Documented.
(currentClassLoader): Documented.
* java/io/ObjectStreamClass.java
(setClass): Changed API. Better handling of the imported/exported
fields.
(getSerialPersistentFields): Make it throw previously caught exceptions
so they can handled in setClass.
From-SVN: r74693
2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
* java/io/ObjectStreamField.java: A few methods were added in prevision
of the upcoming upgrade of the serialization code. This also adds
some missing documentation.
(ObjectStreamField): We should throw a NullPointerException when 'name'
is null.
From-SVN: r74690
* java/net/DatagramSocket.java
(close): Directly return if socket is closed.
* java/net/ServerSocket.java
(close): Directly return if socket is closed.
* java/net/Socket.java
(close): Directly return if socket is closed.
From-SVN: r74470
2003-12-08 Fernando Nasser <fnasser@redhat.com>
* java/awt/datatransfer/StringSelection.java (getTransferData): Return
object of type expected by specified DataFlavor.
From-SVN: r74449
2003-12-08 Fernando Nasser <fnasser@redhat.com>
* java/awt/datatransfer/DataFlavor.java (getParameter): Fix off-by-one
error which was clipping off the first character of a parameter value.
From-SVN: r74448
* java/awt/Polygon.java
(translate): Fixed error that caused polygon
to move right/left when up/down translation was required.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
(getSelectionStart): Initialized start position to 0.
(getSelectionEnd): Initialized end position to 0.
(getCaretPosition): Initialized caret position to 0.
(getText): Initialized selected text to NULL
From-SVN: r74445
2003-12-08 Michael Koch <konqueror@gmx.de>
Fix for PR libgcj/13176.
* java/io/PrintStream.java: Partly revert my previous patches to get
(line_separator): New field.
(converter): New field.
(work): New field.
(work_bytes): New field.
(pw): Removed.
(closed): Removed.
(PrintStrean): Initialize converter and not pw.
(checkError): Flush always, pw doesn't exist anymore.
(close): Close underlying out stream.
(print): New method.
(writeChars): New method.
(print): Use new internal print method.
(println): Likewise.
From-SVN: r74419
* java/util/Hashtable.java (Hashtable(Map)): Use putAll, not
putAllInternal.
(putAllInternal): Correct comment.
* java/util/HashMap.java (HashMap(Map)): As above.
(putAllInternal): As above.
From-SVN: r74400
* java/net/DatagramPacket.java
(length): Made packge-private to make it accessible via CNI.
(maxlen): New field.
(DatagramPacket): Cleaned up.
(setSocketAddress): Add message to exception.
(setData): Call other setData().
(setData): Call setLength().
(setLength): Initialize maxlen too.
* gnu/java/net/natPlainDatagramSocketImplPosix.cc (peekData):
Get maximal length from maxlen field, set length field directly.
(receive): Likewise.
* gnu/java/net/natPlainDatagramSocketImplWin32.cc (peekData):
Get maximal length from maxlen field, set length field directly.
(receive): Likewise.
From-SVN: r74278
* configure.in: Added new MinGW-specific configure flag
--with-win32-nlsapi.
Added new AC_DEFINE MINGW_LIBGCJ_UNICODE.
Add -lunicows to MinGW SYSTEMSPEC if --with-win32-nlsapi
is set to unicows.
* configure: Rebuilt.
* include/config.h.in: Rebuilt.
* win32.cc (_Jv_Win32NewString): Implemented.
(nativeToUnicode): New helper function defined only for
non-UNICODE builds.
(unicodeToNative): Likewise.
(_Jv_Win32TempString): Implemented.
(lots): Refactored using tchar.h macros.
(WSAEventWrapper): Use _Jv_Win32NewString.
(_Jv_platform_initialize): Use GetModuleFileNameA instead
of GetModuleFileName.
(_Jv_platform_initProperties): Use _Jv_Win32NewString.
Use temporary stack buffer instead of a heap buffer.
* include/win32.h
Added defines for UNICODE and _UNICODE if MINGW_LIBGCJ_UNICODE is
defined; added tchar.h include.
(_Jv_Win32TempString): Declared new helper class.
(JV_TEMP_STRING_WIN32): New helper macro.
(_Jv_Win32NewString): Declared new helper method.
* java/io/natFileDescriptorWin32.cc (open): Use
JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
(write): Reformatted slightly.
* java/io/natFileWin32.cc (lots): Use tchar.h macros;
use JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
(getCanonicalPath): Use _Jv_Win32NewString instead of
JvNewStringUTF.
(performList): Likewise.
* java/lang/natWin32Process.cc (ChildProcessPipe):
Use tchar.h macros.
(startProcess): Use tchar.h macros, JV_TEMP_STRING_WIN32,
and UNICODE environment flag for CreateProcess.
* java/net/natNetworkInterfaceWin32.cc
(winsock2GetRealNetworkInterfaces): Use tchar.h macros and
_Jv_Win32NewString.
From-SVN: r74201
2003-12-02 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): New
method. Handle mouse and key events that must generate
ActionEvents.
* java/awt/List.java (getSelectedIndex): Return -1
if no list element is selected.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler):
Correct handling of mouse and key events so that List receives them.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
(Java_gnu_java_awt_peer_gtk_GtkListPeer_delItems): Fix removal of
multiple list elements.
From-SVN: r74189
2003-12-02 Ito Kazumitsu <kaz@maczuka.gcd.org>
* java/text/SimpleDateFormat.java (compileFormat):
isLowerCase() and isUpperCase() allow too many characters.
Just use >= 'A' && <= 'Z' || >= 'a' && <= 'z'.
From-SVN: r74188
2003-12-02 Mark Wielaard <mark@klomp.org>
Reported by Archie Cobbs:
* java/security/DigestInputStream.java (read(byte[], int, int): Call
digest.update() with temp, not len as lenght.
From-SVN: r74186
* java/net/DatagramSocket.java
(close): Close associated DatagramChannel object.
* java/net/ServerSocket.java
* java/net/Socket.java
(close): Reset impl and bound before calling getChannel().close() to
prevent from loops.
From-SVN: r74183
* java/awt/TextComponent.java:
(getSelectionStart): Updated javadocs.
(getSelectionEnd): Ditto.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer:
(getSelectionStart): Changed to return caret position if no
text is selected
(getSelectionEnd): Ditto.
From-SVN: r74124
* java/net/InetAddress.java:
(static): Don'f force DNS request for ANY_IF address.
2003-11-30 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java,
java/net/natInetAddressNoNet.cc,
java/net/natInetAddressPosix.cc,
java/net/natInetAddressWin32.cc:
Reverted my last patch.
From-SVN: r74074
2003-11-27 Dalibor Topic <robilad@kaffe.org>
* java/text/FieldPosition.java (equals): Adapted to handle
field_attribute. Added fast-circuit check for comparison to self.
Replaced use of instanceof by getClass to fix symmetry for derived
types.
(toString): Adapted to handle field_attribute. Improved readability.
(hashCode): New method.
2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
* java/text/FieldPosition.java (field_attribute): New field.
(FieldPosition (Format.Field), FieldPosition(Format.Field, int),
getFieldAttribute): New methods.
From-SVN: r73988
2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
* java/text/DecimalFormatSymbols.java (locale): New field.
(DecimalFormatSymbols (Locale)): Set locale.
(serialVersionOnStream): Upgraded to number 2.
(readObject): Assign locale if it wasn't by the serializer.
From-SVN: r73987
2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
* java/text/NumberFormat.java:
(getIntegerInstance) Added the java version in the comments.
2003-11-27 Mark Wielaard <mark@klomp.org>
* java/text/NumberFormat.java: Import java.io.InvalidObjectException.
(readResolve): Reformat.
2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
* java/text/NumberFormat.java
(NumberFormat.Field): New implemented class to match Java 1.4.
(getIntegerInstance): Two new Java 1.4 methods.o
From-SVN: r73985
2003-11-27 Ito Kazumitsu <kaz@maczuka.gcd.org>
* java/util/GregorianCalendar.java (getLinearTime): Avoid counting
the leap day of the leap year twice.
(computeFields): First week of month is 1 not 0.
From-SVN: r73984
2003-11-26 Guilhem Lavaux <guilhem@kaffe.org>
Mark Wielaard <mark@klomp.org>
* java/net/URLStreamHandler (parseUrl): Fixed URL parsing
('@' should be checked to distinguish port from userinfo).
(toExternalForm): Add @ userInfo if necessary.
Co-Authored-By: Mark Wielaard <mark@klomp.org>
From-SVN: r73953
* java/net/Socket.java
(implCreated): Dont set default value explicitely, added
documentation.
(inputShutdown): Likewise.
(outputShutdown): Likewise.
(bound): New private member variable.
(bind): Set bound to true.
(close): Set bound to false.
(isBound): Return bound.
* java/net/ServerSocket.java
(bound): New private member variable.
(bind): Set bound to true.
(close): Set bound to false.
(isBound): Return bound.
From-SVN: r73949
* java/net/Socket.java
(implCreated): New variable that indicates created impl.
(getImpl): New method.
(toString): Return more SUN compliant string representation.
(various): Use getImpl() instead of impl.
From-SVN: r73732
2003-11-14 Tom Fitzsimmons <fitzsim@redhat.com>
* java/awt/GridBagLayout.java (getLayoutDimensions): Return array of two
zero-length int arrays when layoutInfo is null.
(getLayoutWeights): Return array of two zero-length double arrays when
layoutInfo is null.
From-SVN: r73622
* jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to
JvGetStringUTFRegion.
* java/lang/natPosixProcess.cc (new_string): Pass length of string
to JvGetStringUTFRegion.
* java/lang/natDouble.cc (parseDouble): Pass length of string to
JvGetStringUTFRegion.
* java/lang/natWin32Process.cc (startProcess): Pass length of
string to JvGetStringUTFRegion.
* java/lang/natClass.cc (forName): Pass length of string to
JvGetStringUTFRegion.
* gnu/gcj/runtime/natNameFinder.cc (getExternalLabel): Pass length
of string to JvGetStringUTFRegion.
* gnu/gcj/convert/natIconv.cc (init): Pass length of string to
JvGetStringUTFRegion.
* gnu/awt/gtk/natGtkLabelPeer.cc (setText): Pass length of string
to JvGetStringUTFRegion.
* gnu/awt/gtk/natGtkButtonPeer.cc (setLabel): Pass length of
string to JvGetStringUTFRegion.
From-SVN: r73571
2003-11-11 Micheal Koch <konqueror@gmx.de>
* java/net/URLStreamHandler.java (toExternalForm): Print port only
if host is printed too and port was really given to URL.
From-SVN: r73445
PR libgcj/12231
* java/lang/Win32Process.java (hasExited) Changed from
public to private.
(startProcess): Likewise.
(cleanup): Likewise.
* java/lang/natWin32Process.cc (cleanup) Don't close
input, output and error streams.
(ChildProcessPipe): New helper class.
(startProcess): Refactored to use ChildProcessPipe.
Use CREATE_NO_WINDOW when launching child process.
From-SVN: r73326
* include/win32.h (_Jv_platform_close_on_exec): Changed
signature and declared extern.
* win32.cc (_Jv_platform_close_on_exec): Implemented.
* gnu/java/net/natPlainDatagramSocketImplWin32.cc
(create): Use new signature of _Jv_platform_close_on_exec.
* gnu/java/net/natPlainSocketImplWin32.cc
(create): Eliminated a few typecasts
Use new signature of _Jv_platform_close_on_exec.
(accept): Eliminated a few typecasts
Use new signature of _Jv_platform_close_on_exec.
* java/io/natFileDescriptorWin32.cc (open): Use
_Jv_platform_close_on_exec.
From-SVN: r73325
2003-10-29 Mark Wielaard <mark@klomp.org>
From Guilhem Lavaux <guilhem.lavaux@free.fr>
* java/text/DateFormat.java (Field): New public static inner class.
* java/text/Format.java (Field): Likewise.
(formatToCharacterIterator): New method.
* java/text/FormatCharacterIterator.java: New file.
2003-10-29 Mark Wielaard <mark@klomp.org>
From Guilhem Lavaux <guilhem.lavaux@free.fr>
* java/util/Currency.java: New file.
2003-10-29 Michael Koch <konqueror@gmx.de>
* Makefile.am (ordinary_java_source_files): Added
java/text/FormatCharacterIterator.java and java/util/Currency.java.
* Makefile.in: Regenerated.
From-SVN: r73046
2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz>
* java/lang/reflect/Constructor.java (toString): Avoid extra
whitespace on constructor with no modifiers.
* java/lang/reflect/natConstructor.java (newInstance): Look up
caller and perform accessibility check only if constructor is
non-public and accessible flag is not set.
2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz>
* jni.cc (_Jv_JNI_CallAnyMethodV, _Jv_JNI_CallAnyMethodA,
_Jv_JNI_CallAnyVoidMethodV, _Jv_JNI_CallAnyVoidMethodA): Don't
use _Jv_LookupDeclaredMethod(). Call _Jv_CallAnyMethodA with
is_virtual_call argument.
* include/jvm.h (_Jv_isVirtualMethod): Moved and renamed from
natClass.cc.
* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Use
_Jv_isVirtualMethod.
* java/lang/reflect/natMethod.cc (invoke): Don't use
_Jv_LookupDeclaredMethod.
(_Jv_CallAnyMethodA): New is_virtual_call argument. If specified,
look up method in target object's vtable.
From-SVN: r72942