* gnu/java/nio/channels/FileChannelImpl.java: New class, renamed
from java/nio/channels. Don't depend on FileDescriptor.
(in, out, err): New static fields.
(mode): New field.
(SET, CUR, READ, WRITE, APPEND, EXCL, SYNC, DSYNC): Moved constants
from FileDescriptor.
(by): Removed MappedByteBuffer field.
(map): New working implementation.
* gnu/java/nio/channels/natFileChannelPosix.cc: New file, though
some code "ported" from natFileDescriptoPosix.cc.
* gnu/java/nio/channels/natFileChannelEcos.cc: Likewise.
* gnu/java/nio/channels/natFileChannelWin32.cc Likewise.
From-SVN: r78659
* java/io/ObjectInputStream.java
(readClassDescriptor): Keep elements of the mapping non null.
(checkTypeConsistency): New method.
(readFields): Fixed main loop and base logic. Small reindentation.
* java/io/ObjectStreamField.java
(lookupField): New method to update the field reference.
(checkFieldType): New method.
* java/io/ObjectStreamClass.java
(setClass, setFields): Call lookupField when building the field
database. Check the real field type.
From-SVN: r78627
* gnu/java/nio/FileLockImpl.java
(finalize): Made protected.
* java/nio/channels/FileChannel.java
(MapMode.READ_ONLY): Made final.
(MapMode.READ_WRITE): Made final.
(MapMode.PRIVATE): Made final.
* java/nio/channels/SocketChannel.java
(open): Simplified code.
* java/nio/channels/spi/AbstractSelectableChannel.java
(registered): Unused, removed.
(keyFor): Check channel is open, only locate key
and not add a new one.
(register): Don't delete attachments.
From-SVN: r78519
2004-02-25 Andrew Haley <aph@redhat.com>
PR java/14296:
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Make sure
we have a valid method index.
From-SVN: r78504
2004-02-26 Michael Koch <konqueror@gmx.de>
* Makefile.am: Generate and install headers for inner classes in
java.nio.channels.Pipe and gnu.java.nio.PipeImpl.
* Makefile.in: Regenerated.
From-SVN: r78493
2004-02-22 Zack Weinberg <zack@codesourcery.com>
Nathanael Nerode <neroden@twcny.rr.com>
Alexandre Oliva <aoliva@redhat.com>
boehm-gc:
libjava/libltdl:
* config.sub, config.guess: Replace with forwarding scripts
which invoke the master copies in the top level.
From-SVN: r78332
2004-02-20 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/jar/Handler.java
(): Removed unneeded check for file != null. java.net.URL.getFile()
returns an empty string but never null.
From-SVN: r78176
2004-02-19 Andrew Cagney <cagney@redhat.com>
* config.guess: Update from version 2003-10-16 to 2004-02-16.
* config.sub: Update from version 2003-11-03 to 2004-02-16.
Index: boehm-gc/ChangeLog
2004-02-19 Andrew Cagney <cagney@redhat.com>
* config.guess: Update from version 2002-01-10 to 2004-02-16.
* config.sub: Update from version 2002-01-02 to 2004-02-16.
Index: libjava/libltdl/ChangeLog
2004-02-19 Andrew Cagney <cagney@redhat.com>
* config.guess: Update from version 2003-10-07 to 2004-02-16.
* config.sub: Update from version 2003-10-07 to 2004-02-16.
From-SVN: r78171
2004-02-20 Michael Koch <konqueror@gmx.de>
* javax/swing/AbstractButton.java: Made several constants final.
(getRolloverSelectedIcon): Made public.
(getSelectedIcon): Made public.
From-SVN: r78169
* java/nio/ByteBuffer.java (endian): Make non-private so other
java.nio classes can inherit it.
(<init>): Don't bother clearing array_offset.
* java/nio/ByteBuffer.java (allocate): Re-implement using wrap.
* java/nio/ByteBuffer.java (get(byte[],int,int)): Check underflow.
Remove redundant test.
* java/nio/ByteBufferImpl.java (asCharBuffer, asShortBuffer,
asIntBuffer, asLongBuffer, asFloatBuffer, asDoubleBuffer):
Use new XxxViewBufferImpl constructors.
* java/nio/MappedByteBufferImpl.java: Likewise.
* java/nio/DirectByteBufferImpl.java: Likewise.
* java/nio/ByteBufferImpl.java: Remove one constructor.
Inline super in remaining constructor.
* java/nio/ByteBuffer.java: Remove unused constructor.
* java/nio/ByteBufferImpl.java (shiftDown): New optimized method.
* java/nio/ByteBufferImpl.java (get, put): Add array_offset.
* java/nio/DirectByteBufferImpl.java (owner): New field.
(offset): Remove unused field.
(<init>): Modify one and add another constructor. Change callers.
(allocateDirect): Removed - not used.
(getImpl, putImpl): Make static and pass address explicitly,
to make them useful for MappedByteBufferImpl.
(get, put): Check for underflow. Modify for new getImpl.
(getImpl): New native method where target is array.
(get(byte[],int,int)): Use the above.
(adjustAddress): New static native method.
(slice, duplicate, asReadOnly): New implementations.
* java/nio/natDirectByteBufferImpl.cc (getImpl, putImpl, shiftDown,
adjustAddress): New or updated native methods.
From-SVN: r77919
2004-02-15 Ito Kazumitsu <kaz@maczuka.gcd.org>
* java/io/ObjectInputStream.java (readClassDescriptor): Avoid the
overflow of fieldmapping.
From-SVN: r77843
2004-02-06 Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectInputStream.java: Made all calls
to dumpElement[ln] conditional on dump flag. (readObject): Changed to
use cached info from ObjectStreamClass. (readClassDescriptor):
Cache more information in ObjectStreamClass. (processResolution,
readFields): Use cached info from ObjectStreamClass.
(newObject): Throw exception instead of returning null for failure.
(getField, getMethod, callReadMethod, setBooleanField, setByteField,
setCharField, setDoubleField, setFloatField, setIntField,
setLongField, setShortField, setObjectField, readObjectParams):
Removed. (dumpElement, dumpElementln): Removed dump flag condition
check.
* java/io/ObjectStreamField.java (hasReadMethod): Removed.
(setClass): Added call to cacheMethods() (findMethod): New method.
(cacheMethods): New method. (ObjectStreamClass): Added call to
cacheMethods(). (setFields): Cache fields. (getClassUID): Use
AccessController.doPrivileged to invoke setAccessible.
(readObjectMethod, readResolveMethod, realClassIsSerializable,
realClassIsExternalizable, fieldMapping, firstNonSerializableParent):
New fields.
* java/io/ObjectStreamField.java (ObjectStreamField): New constructor.
(ObjectStreamField): Removed FIXME workaround. (getTypeString,
isPrimitive): Made safe for cases where type == null.
(setBooleanField, setByteField, setCharField, setShortField,
setIntField, setLongField, setFloatField, setDoubleField,
setObjectField): New methods.
From-SVN: r77395
2004-02-05 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/Scrollbar.java (next_scrollbar_number): New field.
(Scrollbar (int, int, int, int, int)): Make default page
increment 10.
(setValues): Only call peer.setValues if one of the values has
changed.
(generateName): New method.
(getUniqueLong): New method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
(range_scrollbar): Remove structure.
(post_adjustment_event): Remove function.
(post_change_event): Accept jobject argument.
(create): Cast jints to gdoubles. Round scrollbar values to the
nearest integer. Clamp min, max and value settings.
(connectJObject): Connect hook to widget->window.
(connectSignals): Remove range_scrollbar structure variables.
Remove "move-slider" connection. Pass global peer reference to
"value-changed" callback.
(setLineIncrement): Cast jint value to gdouble.
(setPageIncrement): Likewise.
(setValues): Likewise. Clamp min, max and value settings.
From-SVN: r77332
* gnu/java/nio/NIOServerSocket.java
(impl): Unused, removed.
* gnu/java/nio/SocketChannelImpl.java
(finnishConnect): Don't throw NoConnectionPendingException if not
connected or no connection pending.
From-SVN: r77317
* java/awt/geom/AffineTransform.java:
Corrected comments on the field definitions for
m11 and m10.
(shear): Fixed few errors that caused shear
transformation to be performed incorrectly.
(createInverse): Fixed to return correct
inverse of the given matrix.
From-SVN: r77261
2004-02-03 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkListPeer.java,
java/awt/BorderLayout.java, java/awt/CardLayout.java,
java/awt/CheckboxGroup.java, java/awt/Choice.java,
java/awt/Component.java, java/awt/Container.java,
java/awt/FontMetrics.java, java/awt/GridBagLayout.java,
java/awt/LayoutManager2.java, java/awt/List.java,
java/awt/Menu.java, java/awt/MenuBar.java,
java/awt/MenuItem.java, java/awt/Polygon.java,
java/awt/Rectangle.java, java/awt/ScrollPane.java,
java/awt/Scrollbar.java, java/awt/TextArea.java,
java/awt/TextField.java,
java/awt/image/renderable/RenderContext.java,
javax/swing/JApplet.java: Fix handling of alias methods, where a
method has been deprecated in favour of a new one with the same
funtion but a different name. Put the method implementation in
the deprecated method and have the new method call the
deprecated one. Make all other code call the new method.
From-SVN: r77178
(inChannelOperation): New field.
(isInChannelOperation): New accessor.
(setInChannelOperation): New modifier.
(receive): Use capacity() - position() of destination
buffer instead of remaining(). Set and reset our "in
channel operation indicator" before and after delegating
the receive to our datagram socket. Removed testing code.
Update destination buffer's current position if it is
backed by a byte array (hasArray() is true).
(send): Set and reset our "in channel operation indicator"
before and after delegating the send to our datagram socket.
Removed testing code. Update source buffer's current position
if it is backed by a byte array (hasArray() is true).
* gnu/java/nio/SocketChannelImpl.java (read(ByteBuffer)):
Use capacity() - position() of destination buffer instead
of remaining().
* java/net/DatagramSocket.java (receive): Don't throw an
IllegalBlockingModeException if we have a non-blocking
channel which initiated this operation.
(send): Likewise.
From-SVN: r77173
(inChannelOperation): New field.
(isInChannelOperation): New accessor.
(setInChannelOperation): New modifier.
* gnu/java/nio/ServerSocketChannelImpl.java
(accept): Set and reset our server socket's PlainSocketImpl's
"in channel operation" indicator before and after delegating
the accept to our server socket.
* gnu/java/nio/SocketChannelImpl.java
(connect): Set and reset our socket's PlainSocketImpl's "in channel
operation" indicator before and after delegating the operation to
our socket.
(read): Likewise.
(write): Likewise.
* java/net/ServerSocket.java (implAccept): Don't throw an
IllegalBlockingModeException if we have a non-blocking
channel which initiated this accept operation.
* java/net/Socket.java (connect): Don't throw an
IllegalBlockingModeException if we have a non-blocking
channel which initiated this connect operation.
* java/nio/channels/spi/AbstractSelectableChannel.java
(configureBlocking): Only call implConfigureBlocking() if
the desired blocking mode is different from our current one.
From-SVN: r76956
* java/io/BufferedReader.java (sbuf): New field.
(readLine): Use String.valueOf instead of new String() as per
Per Bothner's suggestion. Use instance sbuf field instead of a
local StringBuffer instance.
* java/io/InputStreamReader.java (read(char[],int,int)): Pass the
caller's buffer to refill().
(read(void)): Pass our internal work buffer to refill if our
input queue is empty.
(refill): Changed return type to int. Use the specified buffer
instead of our work buffer as per Bryce McKinlay's suggestion.
Return the number of characters read or -1 for EOF.
From-SVN: r76927
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(gtkLayoutSetVisible): New method
(setMenuBar): Hide layout before setting MenuBar
and reshow it after.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(gtkLayoutSetVisible): Hide or show the Gtk Layout.
From-SVN: r76861
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(removeMenuBarPeer): Remove MenuBarPeer argument.
* gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
(dispose): Call native method.
* java/awt/Frame.java (setMenuBar): Create and remove
MenuBar peers only if the Frame has a peer.
(addNotify): Create the MenuBar peer if one exists.
(removeNotify): Remove MenuBar peer if one exists.
* java/awt/Menu.java: Fix imports.
(addNotify): Don't use full class name.
(removeNotify): Call removeNotify on all children.
* java/awt/MenuBar.java (removeNotify): Call
removeNotify on all children.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(removeMenuBarPeer): Remove MenuBarPeer argument.
Iterate through children to find the Frame's MenuBar.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c
New file.
(dispose): Remove references to the MenuComponent.
From-SVN: r76740
2004-01-26 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (moveLayout): New
method.
(setMenuBar): Shift the Gtk layout up/down by the MenuBar
height and let the Layout Managers readjust anything that
needs to move.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(moveLayout): New method. Shift everything in the Gtk
layout in the Y direction by an offset.
From-SVN: r76729
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(handleEvent): Implemented. Handles PaintEvents.
(paint): Implemented. Use GTK native methods to queue updates
for this heavyweight peer.
* gnu/java/awt/peer/gtk/GtkContainerPeer.java
(handleEvent): Removed.
* java/awt/Component.java
(paint): Implemented. Explictly paint the heavyweight peer.
(update): Clear the background for heavyweight components.
(paintAll): No need to call peer.paint() anymore.
(processEvent): Don't process PaintEvents here. It's now done in
the peer's handleEvent().
(processPaintEvent): Removed.
* java/awt/Container.java
(paint): No need to call super.paint(). Visit heavyweight
children as well.
(update): Don't clear the background here. It's done in
Component.update().
(visitChildren): Added check to not recurse into Containers.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(filter_expose_event_handler): New method. Filter unwanted
expose events while painting heavyweight peers.
(Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilter):
New method. Connect filter and block pre_event_handler.
(Java_gnu_java_awt_peer_gtk_GtkComponentPeer_removeExposeFilter):
New method. Disconnect filter and unblock pre_event_handler.
(Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetQueueDrawArea):
New method. Invalidate and update given area.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(pre_event_handler): Add checks for unwanted expose events.
From-SVN: r76668
2004-01-25 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/TextArea.java: Fix indentation. Flesh out javadocs.
(getMinimumSize (int, int)): Fix FIXME -- return Dimension (0,0)
when peer is null.
(setColumns): Remove FIXME -- peer will retrieve number of
columns by calling getColumns.
(setRows): Likewise for number of rows.
(next_text_number): New field.
(paramString): Fix param string.
(generateName): New method.
(getUniqueLong): New method.
From-SVN: r76577
* config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR)
[!__powerpc64__]: Corrected to handle kernels with changed ucontext.
* include/powerpc-signal.h: Add #ifndef __powerpc64__ around the
header. For __powerpc64__ provide the default-signal.h definitions
for now.
* include/x86_64-signal.h [!__x86_64__]: Include java-signal-aux.h
instead of the dummy definitions.
* configure.host (x86_64-*): Remove CHECKREFSPEC, add DIVIDESPEC.
(powerpc64*-*): Remove with_libffi_default.
Only add -mminimal-toc for 64-bit compilations.
* configure.in: Use powerpc-signal.h on powerpc64 as well.
(x86_64-*-linux*): Set SIGNAL_HANDLER_AUX.
Link SIGNAL_HANDLER_AUX to include/java-signal-aux.h.
* configure: Rebuilt.
From-SVN: r76437
* java/io/FileDescriptor.java
(lock): New method.
(tryLock): New method.
(unlock): New method.
* java/io/natFileDescriptorEcos.cc
(lock): New method.
(tryLock): New method.
(unlock): New method.
* java/io/natFileDescriptorPosix.cc
(lock): New method.
(tryLock): New method.
(unlock): New method.
* java/io/natFileDescriptorWin32.cc
(lock): New method.
(tryLock): New method.
(unlock): New method.
From-SVN: r76421
* gnu/java/net/protocol/http/Connection.java
(connect): Don't initialize bufferedOutputStream if not needed.
(sendRequest): Set property for content length if content is present.
Write content only if present.
(getOutputStream): Check if already connected, dont connect,
initalize bufferedOutputStream if needed.
From-SVN: r76412
2004-01-23 Michael Koch <konqueror@gmx.de>
* java/io/FileDescriptor.java: Merged copyright with classpath to
start merging this class.
From-SVN: r76408
Michael Koch <konqueror@gmx.de>
* javax/swing/table/DefaultTableCellRenderer.java
(DefaultTableCellRenderer): Added javadoc for the class and for
the constructor, Border instance, create an EmptyBorder.
(UIResource): Removed the comment at the end of the class
(setForeground): New method.
(setBackground): New method.
(updateUI): New method.
(getTableCellRendererComponent): Rewritten with the help of
dvholten and Stephane Meslin-Weber.
(validate): New method.
(repaint): New method.
(firePropertyChange): New method.
(setValue): New method.
Co-Authored-By: Michael Koch <konqueror@gmx.de>
From-SVN: r76372
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(connectJObject): Replace printf calls with g_assert statements.
Move property-notify-event signal connection to ...
(connectSignals): Connect property-notify-event signal. Iterate
through the vbox's children to find layout.
From-SVN: r76367
* java/awt/Container.java
(LightweightDispatcher.handleEvent): Add an extra check to avoid
dispatching MOUSE_ENTERED event twice. Translate the point for
the mouse event target before dispatching the event.
From-SVN: r76278
2004-01-20 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkTextFieldPeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
(native create): Add width parameter.
(create): Calculate text entry width based on current font's
metrics and number of columns. Set TextField's font if not
already set. Call native create.
(gtkEntryGetBorderWidth): New native method.
(gtkEntryGetSize): Remove method.
(getMinimumSize): Call minimumSize.
(getPreferredSize): Call preferredSize.
(minimumSize): Calculate minimum size based on backing
GtkEntry's borders, font metrics and number of columns.
(preferredSize): Likewise for preferred size.
(get_border_width): New static function.
From-SVN: r76228
2004-01-20 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (setResizable):
Override GtkWindowPeer's setResizable method to account for menu
bar height when setting the frame's size.
From-SVN: r76227
* java/awt/EventQueue.java (pop): Prevent racing condition to add
events to the queue out of order by acquiring locks in the proper
order and not by releasing one before acquiring the other.
From-SVN: r76161
2004-01-19 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): Added
MenuBarPeer parameter.
(removeMenuBarPeer): New native method.
(setMenuBar): Call remove if menu bar is null. Adjust insets
appropriately.
(postSizeAllocateEvent): New method. Called when menu bar size is
allocated. Adjust insets and redo layout.
(GtkFramePeer): Set menu bar during frame creation.
(postConfigureEvent): Adjust position and size to accomodate
menu bar.
* java/awt/Frame.java (setMenuBar): addNotify to create menu bar.
* java/awt/Menu.java (addSeparator): Use peer's addSeparator.
(addNotify): Create the peer if it doesn't exist and call addNotify
for the menu's items.
* java/awt/MenuBar.java (addNotify): Create this menu bar's menus.
* java/awt/MenuItem.java (addNotify): Create the peer if it
doesn't exist.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(removeMenuBarPeer): New method. Remove menu bar on the current
frame.
(setMenuBarPeer): Add the menu bar to the current frame and the
callback for size-allocate events on the menu bar.
(getMenuBarHeight): Add menu bar parameter.
(menubar_resize_cb): New callback method for postSizeAllocate events.
Also: Fix indentation on last ChangeLog entry.
From-SVN: r76149
2004-01-16 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (GtkComponentPeer): If
it is a FileDialog and has dimensions of 0 by 0, then the initial
size is set to size request plus insets.
* gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
(gtkWidgetGetDimensions): Override method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(gtkWidgetGetDimensions): Override method. Returns size request plus
insets.
From-SVN: r75993
* java/awt/EventDispatchThread.java (run): Stop running when
interrupted.
* java/awt/EventQueue.java (pop): Stop dispatch thread when done.
Reset the queue after transferring its contents.
(push): Start a new dispatch thread if none is running.
From-SVN: r75977
* gnu/java/awt/peer/gtk/GdkGraphics2D.java:
Implemented rendering hints related methods.
(getDefaultHints): New helper method. Returns
default rendering hints.
(walkPath): changed to normalize path if
the KEY_STROKE_CONTROL key is in "normalize" mode.
(draw3DRect): changed coordinates of rectangle by +0.5
if in "normalize" mode.
From-SVN: r75943
2004-01-13 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkTextAreaPeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
(native create): Add width and height parameters. Set text
view's size request according to new parameters.
(create): Calculate text view size based on current font's
metrics and number of rows and columns. Set TextArea's font if
not already set. Call native create.
(getMinimumSize): Call minimumSize.
(getPreferredSize): Call preferredSize.
(getHScrollbarHeight): New method.
(getVScrollbarWidth): New method.
(minimumSize): Calculate minimum size based on scrollbar
visibility, scrollbar sizes, font metrics and number of rows and
columns.
(preferredSize): Likewise for preferred size.
(gtkTextGetSize): Remove method.
From-SVN: r75817
* gnu/java/awt/peer/gtk/GtkContainerPeer.java
(setBackground): New method. Children with no explicitly-set
background will be repainted with the parent container's new
background color.
From-SVN: r75809
* gnu/java/awt/peer/gtk/TestAWT.java: Fix test program so that it does
not show modal dialogs twice and so that it allows showing a modal
dialog from another modal dialog.
From-SVN: r75803
* java/awt/Dialog.java (show): Enable blocking for all modal dialogs
and run secondary dispatch thread to process event queue while this
thread is blocked.
From-SVN: r75788
* gnu/java/lang/reflect/TypeSignature.java
(getEncodingOfClass): Documentation fixed.
(getClassForEncoding): Give class loader to Class.forName().
Documentation fixed.
From-SVN: r75675