aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-23 17:03:31 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-23 17:03:31 +0000
commitdb15c6ea2fade1607d21e9365c02ea6e0c361e79 (patch)
tree07f55fdf8b411c9cb03cad72e957a303ed539089 /libjava
parent464f1309d38c5d20ba7c30c48034c89d399b2edc (diff)
Mainline merge as of 2003-07-22.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@69712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog308
-rw-r--r--libjava/Makefile.am11
-rw-r--r--libjava/Makefile.in66
-rw-r--r--libjava/acconfig.h3
-rwxr-xr-xlibjava/configure366
-rw-r--r--libjava/configure.in6
-rw-r--r--libjava/gcj/array.h4
-rw-r--r--libjava/gcj/cni.h2
-rw-r--r--libjava/gnu/awt/j2d/AbstractGraphicsState.java10
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java20
-rw-r--r--libjava/gnu/awt/xlib/XEventLoop.java13
-rw-r--r--libjava/gnu/awt/xlib/XGraphics.java16
-rw-r--r--libjava/gnu/gcj/runtime/NameFinder.java16
-rw-r--r--libjava/gnu/gcj/runtime/SharedLibLoader.java11
-rw-r--r--libjava/gnu/gcj/runtime/natSharedLibLoader.cc17
-rw-r--r--libjava/gnu/gcj/xlib/GC.java26
-rw-r--r--libjava/gnu/gcj/xlib/WMSizeHints.java20
-rw-r--r--libjava/gnu/gcj/xlib/WindowAttributes.java24
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkClipboard.java16
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java31
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java13
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImage.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkListPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java4
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java51
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java23
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java7
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_de.java2
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_en.java2
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_nl.java2
-rw-r--r--libjava/gnu/java/nio/FileChannelImpl.java399
-rw-r--r--libjava/gnu/java/nio/natFileChannelImpl.cc94
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServerRef.java11
-rw-r--r--libjava/include/config.h.in6
-rw-r--r--libjava/include/jvm.h5
-rw-r--r--libjava/include/posix.h4
-rw-r--r--libjava/java/awt/Container.java4
-rw-r--r--libjava/java/awt/Window.java14
-rw-r--r--libjava/java/awt/event/ActionEvent.java2
-rw-r--r--libjava/java/awt/geom/CubicCurve2D.java54
-rw-r--r--libjava/java/awt/geom/Line2D.java4
-rw-r--r--libjava/java/awt/geom/QuadCurve2D.java52
-rw-r--r--libjava/java/awt/geom/Rectangle2D.java2
-rw-r--r--libjava/java/awt/im/InputContext.java3
-rw-r--r--libjava/java/awt/image/MemoryImageSource.java5
-rw-r--r--libjava/java/beans/PropertyEditorManager.java14
-rw-r--r--libjava/java/io/FileInputStream.java2
-rw-r--r--libjava/java/io/FileOutputStream.java2
-rw-r--r--libjava/java/io/ObjectOutputStream.java5
-rw-r--r--libjava/java/io/RandomAccessFile.java2
-rw-r--r--libjava/java/lang/Class.h5
-rw-r--r--libjava/java/lang/Class.java46
-rw-r--r--libjava/java/lang/ClassLoader.java20
-rw-r--r--libjava/java/lang/Runtime.java4
-rw-r--r--libjava/java/lang/e_pow.c2
-rw-r--r--libjava/java/lang/fdlibm.h2
-rw-r--r--libjava/java/lang/natClass.cc87
-rw-r--r--libjava/java/lang/reflect/Field.java28
-rw-r--r--libjava/java/lang/reflect/natArray.cc31
-rw-r--r--libjava/java/lang/reflect/natConstructor.cc22
-rw-r--r--libjava/java/lang/reflect/natField.cc42
-rw-r--r--libjava/java/lang/reflect/natMethod.cc45
-rw-r--r--libjava/java/net/URL.java16
-rw-r--r--libjava/java/net/URLClassLoader.java10
-rw-r--r--libjava/java/nio/MappedByteBufferImpl.java2
-rw-r--r--libjava/java/util/logging/Handler.java2
-rw-r--r--libjava/java/util/zip/ZipFile.java2
-rw-r--r--libjava/javax/naming/CompoundName.java8
-rw-r--r--libjava/javax/naming/spi/NamingManager.java10
-rw-r--r--libjava/javax/swing/AbstractButton.java1463
-rw-r--r--libjava/javax/swing/ButtonModel.java8
-rw-r--r--libjava/javax/swing/SwingUtilities.java97
-rw-r--r--libjava/javax/swing/UIManager.java389
-rw-r--r--libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java174
-rw-r--r--libjava/javax/swing/event/AncestorEvent.java4
-rw-r--r--libjava/javax/swing/event/InternalFrameEvent.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLabelUI.java43
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLookAndFeel.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java17
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java32
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java10
-rw-r--r--libjava/jni.cc4
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c25
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c74
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c12
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c26
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c13
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h1
-rw-r--r--libjava/mauve-libgcj3
-rw-r--r--libjava/posix.cc1
-rw-r--r--libjava/prims.cc20
-rw-r--r--libjava/resolve.cc26
-rw-r--r--libjava/testsuite/ChangeLog24
-rw-r--r--libjava/testsuite/libjava.lang/SyncTest.java5
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp16
120 files changed, 2608 insertions, 2223 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 0377102851a..c6de2971303 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,311 @@
+2003-07-21 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (create): Remove unused method implementation.
+ (connectHooks): Remove debug messages.
+
+2003-07-20 Anthony Green <green@redhat.com>
+
+ * gnu/awt/j2d/AbstractGraphicsState.java (clone): Handle
+ CloneNotSupportedException.
+ * gnu/gcj/xlib/WindowAttributes.java (clone): Ditto.
+ * gnu/gcj/xlib/WMSizeHints.java (clone): Ditto.
+ * gnu/gcj/xlib/GC.java (clone): Ditto.
+ * gnu/awt/xlib/XGraphics.java (clone): Ditto.
+ * gnu/awt/j2d/Graphics2DImpl.java (clone): Ditto.
+
+ * gnu/awt/xlib/XEventLoop.java (postNextEvent): Remove unreachable
+ handler.
+ * gnu/gcj/runtime/NameFinder.java (NameFinder): Ditto.
+
+2003-07-20 Steve Pribyl <steve@netfuel.com.>
+
+ * gnu/gcj/runtime/natSharedLibLoader.cc (init): `libname' now a
+ String. Put dlerror() message into exception.
+ Include UnsatisfiedLinkError.
+ * gnu/gcj/runtime/SharedLibLoader.java (init): `libname' now a
+ String. Now native.
+
+2003-07-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Runtime.java: Comment fix.
+ * java/lang/ClassLoader.java (isAncestorOf): New method.
+ (getParent): Uncommented security check. Use isAncestorOf.
+ * include/jvm.h (_Jv_CheckAccess): Declare.
+ * java/lang/reflect/natConstructor.cc (newInstance): Perform
+ access check.
+ Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/natArray.cc (newInstance): Pass caller's
+ class loader to _Jv_GetArrayClass.
+ Include ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/Field.java: Update comment to reflect status.
+ (equals): Fixed indentation.
+ * java/lang/Class.h (Class): Declare memberAccessCheck, not
+ checkMemberAccess. Make _Jv_CheckAccess a friend.
+ * java/lang/Class.java (memberAccessCheck): New method from
+ Classpath.
+ (checkMemberAccess): Removed.
+ (getDeclaredMethod): Use memberAccessCheck.
+ (getField): Likewise.
+ (getMethod): Likewise.
+ * resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess.
+ (_Jv_SearchMethodInClass): Likewise.
+ * prims.cc (_Jv_CheckAccess): New function.
+ * jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal.
+ (_Jv_JNI_GetAnyFieldID): Likewise.
+ * java/lang/natClass.cc (forName): Use getClassLoaderInternal.
+ (getClassLoader): Added security check.
+ (getConstructor): Call memberAccessCheck.
+ (getDeclaredClasses): Likewise.
+ (getDeclaredField): Likewise.
+ (getDeclaredFields): Likewise.
+ (_getConstructors): Likewise.
+ (getDeclaredConstructor): Likewise.
+ (getDeclaredMethods): Likewise.
+ (getFields): Likewise.
+ (getMethods): Likewise.
+ (newInstance): Likewise.
+ (_Jv_MakeVTable): Put method name in exception.
+ * java/lang/reflect/natMethod.cc (getType): Use
+ getClassLoaderInternal.
+ (_Jv_GetTypesFromSignature): Likewise.
+ (invoke): Perform access check.
+ (_Jv_CallAnyMethodA): Removed old FIXME comments.
+ Include ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/natField.cc (getType): Use
+ getClassLoaderInternal.
+ (_Jv_CheckFieldAccessibility): Removed.
+ (getAddr): Use _Jv_CheckAccess; find caller.
+ Include ArrayIndexOutOfBoundsException.h.
+
+2003-07-20 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java
+ (URL): Fixed documentation to name an argument correcty, Reformatted
+ one method declaration.
+ (getURLStreamHandler): Added documentation from classpath.
+
+2003-07-19 Tom Tromey <tromey@redhat.com>
+
+ * mauve-libgcj: Don't run CollationElementIterator tests.
+
+2003-07-19 Jeroen Frijters <jeroen@sumatra.nl>
+
+ * java/net/URLClassLoader.java (addURL): Moved implementation to
+ private addURLImpl() to avoid calling addURL from the constructor.
+ (addURLImpl): Contains the code that was previously in addURL.
+ (addURLs): Call addURLImpl(), not addURL().
+
+2003-07-18 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c:
+ Handle missing event cases, connect to "value-changed" signal.
+
+2003-07-18 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/geom/CubicCurve2D.java,
+ java/awt/geom/Line2D.java,
+ java/awt/geom/QuadCurve2D.java,
+ java/awt/geom/Rectangle2D.java:
+ Fix path some calculations, make path iterators follow
+ a consistent style.
+
+2003-07-18 Mark Wielaard <mark@klomp.org>
+
+ * java/util/logging/Handler.java (isLoggable): Check record level
+ smaller or equal.
+
+2003-07-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkToolkit.java:
+ Reworked imports.
+
+2003-07-14 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/rmi/server/UnicastServerRef.java:
+ New version from classpath.
+
+2003-07-14 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/MemoryImageSource.java,
+ java/beans/PropertyEditorManager.java,
+ javax/naming/CompoundName.java,
+ javax/naming/spi/NamingManager.java,
+ javax/swing/AbstractButton.java,
+ javax/swing/ButtonModel.java,
+ javax/swing/SwingUtilities.java,
+ javax/swing/UIManager.java,
+ javax/swing/colorchooser/DefaultColorSelectionModel.java,
+ javax/swing/event/AncestorEvent.java,
+ javax/swing/event/InternalFrameEvent.java,
+ java/util/zip/ZipFile.java:
+ New versions from classpath.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/FileChannelImpl.java,
+ gnu/java/nio/natFileChannelImpl.cc: Removed.
+ * java/io/FileInputStream.java,
+ java/io/FileOutputStream.java,
+ java/io/RandomAccessFile.java,
+ java/nio/MappedByteBufferImpl.java:
+ Import java.nio.channels.FileChannelImpl instead of
+ gnu.java.nio.FileChannelImpl.
+ * java/nio/channels/FileChannelImpl.java,
+ java/nio/channels/natFileChannelImpl.cc:
+ New files.
+ * Makefile.am
+ (ordinary_java_source_files):
+ Removed gnu/java/nio/FileChannelImpl.java and added
+ java/nio/channels/FileChannelImpl.java.
+ (nat source_files):
+ Removed gnu/java/nio/natFileChannelImpl.cc and added
+ java/nio/channels/natFileChannelImpl.cc.
+ * Makefile.in: Regenerated.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicBorders.java,
+ javax/swing/plaf/basic/BasicLabelUI.java,
+ javax/swing/plaf/basic/BasicLookAndFeel.java,
+ javax/swing/plaf/basic/BasicTabbedPaneUI.java,
+ javax/swing/plaf/basic/BasicTextUI.java,
+ javax/swing/plaf/metal/MetalLookAndFeel.java:
+ New versions from classpath.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java
+ * gnu/java/awt/peer/gtk/GdkGraphics.java
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java
+ * gnu/java/awt/peer/gtk/GtkCanvasPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
+ * gnu/java/awt/peer/gtk/GtkClipboard.java
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java
+ * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java
+ * gnu/java/awt/peer/gtk/GtkGenericPeer.java
+ * gnu/java/awt/peer/gtk/GtkImage.java
+ * gnu/java/awt/peer/gtk/GtkImagePainter.java
+ * gnu/java/awt/peer/gtk/GtkLabelPeer.java
+ * gnu/java/awt/peer/gtk/GtkListPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuPeer.java
+ * gnu/java/awt/peer/gtk/GtkOffScreenImage.java
+ * gnu/java/awt/peer/gtk/GtkPanelPeer.java
+ * gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
+ * gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+ * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/locale/LocaleInformation_de.java
+ * gnu/java/locale/LocaleInformation_en.java
+ * gnu/java/locale/LocaleInformation_nl.java
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/EmbeddedWindow.java,
+ gnu/java/awt/EmbeddedWindowSupport.java,
+ gnu/java/awt/natEmbeddedWindow.cc:
+ New files.
+ * java/awt/Window.java
+ (Window): New constructor to support embedded windows.
+ * Makefile.am
+ (awt_java_source_files): Added gnu/java/awt/EmbeddedWindow.java and
+ gnu/java/awt/EmbeddedWindowSupport.java.
+ (nat_source_files): Added gnu/java/awt/natEmbeddedWindow.cc.
+ * Makefile.in: Regenerated.
+
+2003-07-11 Matt Kraai <kraii@alumni.cmu.edu>
+
+ * gnu/gcj/runtime/SharedLibLoader.java: Fix misspelling.
+ * gnu/gcj/runtime/natSharedLibLoader.cc: Likewise.
+ * java/awt/im/InputContext.java: Remove a redundant
+ partial line.
+
+2003-07-09 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (AM_MAKEFLAGS): Added CPPFLAGS.
+
+2003-07-09 Mark Wielaard <mark@klomp.org>
+
+ * java/io/ObjectOutputStream.java (writeObject): break after
+ calling writeClassDescriptor().
+
+2003-07-09 Mark Mitchell <mark@codesourcery.com>
+
+ * gcj/array.h (JvPrimClass): Don't parenthesize the output.
+
+2003-07-09 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java,
+ gnu/java/awt/peer/gtk/GtkContainerPeer.java,
+ gnu/java/awt/peer/gtk/GtkDialogPeer.java,
+ gnu/java/awt/peer/gtk/GtkWindowPeer.java:
+ Explicitly import used classes.
+ * java/awt/Container.java: New version from classpath.
+
+2003-07-09 Michael Koch <konqueror@gmx.de>
+
+ * libgcj.pc.in: New file.
+ * Makefile.am: Install libgcj.pc in $libdir/pkgconfig.
+ * Makefile.in: Regenerated.
+ * configure: Regenrated.
+ * configure.in: Create libgcj.pc from libgcj.pc.in.
+
+2003-07-08 Mark Wielaard <mark@klomp.org>
+
+ * gcj/cni.h: CNI now expands to Compiled Native Interface.
+
+ * java/lang/e_pow.c: CYGNUS LOCAL should be GCJ LOCAL.
+ * java/lang/fdlibm.h: Likewise.
+
+2003-07-07 Adam Megacz <adam@xwt.org>
+
+ * posix.cc: added #include<stdio.h>
+
+2003-07-07 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Fix
+ formatting.
+
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+ (setCaretPosition, setEditable): Rely entirely on native
+ implementation.
+ (getArgs): Remove.
+ (postTextEvent): New method.
+ (handleEvent): New method.
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java (handleEvent): New
+ method.
+ * java/awt/event/ActionEvent.java (paramString): Fix formatting.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (keysym_to_awt_keycode): Fix range checks.
+ (generates_key_typed_event): New function.
+ (awt_event_handler): Post AWT_KEY_RELEASED events to event
+ queue.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+ (gtkInit): Store TextComponent's postTextEvent method ID.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+ (setText): Post TEXT_VALUE_CHANGED event to event queue.
+
+2003-07-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Check for usleep declaration.
+ * acconfig.h (HAVE_USLEEP_DECL): Provide template.
+ * configure: Regenerate.
+ * include/config.h.in: Likewise.
+ * include/posix.h [!HAVE_USLEEP_DECL]: Declare usleep.
+
2003-07-01 Michael Koch <konqueror@gmx.de>
* gnu/gcj/convert/natIconv.cc
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 07d6db3cabc..de217371699 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -35,6 +35,9 @@ toolexeclib_LTLIBRARIES = libgcj.la lib-org-xml-sax.la lib-org-w3c-dom.la \
$(cond_gtk_ltlibrary) $(cond_x_ltlibrary)
toolexecmainlib_DATA = libgcj.spec
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libgcj.pc
+
jardir = $(datadir)/java
jar_DATA = libgcj-@gcc_version@.jar
@@ -748,6 +751,8 @@ gnu/awt/j2d/MappedRaster.java \
gnu/java/awt/BitMaskExtent.java \
gnu/java/awt/Buffers.java \
gnu/java/awt/ComponentDataBlitOp.java \
+gnu/java/awt/EmbeddedWindow.java \
+gnu/java/awt/EmbeddedWindowSupport.java \
gnu/java/awt/EventModifier.java \
gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
@@ -2104,7 +2109,6 @@ gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
gnu/java/nio/DatagramChannelImpl.java \
-gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
@@ -2265,6 +2269,7 @@ java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileChannelImpl.java \
java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
@@ -2570,7 +2575,7 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
-gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/awt/natEmbeddedWindow.cc \
gnu/java/nio/natFileLockImpl.cc \
gnu/java/nio/natSelectorImpl.cc \
java/io/natFile.cc \
@@ -2602,6 +2607,7 @@ java/net/natInetAddress.cc \
java/net/natPlainDatagramSocketImpl.cc \
java/net/natPlainSocketImpl.cc \
java/nio/natDirectByteBufferImpl.cc \
+java/nio/channels/natFileChannelImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natTimeZone.cc \
@@ -2734,6 +2740,7 @@ AM_MAKEFLAGS = \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index a138372c59f..bc78ea935ab 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -162,6 +162,9 @@ toolexeclib_LTLIBRARIES = libgcj.la lib-org-xml-sax.la lib-org-w3c-dom.la \
toolexecmainlib_DATA = libgcj.spec
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libgcj.pc
+
jardir = $(datadir)/java
jar_DATA = libgcj-@gcc_version@.jar
@@ -519,6 +522,8 @@ gnu/awt/j2d/MappedRaster.java \
gnu/java/awt/BitMaskExtent.java \
gnu/java/awt/Buffers.java \
gnu/java/awt/ComponentDataBlitOp.java \
+gnu/java/awt/EmbeddedWindow.java \
+gnu/java/awt/EmbeddedWindowSupport.java \
gnu/java/awt/EventModifier.java \
gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
@@ -1868,7 +1873,6 @@ gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
gnu/java/nio/DatagramChannelImpl.java \
-gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
@@ -2029,6 +2033,7 @@ java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileChannelImpl.java \
java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
@@ -2333,7 +2338,7 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
-gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/awt/natEmbeddedWindow.cc \
gnu/java/nio/natFileLockImpl.cc \
gnu/java/nio/natSelectorImpl.cc \
java/io/natFile.cc \
@@ -2365,6 +2370,7 @@ java/net/natInetAddress.cc \
java/net/natPlainDatagramSocketImpl.cc \
java/net/natPlainSocketImpl.cc \
java/nio/natDirectByteBufferImpl.cc \
+java/nio/channels/natFileChannelImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natTimeZone.cc \
@@ -2438,6 +2444,7 @@ AM_MAKEFLAGS = \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
@@ -2484,7 +2491,7 @@ MULTIDO = true
MULTICLEAN = true
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = ./include/config.h ./gcj/libgcj-config.h
-CONFIG_CLEAN_FILES = libgcj.spec libgcj-test.spec
+CONFIG_CLEAN_FILES = libgcj.pc libgcj.spec libgcj-test.spec
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
@@ -2507,7 +2514,7 @@ gnu/gcj/io/shs.lo gnu/gcj/protocol/core/natCoreInputStream.lo \
gnu/gcj/runtime/natFinalizerThread.lo gnu/gcj/runtime/natFirstThread.lo \
gnu/gcj/runtime/natNameFinder.lo gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \
-gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natFileChannelImpl.lo \
+gnu/gcj/runtime/natVMClassLoader.lo gnu/java/awt/natEmbeddedWindow.lo \
gnu/java/nio/natFileLockImpl.lo gnu/java/nio/natSelectorImpl.lo \
java/io/natFile.lo java/io/natFileDescriptor.lo \
java/io/natObjectInputStream.lo java/io/natVMObjectStreamClass.lo \
@@ -2522,7 +2529,8 @@ java/lang/reflect/natConstructor.lo java/lang/reflect/natField.lo \
java/lang/reflect/natMethod.lo java/lang/reflect/natProxy.lo \
java/net/natNetworkInterface.lo java/net/natInetAddress.lo \
java/net/natPlainDatagramSocketImpl.lo java/net/natPlainSocketImpl.lo \
-java/nio/natDirectByteBufferImpl.lo java/text/natCollator.lo \
+java/nio/natDirectByteBufferImpl.lo \
+java/nio/channels/natFileChannelImpl.lo java/text/natCollator.lo \
java/util/natResourceBundle.lo java/util/natTimeZone.lo \
java/util/zip/natDeflater.lo java/util/zip/natInflater.lo
lib_org_xml_sax_la_LDFLAGS =
@@ -2668,11 +2676,11 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CF
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DATA = $(jar_DATA) $(toolexecmainlib_DATA)
+DATA = $(jar_DATA) $(pkgconfig_DATA) $(toolexecmainlib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
THANKS acinclude.m4 aclocal.m4 configure configure.in \
-libgcj-test.spec.in libgcj.spec.in
+libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -2768,10 +2776,13 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/gcj/xlib/natXImage.P .deps/gnu/gcj/xlib/natXUnmapEvent.P \
.deps/gnu/java/awt/BitMaskExtent.P .deps/gnu/java/awt/Buffers.P \
.deps/gnu/java/awt/ComponentDataBlitOp.P \
+.deps/gnu/java/awt/EmbeddedWindow.P \
+.deps/gnu/java/awt/EmbeddedWindowSupport.P \
.deps/gnu/java/awt/EventModifier.P \
.deps/gnu/java/awt/GLightweightPeer.P \
.deps/gnu/java/awt/image/ImageDecoder.P \
.deps/gnu/java/awt/image/XBMDecoder.P \
+.deps/gnu/java/awt/natEmbeddedWindow.P \
.deps/gnu/java/awt/peer/gtk/GdkFontMetrics.P \
.deps/gnu/java/awt/peer/gtk/GdkGraphics.P \
.deps/gnu/java/awt/peer/gtk/GtkArg.P \
@@ -2970,9 +2981,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/locale/LocaleInformation_zh_SG.P \
.deps/gnu/java/locale/LocaleInformation_zh_TW.P \
.deps/gnu/java/math/MPN.P .deps/gnu/java/nio/DatagramChannelImpl.P \
-.deps/gnu/java/nio/FileChannelImpl.P .deps/gnu/java/nio/FileLockImpl.P \
-.deps/gnu/java/nio/PipeImpl.P .deps/gnu/java/nio/SelectionKeyImpl.P \
-.deps/gnu/java/nio/SelectorImpl.P \
+.deps/gnu/java/nio/FileLockImpl.P .deps/gnu/java/nio/PipeImpl.P \
+.deps/gnu/java/nio/SelectionKeyImpl.P .deps/gnu/java/nio/SelectorImpl.P \
.deps/gnu/java/nio/SelectorProviderImpl.P \
.deps/gnu/java/nio/ServerSocketChannelImpl.P \
.deps/gnu/java/nio/SocketChannelImpl.P \
@@ -2984,9 +2994,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/nio/charset/UTF_16Decoder.P \
.deps/gnu/java/nio/charset/UTF_16Encoder.P \
.deps/gnu/java/nio/charset/UTF_16LE.P \
-.deps/gnu/java/nio/charset/UTF_8.P \
-.deps/gnu/java/nio/natFileChannelImpl.P \
-.deps/gnu/java/nio/natFileLockImpl.P \
+.deps/gnu/java/nio/charset/UTF_8.P .deps/gnu/java/nio/natFileLockImpl.P \
.deps/gnu/java/nio/natSelectorImpl.P \
.deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \
.deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \
@@ -3516,6 +3524,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/channels/ConnectionPendingException.P \
.deps/java/nio/channels/DatagramChannel.P \
.deps/java/nio/channels/FileChannel.P \
+.deps/java/nio/channels/FileChannelImpl.P \
.deps/java/nio/channels/FileLock.P \
.deps/java/nio/channels/FileLockInterruptionException.P \
.deps/java/nio/channels/GatheringByteChannel.P \
@@ -3539,6 +3548,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/channels/UnresolvedAddressException.P \
.deps/java/nio/channels/UnsupportedAddressTypeException.P \
.deps/java/nio/channels/WritableByteChannel.P \
+.deps/java/nio/channels/natFileChannelImpl.P \
.deps/java/nio/channels/spi/AbstractInterruptibleChannel.P \
.deps/java/nio/channels/spi/AbstractSelectableChannel.P \
.deps/java/nio/channels/spi/AbstractSelectionKey.P \
@@ -4294,6 +4304,8 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
+libgcj.pc: $(top_builddir)/config.status libgcj.pc.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
libgcj-test.spec: $(top_builddir)/config.status libgcj-test.spec.in
@@ -4469,6 +4481,25 @@ uninstall-jarDATA:
rm -f $(DESTDIR)$(jardir)/$$p; \
done
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
+ @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \
+ else if test -f $$p; then \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \
+ fi; fi; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ list='$(pkgconfig_DATA)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \
+ done
+
install-toolexecmainlibDATA: $(toolexecmainlib_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(toolexecmainlibdir)
@@ -4703,7 +4734,8 @@ install-exec-am: install-toolexeclibLTLIBRARIES install-binPROGRAMS \
install-binSCRIPTS install-toolexecmainlibDATA
install-exec: install-exec-recursive
-install-data-am: install-jarDATA install-data-local
+install-data-am: install-jarDATA install-pkgconfigDATA \
+ install-data-local
install-data: install-data-recursive
install-am: all-am
@@ -4711,7 +4743,7 @@ install-am: all-am
install: install-recursive
uninstall-am: uninstall-toolexeclibLTLIBRARIES uninstall-binPROGRAMS \
uninstall-binSCRIPTS uninstall-jarDATA \
- uninstall-toolexecmainlibDATA
+ uninstall-pkgconfigDATA uninstall-toolexecmainlibDATA
uninstall: uninstall-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA)
all-redirect: all-recursive
@@ -4721,6 +4753,7 @@ installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) $(DESTDIR)$(bindir) \
$(DESTDIR)$(bindir) $(DESTDIR)$(jardir) \
+ $(DESTDIR)$(pkgconfigdir) \
$(DESTDIR)$(toolexecmainlibdir)
@@ -4780,7 +4813,8 @@ distclean-binPROGRAMS clean-binPROGRAMS maintainer-clean-binPROGRAMS \
uninstall-binPROGRAMS install-binPROGRAMS mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS uninstall-binSCRIPTS install-binSCRIPTS \
-uninstall-jarDATA install-jarDATA uninstall-toolexecmainlibDATA \
+uninstall-jarDATA install-jarDATA uninstall-pkgconfigDATA \
+install-pkgconfigDATA uninstall-toolexecmainlibDATA \
install-toolexecmainlibDATA install-data-recursive \
uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
diff --git a/libjava/acconfig.h b/libjava/acconfig.h
index 308f71ebdec..4a511d51f23 100644
--- a/libjava/acconfig.h
+++ b/libjava/acconfig.h
@@ -83,6 +83,9 @@
/* Define if gethostbyaddr_r returns `int'. */
#undef GETHOSTBYADDR_R_RETURNS_INT
+/* Define if usleep is declared in <unistd.h>. */
+#undef HAVE_USLEEP_DECL
+
/* Define if struct tm has tm_gmtoff field. */
#undef STRUCT_TM_HAS_GMTOFF
diff --git a/libjava/configure b/libjava/configure
index fa37b78b96a..ff307d17db0 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -5619,6 +5619,78 @@ fi
done
+ for ac_func in usleep
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5626: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5631 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+ cat > conftest.$ac_ext <<EOF
+#line 5674 "configure"
+#include "confdefs.h"
+#include <unistd.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "usleep" >/dev/null 2>&1; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_USLEEP_DECL 1
+EOF
+
+fi
+rm -f conftest*
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
# Look for these functions in the thread library, but only bother
# if using POSIX threads.
if test "$THREADS" = posix; then
@@ -5629,12 +5701,12 @@ done
for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5633: checking for $ac_func" >&5
+echo "configure:5705: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5638 "configure"
+#line 5710 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5657,7 +5729,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5687,12 +5759,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5691: checking for $ac_func" >&5
+echo "configure:5763: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5696 "configure"
+#line 5768 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5715,7 +5787,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5737,7 +5809,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5741: checking for sched_yield in -lrt" >&5
+echo "configure:5813: checking for sched_yield in -lrt" >&5
ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5745,7 +5817,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5749 "configure"
+#line 5821 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5756,7 +5828,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5782,7 +5854,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:5786: checking for sched_yield in -lposix4" >&5
+echo "configure:5858: checking for sched_yield in -lposix4" >&5
ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5790,7 +5862,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5794 "configure"
+#line 5866 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5801,7 +5873,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5837,7 +5909,7 @@ done
# We can save a little space at runtime if the mutex has m_count
# or __m_count. This is a nice hack for Linux.
cat > conftest.$ac_ext <<EOF
-#line 5841 "configure"
+#line 5913 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5846,7 +5918,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -5858,7 +5930,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5862 "configure"
+#line 5934 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5867,7 +5939,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -5887,12 +5959,12 @@ rm -f conftest*
for ac_func in gettimeofday time ftime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5891: checking for $ac_func" >&5
+echo "configure:5963: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5896 "configure"
+#line 5968 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5915,7 +5987,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5946,12 +6018,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5950: checking for $ac_func" >&5
+echo "configure:6022: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5955 "configure"
+#line 6027 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5974,7 +6046,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6004,12 +6076,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6008: checking for $ac_func" >&5
+echo "configure:6080: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6013 "configure"
+#line 6085 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6032,7 +6104,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6061,7 +6133,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6065: checking for dlopen in -ldl" >&5
+echo "configure:6137: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6069,7 +6141,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6073 "configure"
+#line 6145 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6080,7 +6152,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6125,7 +6197,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:6129: checking for socket libraries" >&5
+echo "configure:6201: checking for socket libraries" >&5
if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6133,12 +6205,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6137: checking for connect" >&5
+echo "configure:6209: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6142 "configure"
+#line 6214 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6161,7 +6233,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -6184,7 +6256,7 @@ fi
if test "$gcj_checkSocket" = 1; then
unset ac_cv_func_connect
echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:6188: checking for main in -lsocket" >&5
+echo "configure:6260: checking for main in -lsocket" >&5
ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6192,14 +6264,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6196 "configure"
+#line 6268 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6226,12 +6298,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:6230: checking for accept" >&5
+echo "configure:6302: checking for accept" >&5
if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6235 "configure"
+#line 6307 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -6254,7 +6326,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:6258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_accept=yes"
else
@@ -6281,12 +6353,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6285: checking for gethostbyname" >&5
+echo "configure:6357: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6290 "configure"
+#line 6362 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6309,7 +6381,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -6327,7 +6399,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:6331: checking for main in -lnsl" >&5
+echo "configure:6403: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6335,14 +6407,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6339 "configure"
+#line 6411 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6374,7 +6446,7 @@ echo "$ac_t""$gcj_cv_lib_sockets" 1>&6
if test "$with_system_zlib" = yes; then
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:6378: checking for deflate in -lz" >&5
+echo "configure:6450: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6382,7 +6454,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6386 "configure"
+#line 6458 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6393,7 +6465,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:6397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6442,7 +6514,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6446: checking for $ac_word" >&5
+echo "configure:6518: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6490,7 +6562,7 @@ fi
min_gtk_version=2.0.0
echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:6494: checking for GTK+ - version >= $min_gtk_version" >&5
+echo "configure:6566: checking for GTK+ - version >= $min_gtk_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6525,7 +6597,7 @@ echo "configure:6494: checking for GTK+ - version >= $min_gtk_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6529 "configure"
+#line 6601 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6600,7 +6672,7 @@ main ()
}
EOF
-if { (eval echo configure:6604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6634,7 +6706,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6638 "configure"
+#line 6710 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6644,7 +6716,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
@@ -6703,7 +6775,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6707: checking for $ac_word" >&5
+echo "configure:6779: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6753,7 +6825,7 @@ fi
min_glib_version=2.0.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
-echo "configure:6757: checking for GLIB - version >= $min_glib_version" >&5
+echo "configure:6829: checking for GLIB - version >= $min_glib_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6792,7 +6864,7 @@ echo "configure:6757: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6796 "configure"
+#line 6868 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6867,7 +6939,7 @@ main ()
}
EOF
-if { (eval echo configure:6871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6901,7 +6973,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6905 "configure"
+#line 6977 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6911,7 +6983,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@@ -6990,7 +7062,7 @@ fi
# Extract the first word of "libart-config", so it can be a program name with args.
set dummy libart-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6994: checking for $ac_word" >&5
+echo "configure:7066: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7025,7 +7097,7 @@ fi
min_libart_version=2.1.0
echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6
-echo "configure:7029: checking for LIBART - version >= $min_libart_version" >&5
+echo "configure:7101: checking for LIBART - version >= $min_libart_version" >&5
no_libart=""
if test "$LIBART_CONFIG" = "no" ; then
no_libart=yes
@@ -7049,7 +7121,7 @@ echo "configure:7029: checking for LIBART - version >= $min_libart_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 7053 "configure"
+#line 7125 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7107,7 +7179,7 @@ int main ()
EOF
-if { (eval echo configure:7111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7141,7 +7213,7 @@ fi
CFLAGS="$CFLAGS $LIBART_CFLAGS"
LIBS="$LIBS $LIBART_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7145 "configure"
+#line 7217 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7151,7 +7223,7 @@ int main() {
return 0;
; return 0; }
EOF
-if { (eval echo configure:7155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBART or finding the wrong"
@@ -7190,7 +7262,7 @@ rm -f conftest*
# requires -ldl.
if test "$GC" = boehm; then
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:7194: checking for main in -ldl" >&5
+echo "configure:7266: checking for main in -ldl" >&5
ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7198,14 +7270,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7202 "configure"
+#line 7274 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7272,7 +7344,7 @@ fi
# Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7276: checking for $ac_word" >&5
+echo "configure:7348: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7304,7 +7376,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gcj", so it can be a program name with args.
set dummy gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7308: checking for $ac_word" >&5
+echo "configure:7380: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7366,13 +7438,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:7370: checking size of void *" >&5
+echo "configure:7442: checking size of void *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 7376 "configure"
+#line 7448 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -7382,7 +7454,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:7386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -7492,18 +7564,18 @@ EOF
echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:7496: checking for g++ -ffloat-store bug" >&5
+echo "configure:7568: checking for g++ -ffloat-store bug" >&5
save_CFLAGS="$CFLAGS"
CFLAGS="-x c++ -O2 -ffloat-store"
cat > conftest.$ac_ext <<EOF
-#line 7500 "configure"
+#line 7572 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:7507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@@ -7523,17 +7595,17 @@ for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7527: checking for $ac_hdr" >&5
+echo "configure:7599: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7532 "configure"
+#line 7604 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7563,17 +7635,17 @@ for ac_hdr in dirent.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7567: checking for $ac_hdr" >&5
+echo "configure:7639: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7572 "configure"
+#line 7644 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7603,17 +7675,17 @@ for ac_hdr in inttypes.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7607: checking for $ac_hdr" >&5
+echo "configure:7679: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7612 "configure"
+#line 7684 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7649,12 +7721,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:7653: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:7725: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7658 "configure"
+#line 7730 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -7670,7 +7742,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:7674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -7692,12 +7764,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7696: checking for ANSI C header files" >&5
+echo "configure:7768: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7701 "configure"
+#line 7773 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -7705,7 +7777,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7722,7 +7794,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 7726 "configure"
+#line 7798 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -7740,7 +7812,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 7744 "configure"
+#line 7816 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -7761,7 +7833,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 7765 "configure"
+#line 7837 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -7772,7 +7844,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:7776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7796,12 +7868,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:7800: checking for ssize_t" >&5
+echo "configure:7872: checking for ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7805 "configure"
+#line 7877 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7830,9 +7902,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:7834: checking for in_addr_t" >&5
+echo "configure:7906: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 7836 "configure"
+#line 7908 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7846,7 +7918,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:7850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -7862,16 +7934,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7866: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:7938: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7868 "configure"
+#line 7940 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:7875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -7887,16 +7959,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7891: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:7963: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7893 "configure"
+#line 7965 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:7900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -7912,16 +7984,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7916: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:7988: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7918 "configure"
+#line 7990 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:7925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -7937,9 +8009,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:7941: checking for socklen_t in sys/socket.h" >&5
+echo "configure:8013: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7943 "configure"
+#line 8015 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -7948,7 +8020,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:7952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -7964,16 +8036,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:7968: checking for tm_gmtoff in struct tm" >&5
+echo "configure:8040: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 7970 "configure"
+#line 8042 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:7977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -7986,16 +8058,16 @@ else
rm -rf conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6
-echo "configure:7990: checking for global timezone variable" >&5
+echo "configure:8062: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 7992 "configure"
+#line 8064 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
void i(){long z2 = 2*timezone;}
; return 0; }
EOF
-if { (eval echo configure:7999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -8008,16 +8080,16 @@ else
rm -rf conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking for global _timezone variable""... $ac_c" 1>&6
-echo "configure:8012: checking for global _timezone variable" >&5
+echo "configure:8084: checking for global _timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8014 "configure"
+#line 8086 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = _timezone;
; return 0; }
EOF
-if { (eval echo configure:8021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_UNDERSCORE_TIMEZONE 1
@@ -8039,19 +8111,19 @@ rm -f conftest*
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:8043: checking for working alloca.h" >&5
+echo "configure:8115: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8048 "configure"
+#line 8120 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -8072,12 +8144,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8076: checking for alloca" >&5
+echo "configure:8148: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8081 "configure"
+#line 8153 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -8105,7 +8177,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -8137,12 +8209,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8141: checking whether alloca needs Cray hooks" >&5
+echo "configure:8213: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8146 "configure"
+#line 8218 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -8167,12 +8239,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8171: checking for $ac_func" >&5
+echo "configure:8243: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8176 "configure"
+#line 8248 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8195,7 +8267,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -8222,7 +8294,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8226: checking stack direction for C alloca" >&5
+echo "configure:8298: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8230,7 +8302,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8234 "configure"
+#line 8306 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -8249,7 +8321,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -8274,17 +8346,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8278: checking for $ac_hdr" >&5
+echo "configure:8350: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8283 "configure"
+#line 8355 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -8313,12 +8385,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8317: checking for $ac_func" >&5
+echo "configure:8389: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8322 "configure"
+#line 8394 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8341,7 +8413,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -8366,7 +8438,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8370: checking for working mmap" >&5
+echo "configure:8442: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8374,7 +8446,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 8378 "configure"
+#line 8450 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -8514,7 +8586,7 @@ main()
}
EOF
-if { (eval echo configure:8518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -8542,7 +8614,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8546: checking for $ac_word" >&5
+echo "configure:8618: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8748,7 +8820,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile include/config.h gcj/libgcj-config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile libgcj.pc libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile include/config.h gcj/libgcj-config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -8950,7 +9022,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile libgcj.pc libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/libjava/configure.in b/libjava/configure.in
index f2ba05b5481..af22dc6a45f 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -678,6 +678,10 @@ else
AC_EGREP_HEADER(gethostname, unistd.h, [
AC_DEFINE(HAVE_GETHOSTNAME_DECL)])])
+ AC_CHECK_FUNCS(usleep, [
+ AC_EGREP_HEADER(usleep, unistd.h, [
+ AC_DEFINE(HAVE_USLEEP_DECL)])])
+
# Look for these functions in the thread library, but only bother
# if using POSIX threads.
if test "$THREADS" = posix; then
@@ -1061,7 +1065,7 @@ AC_SUBST(here)
# We get this from the environment.
AC_SUBST(GCJFLAGS)
-AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
+AC_OUTPUT(Makefile libgcj.pc libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
[# Only add multilib support code if we just rebuilt top-level Makefile.
case " $CONFIG_FILES " in
*" Makefile "*)
diff --git a/libjava/gcj/array.h b/libjava/gcj/array.h
index 33ea038df93..4f134f33c5c 100644
--- a/libjava/gcj/array.h
+++ b/libjava/gcj/array.h
@@ -71,7 +71,9 @@ typedef JArray<jstring> *jstringArray;
extern java::lang::Class _Jv_byteClass, _Jv_shortClass, _Jv_intClass,
_Jv_longClass, _Jv_booleanClass, _Jv_charClass, _Jv_floatClass,
_Jv_doubleClass, _Jv_voidClass;
-#define JvPrimClass(TYPE) (& _Jv_##TYPE##Class)
+/* The definition of this macro cannot be enclosed in parentheses
+ because "JvPrimClass(x)" is used as a template argument. */
+#define JvPrimClass(TYPE) & _Jv_##TYPE##Class
extern "C" jobjectArray _Jv_NewObjectArray(jsize length, jclass, jobject init);
extern "C" jobject _Jv_NewPrimArray (jclass eltype, jint count);
diff --git a/libjava/gcj/cni.h b/libjava/gcj/cni.h
index 08b55c3c7f2..3790dc4d564 100644
--- a/libjava/gcj/cni.h
+++ b/libjava/gcj/cni.h
@@ -1,5 +1,5 @@
// gcj/cni.h -*- c++ -*-
-// This file describes the Cygnus Native Interface, CNI.
+// This file describes the Compiled Native Interface, CNI.
// It provides a nicer interface to many of the things in gcj/javaprims.h.
/* Copyright (C) 1998, 1999, 2002 Free Software Foundation
diff --git a/libjava/gnu/awt/j2d/AbstractGraphicsState.java b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
index 1c29bc202f6..038bc9c6c7d 100644
--- a/libjava/gnu/awt/j2d/AbstractGraphicsState.java
+++ b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
@@ -128,6 +128,14 @@ public abstract class AbstractGraphicsState implements Cloneable
public Object clone ()
{
- return super.clone ();
+ try
+ {
+ return super.clone ();
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
}
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index e5daa9dec6b..dd46e7fe410 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -105,12 +105,20 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
public Object clone()
{
- Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
- AbstractGraphicsState stateCopy =
- (AbstractGraphicsState) state.clone();
- gfxCopy.setState(stateCopy);
-
- return gfxCopy;
+ try
+ {
+ Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
+ AbstractGraphicsState stateCopy =
+ (AbstractGraphicsState) state.clone();
+ gfxCopy.setState(stateCopy);
+
+ return gfxCopy;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
diff --git a/libjava/gnu/awt/xlib/XEventLoop.java b/libjava/gnu/awt/xlib/XEventLoop.java
index 4d293208939..ad5e963437a 100644
--- a/libjava/gnu/awt/xlib/XEventLoop.java
+++ b/libjava/gnu/awt/xlib/XEventLoop.java
@@ -48,17 +48,8 @@ public class XEventLoop implements Runnable
void postNextEvent()
{
- try
- {
- AWTEvent evt = getNextEvent();
- queue.postEvent(evt);
-
- }
- catch (InterruptedException ie)
- {
- // FIXME: what now?
- System.err.println(ie);
- }
+ AWTEvent evt = getNextEvent();
+ queue.postEvent(evt);
}
/** get next event. Will block until events become available. */
diff --git a/libjava/gnu/awt/xlib/XGraphics.java b/libjava/gnu/awt/xlib/XGraphics.java
index 9f29fa5b94a..b8614023377 100644
--- a/libjava/gnu/awt/xlib/XGraphics.java
+++ b/libjava/gnu/awt/xlib/XGraphics.java
@@ -46,10 +46,18 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
public Object clone()
{
- XGraphics gfxCopy = (XGraphics) super.clone();
- gfxCopy.context = context.create();
-
- return gfxCopy;
+ try
+ {
+ XGraphics gfxCopy = (XGraphics) super.clone();
+ gfxCopy.context = context.create();
+
+ return gfxCopy;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public void dispose()
diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java
index 19820c1bd6b..0c358368390 100644
--- a/libjava/gnu/gcj/runtime/NameFinder.java
+++ b/libjava/gnu/gcj/runtime/NameFinder.java
@@ -154,18 +154,10 @@ public class NameFinder
if (addr2line != null)
{
- try
- {
- addr2lineIn = new BufferedReader
- (new InputStreamReader(addr2line.getInputStream()));
- addr2lineOut = new BufferedWriter
- (new OutputStreamWriter(addr2line.getOutputStream()));
- }
- catch (IOException ioe)
- {
- addr2line.destroy();
- addr2line = null;
- }
+ addr2lineIn = new BufferedReader
+ (new InputStreamReader(addr2line.getInputStream()));
+ addr2lineOut = new BufferedWriter
+ (new OutputStreamWriter(addr2line.getOutputStream()));
}
}
}
diff --git a/libjava/gnu/gcj/runtime/SharedLibLoader.java b/libjava/gnu/gcj/runtime/SharedLibLoader.java
index ac2f72d4b64..cfcd04e936a 100644
--- a/libjava/gnu/gcj/runtime/SharedLibLoader.java
+++ b/libjava/gnu/gcj/runtime/SharedLibLoader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -27,7 +27,7 @@ public class SharedLibLoader extends ClassLoader
/** Load a shared library, and associate a ClassLoader with it.
* @param libname named of shared library (passed to dlopen)
* @param parent the parent ClassLoader
- * @parem flags passed to dlopen
+ * @param flags passed to dlopen
*/
public SharedLibLoader(String libname, ClassLoader parent, int flags)
{
@@ -45,12 +45,7 @@ public class SharedLibLoader extends ClassLoader
init(libname, 0);
}
- void init(String libname, int flags)
- {
- init(libname.getBytes(), flags);
- }
-
- native void init(byte[] libname, int flags);
+ native void init(String libname, int flags);
public Class loadClass(String name)
throws ClassNotFoundException
diff --git a/libjava/gnu/gcj/runtime/natSharedLibLoader.cc b/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
index 233540917b3..49bcfb4d10f 100644
--- a/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
+++ b/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
@@ -1,6 +1,6 @@
// natSharedLibLoader.cc - Implementation of FirstThread native methods.
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -14,6 +14,7 @@ details. */
#include <gnu/gcj/runtime/SharedLibLoader.h>
#include <java/io/IOException.h>
#include <java/lang/UnsupportedOperationException.h>
+#include <java/lang/UnsatisfiedLinkError.h>
#ifdef HAVE_DLOPEN
#include <dlfcn.h>
@@ -45,10 +46,14 @@ struct SharedLibDummy
#endif
void
-gnu::gcj::runtime::SharedLibLoader::init(jbyteArray libname, jint flags)
+gnu::gcj::runtime::SharedLibLoader::init(jstring libname, jint flags)
{
#ifdef HAVE_DLOPEN
- char *lname = (char*) elements(libname);
+ jint len = _Jv_GetStringUTFLength (libname);
+ char lname[len + 1];
+ JvGetStringUTFRegion (libname, 0, libname->length(), lname);
+ lname[len] = '\0';
+
if (flags==0)
flags = RTLD_LAZY;
JvSynchronize dummy1(&java::lang::Class::class$);
@@ -59,10 +64,14 @@ gnu::gcj::runtime::SharedLibLoader::init(jbyteArray libname, jint flags)
if (h == NULL)
{
const char *msg = dlerror();
+ jstring str = JvNewStringLatin1 (lname);
+ str = str->concat (JvNewStringLatin1 (": "));
+ str = str->concat (JvNewStringLatin1 (msg));
+ throw new java::lang::UnsatisfiedLinkError (str);
}
handler = (gnu::gcj::RawData*) h;
#else
- const char *msg = "ShareedLibLoader is not supported on this platform";
+ const char *msg = "SharedLibLoader is not supported on this platform";
throw new java::lang::UnsupportedOperationException(JvNewStringLatin1(msg));
#endif
}
diff --git a/libjava/gnu/gcj/xlib/GC.java b/libjava/gnu/gcj/xlib/GC.java
index 021f53756fb..b7eb0b682f4 100644
--- a/libjava/gnu/gcj/xlib/GC.java
+++ b/libjava/gnu/gcj/xlib/GC.java
@@ -36,15 +36,23 @@ public class GC implements Cloneable
*/
public Object clone()
{
- GC gcClone = target.getGCFromCache ();
- if (gcClone==null)
- {
- gcClone = (GC) super.clone();
- gcClone.structure = null;
- }
- gcClone.initStructure(this);
- gcClone.updateClip();
- return gcClone;
+ try
+ {
+ GC gcClone = target.getGCFromCache ();
+ if (gcClone==null)
+ {
+ gcClone = (GC) super.clone();
+ gcClone.structure = null;
+ }
+ gcClone.initStructure(this);
+ gcClone.updateClip();
+ return gcClone;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
private native void initStructure(GC copyFrom);
diff --git a/libjava/gnu/gcj/xlib/WMSizeHints.java b/libjava/gnu/gcj/xlib/WMSizeHints.java
index 29344eee1eb..c0b198c58a7 100644
--- a/libjava/gnu/gcj/xlib/WMSizeHints.java
+++ b/libjava/gnu/gcj/xlib/WMSizeHints.java
@@ -27,12 +27,20 @@ public class WMSizeHints implements Cloneable
protected native void finalize();
public Object clone() {
- WMSizeHints hints = (WMSizeHints) super.clone();
- // In case of an exception before the stucture is copied.
- hints.structure = null;
-
- hints.init(this);
- return hints;
+ try
+ {
+ WMSizeHints hints = (WMSizeHints) super.clone();
+ // In case of an exception before the stucture is copied.
+ hints.structure = null;
+
+ hints.init(this);
+ return hints;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public native void applyNormalHints(Window window);
diff --git a/libjava/gnu/gcj/xlib/WindowAttributes.java b/libjava/gnu/gcj/xlib/WindowAttributes.java
index 6efeaa5d434..23be37d6363 100644
--- a/libjava/gnu/gcj/xlib/WindowAttributes.java
+++ b/libjava/gnu/gcj/xlib/WindowAttributes.java
@@ -43,15 +43,23 @@ public class WindowAttributes
public Object clone()
{
- WindowAttributes attributes = (WindowAttributes) super.clone();
- // In case of an exception before the stucture is copied.
- attributes.in = null;
- attributes.out = null;
-
- // FIXME: do anything else?
+ try
+ {
+ WindowAttributes attributes = (WindowAttributes) super.clone();
+ // In case of an exception before the stucture is copied.
+ attributes.in = null;
+ attributes.out = null;
+
+ // FIXME: do anything else?
- attributes.init(this);
- return attributes;
+ attributes.init(this);
+ return attributes;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public native void setBackground(long pixel);
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
index 45690b06669..12982832df5 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
@@ -38,7 +38,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+import java.awt.Font;
+import java.awt.FontMetrics;
public class GdkFontMetrics extends FontMetrics
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
index 24ea252d4dc..8e8ee57c154 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -38,8 +38,15 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.image.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
public class GdkGraphics extends Graphics
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
index a609f7ad818..0aa42f5307a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -37,10 +37,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;
-import java.awt.peer.*;
+import java.awt.peer.ButtonPeer;
public class GtkButtonPeer extends GtkComponentPeer
implements ButtonPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
index 59c28f9fd5f..d5378dc77de 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
@@ -35,10 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics;
import java.awt.event.PaintEvent;
-import java.awt.peer.*;
+import java.awt.peer.CanvasPeer;
public class GtkCanvasPeer extends GtkComponentPeer implements CanvasPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
index 9903c310425..e387f1287d3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
@@ -37,9 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
+
+import java.awt.CheckboxGroup;
+import java.util.WeakHashMap;
// Note that there is no peer interface for a CheckboxGroup. We
// introduce our own in order to make it easier to keep a piece of
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
index 1bff7069602..adb7008ca3f 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.CheckboxMenuItem;
import java.awt.peer.CheckboxMenuItemPeer;
import java.awt.peer.MenuItemPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
index 48f8804007d..67469c93176 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
+import java.awt.Component;
+import java.awt.peer.CheckboxPeer;
public class GtkCheckboxPeer extends GtkComponentPeer
implements CheckboxPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
index afa90a56c3f..c4398e5041c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
@@ -37,9 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.Choice;
+import java.awt.event.ItemEvent;
+import java.awt.peer.ChoicePeer;
public class GtkChoicePeer extends GtkComponentPeer
implements ChoicePeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
index d2587d970a1..86678f8ab1c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
@@ -35,15 +35,17 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.awt.datatransfer.*;
-import java.awt.image.*;
-import java.awt.peer.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.ClipboardOwner;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
public class GtkClipboard extends Clipboard
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index 779bc8b5d96..43ada95cf00 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -37,9 +37,34 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
+
+import java.awt.AWTEvent;
+import java.awt.BufferCapabilities;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.ItemSelectable;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.FocusEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.PaintEvent;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.VolatileImage;
import java.awt.peer.ComponentPeer;
public class GtkComponentPeer extends GtkGenericPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
index caf5dc37943..7e2c5492d29 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
@@ -37,8 +37,12 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.AWTEvent;
+import java.awt.Container;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.event.PaintEvent;
import java.awt.peer.ContainerPeer;
public class GtkContainerPeer extends GtkComponentPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
index b47956d4f21..cddaead3b34 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
-import java.awt.event.*;
+
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.peer.DialogPeer;
public class GtkDialogPeer extends GtkWindowPeer
implements DialogPeer
@@ -51,7 +53,7 @@ public class GtkDialogPeer extends GtkWindowPeer
void create ()
{
- create (GTK_WINDOW_DIALOG);
+ create (GTK_WINDOW_POPUP);
}
public void getArgs (Component component, GtkArgList args)
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
index 3376787d2e5..64e73c68a86 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+
+import java.awt.FileDialog;
+import java.awt.Graphics;
+import java.awt.peer.FileDialogPeer;
import java.io.FilenameFilter;
-import java.awt.peer.*;
-import java.awt.*;
public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
index 6c6802d20ee..2f598cb84da 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
@@ -37,9 +37,16 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
-import java.awt.event.*;
+
+import java.awt.Component;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.MenuBar;
+import java.awt.Rectangle;
+import java.awt.event.PaintEvent;
+import java.awt.peer.FramePeer;
+import java.awt.peer.MenuBarPeer;
public class GtkFramePeer extends GtkWindowPeer
implements FramePeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
index 914b7a6cdeb..f7a7b2270ac 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.EventQueue;
+import java.awt.event.ActionEvent;
public class GtkGenericPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImage.java b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
index f0c8bf410ef..6252a506f0d 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkImage.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
@@ -38,9 +38,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.util.*;
-import java.awt.image.*;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.util.Hashtable;
+import java.util.Vector;
public class GtkImage extends Image implements ImageConsumer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
index 3ea22cd25af..a5a8d095985 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
@@ -35,11 +35,14 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.image.*;
-import java.util.*;
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageConsumer;
+import java.util.Hashtable;
public class GtkImagePainter implements Runnable, ImageConsumer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
index 5cd3fb7b327..e70be2b4ef4 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
@@ -37,8 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Component;
+import java.awt.Label;
+import java.awt.peer.LabelPeer;
public class GtkLabelPeer extends GtkComponentPeer
implements LabelPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
index 6686457ba42..2ba183b09ea 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
@@ -37,8 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Dimension;
+import java.awt.List;
+import java.awt.peer.ListPeer;
public class GtkListPeer extends GtkComponentPeer
implements ListPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
index 6ceb8641481..40462818081 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
@@ -37,7 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Menu;
+import java.awt.MenuBar;
import java.awt.peer.MenuBarPeer;
import java.awt.peer.MenuPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
index e04ce999324..eeef383ebd3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
@@ -37,7 +37,7 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
import java.awt.peer.MenuComponentPeer;
public class GtkMenuComponentPeer extends GtkGenericPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
index 1428011133b..8a51d03d102 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
@@ -37,7 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
import java.awt.peer.MenuItemPeer;
import java.awt.peer.MenuComponentPeer;
import java.awt.peer.MenuBarPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
index 51733a6f0b6..a5fcae720c3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
@@ -37,7 +37,12 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Component;
+import java.awt.Menu;
+import java.awt.MenuContainer;
+import java.awt.MenuItem;
+import java.awt.MenuShortcut;
import java.awt.peer.MenuPeer;
import java.awt.peer.MenuItemPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
index 135fbf627c3..22086c5a08c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
@@ -35,10 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.image.*;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
public class GtkOffScreenImage extends Image
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
index 168e075b28b..cf7a9e1bade 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Panel;
+import java.awt.peer.PanelPeer;
public class GtkPanelPeer extends GtkContainerPeer
implements PanelPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
index e29d749c791..ed0b5219326 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
@@ -37,8 +37,12 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.ComponentPeer;
+
+import java.awt.Component;
+import java.awt.Event;
+import java.awt.MenuItem;
+import java.awt.Point;
+import java.awt.PopupMenu;
import java.awt.peer.PopupMenuPeer;
public class GtkPopupMenuPeer extends GtkMenuPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
index 9abde2ae44b..cd2c112c283 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Adjustable;
+import java.awt.ScrollPane;
+import java.awt.peer.ComponentPeer;
+import java.awt.peer.ScrollPanePeer;
public class GtkScrollPanePeer extends GtkContainerPeer
implements ScrollPanePeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
index 07aee679158..d13e34edfe8 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Adjustable;
+import java.awt.Scrollbar;
import java.awt.event.AdjustmentEvent;
+import java.awt.peer.ScrollbarPeer;
public class GtkScrollbarPeer extends GtkComponentPeer
implements ScrollbarPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
index ad83008cb8a..7fdbac0aa99 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.TextArea;
+import java.awt.peer.TextAreaPeer;
public class GtkTextAreaPeer extends GtkTextComponentPeer
implements TextAreaPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
index d9ebd40aa72..fd99d1d1ecd 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
@@ -37,8 +37,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.Rectangle;
+import java.awt.TextComponent;
+import java.awt.event.KeyEvent;
+import java.awt.event.TextEvent;
+import java.awt.peer.TextComponentPeer;
public class GtkTextComponentPeer extends GtkComponentPeer
implements TextComponentPeer
@@ -51,32 +57,14 @@ public class GtkTextComponentPeer extends GtkComponentPeer
}
public native int getCaretPosition ();
- public void setCaretPosition (int pos)
- {
- set ("text_position", pos);
- }
+ public native void setCaretPosition (int pos);
public native int getSelectionStart ();
public native int getSelectionEnd ();
public native String getText ();
public native void select (int start, int end);
-
- public void setEditable (boolean state)
- {
- set ("editable", state);
- }
-
+ public native void setEditable (boolean state);
public native void setText (String text);
-
- public void getArgs (Component component, GtkArgList args)
- {
- super.getArgs (component, args);
-
- TextComponent tc = (TextComponent) component;
-
- args.add ("text_position", tc.getCaretPosition ());
- args.add ("editable", tc.isEditable ());
- }
-
+
public int getIndexAtPoint(int x, int y)
{
return 0; // FIXME
@@ -91,4 +79,21 @@ public class GtkTextComponentPeer extends GtkComponentPeer
{
return filter; // FIXME
}
+
+ protected void postTextEvent ()
+ {
+ q.postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
+ }
+
+ public void handleEvent (AWTEvent e)
+ {
+ if (e.getID () == KeyEvent.KEY_TYPED
+ && ((TextComponent)e.getSource()).isEditable())
+ {
+ KeyEvent ke = (KeyEvent)e;
+
+ if (!ke.isConsumed())
+ postTextEvent ();
+ }
+ }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
index 628cdd627ae..51f17b861f6 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
@@ -37,8 +37,13 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.TextField;
+import java.awt.event.KeyEvent;
+import java.awt.peer.TextFieldPeer;
public class GtkTextFieldPeer extends GtkTextComponentPeer
implements TextFieldPeer
@@ -102,4 +107,18 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
{
gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
}
+
+ public void handleEvent (AWTEvent e)
+ {
+ if (e.getID () == KeyEvent.KEY_PRESSED)
+ {
+ KeyEvent ke = (KeyEvent)e;
+
+ if (!ke.isConsumed()
+ && ke.getKeyCode() == KeyEvent.VK_ENTER)
+ postActionEvent (getText(), ke.getModifiers ());
+ }
+
+ super.handleEvent (e);
+ }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index ffdc910e8a2..c998d1909e4 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -39,18 +39,19 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
import java.awt.*;
-import java.awt.datatransfer.*;
+import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.im.InputMethodHighlight;
-import java.awt.image.*;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
import java.awt.peer.*;
-import java.net.*;
+import java.net.URL;
import java.util.Hashtable;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
-import gnu.java.awt.image.*;
import gnu.classpath.Configuration;
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
index 7ef667e50ea..21ec0201579 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Window;
+import java.awt.peer.WindowPeer;
public class GtkWindowPeer extends GtkContainerPeer
implements WindowPeer
diff --git a/libjava/gnu/java/locale/LocaleInformation_de.java b/libjava/gnu/java/locale/LocaleInformation_de.java
index 09ba466d190..4254f7c3947 100644
--- a/libjava/gnu/java/locale/LocaleInformation_de.java
+++ b/libjava/gnu/java/locale/LocaleInformation_de.java
@@ -59,7 +59,7 @@ public class LocaleInformation_de extends ListResourceBundle
*/
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z" +
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z" +
"&ae,\u00e4&Ae,\u00c4&oe,\u00f6&Oe,\u00d6&ue,\u00fc&Ue,\u00dc&ss,\u00df";
/**
diff --git a/libjava/gnu/java/locale/LocaleInformation_en.java b/libjava/gnu/java/locale/LocaleInformation_en.java
index ad327b0e54b..9fdf438d607 100644
--- a/libjava/gnu/java/locale/LocaleInformation_en.java
+++ b/libjava/gnu/java/locale/LocaleInformation_en.java
@@ -62,7 +62,7 @@ public class LocaleInformation_en extends ListResourceBundle
// and probably other things as well.
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z";
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z";
/**
* This is the list of months, fully spelled out
diff --git a/libjava/gnu/java/locale/LocaleInformation_nl.java b/libjava/gnu/java/locale/LocaleInformation_nl.java
index e70f4ecd885..073f7c06364 100644
--- a/libjava/gnu/java/locale/LocaleInformation_nl.java
+++ b/libjava/gnu/java/locale/LocaleInformation_nl.java
@@ -62,7 +62,7 @@ public class LocaleInformation_nl extends ListResourceBundle
*/
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z";
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z";
/**
* This is the list of months, fully spelled out
diff --git a/libjava/gnu/java/nio/FileChannelImpl.java b/libjava/gnu/java/nio/FileChannelImpl.java
deleted file mode 100644
index 943bdd78652..00000000000
--- a/libjava/gnu/java/nio/FileChannelImpl.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/* FileChannelImpl.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.nio;
-
-import java.io.EOFException;
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.MappedByteBuffer;
-import java.nio.MappedByteBufferImpl;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.NonReadableChannelException;
-import java.nio.channels.NonWritableChannelException;
-import java.nio.channels.ReadableByteChannel;
-import java.nio.channels.WritableByteChannel;
-import gnu.gcj.RawData;
-
-/**
- * This file is not user visible !
- * But alas, Java does not have a concept of friendly packages
- * so this class is public.
- * Instances of this class are created by invoking getChannel
- * Upon a Input/Output/RandomAccessFile object.
- */
-
-public class FileChannelImpl extends FileChannel
-{
- public RawData map_address;
-
- int length;
- FileDescriptor fd;
- MappedByteBuffer buf;
- Object file_obj; // just to keep it live...
-
- public FileChannelImpl (FileDescriptor fd, boolean write, Object obj)
- {
- if (!(obj instanceof RandomAccessFile)
- && !(obj instanceof FileInputStream)
- && !(obj instanceof FileOutputStream))
- throw new InternalError ();
-
- this.fd = fd;
- this.file_obj = obj;
- }
-
- public FileChannelImpl ()
- {
- this (new FileDescriptor (), true, null);
- }
-
- private native long implPosition ();
- private native FileChannel implPosition (long newPosition);
- private native FileChannel implTruncate (long size);
-
- private native RawData nio_mmap_file (long pos, long size, int mode);
- private native void nio_unmmap_file (RawData map_address, int size);
- private native void nio_msync (RawData map_address, int length);
-
- public native long size () throws IOException;
-
- protected void implCloseChannel() throws IOException
- {
- if (map_address != null)
- {
- nio_unmmap_file (map_address, (int) length);
- map_address = null;
- }
-
- if (file_obj instanceof RandomAccessFile)
- {
- RandomAccessFile o = (RandomAccessFile) file_obj;
- o.close();
- }
- else if (file_obj instanceof FileInputStream)
- {
- FileInputStream o = (FileInputStream) file_obj;
- o.close();
- }
- else if (file_obj instanceof FileOutputStream)
- {
- FileOutputStream o = (FileOutputStream) file_obj;
- o.close();
- }
- }
-
- public int read (ByteBuffer dst) throws IOException
- {
- // Check if file is mapped into memory.
- if (buf != null)
- {
- // FIXME: implement this
- throw new Error ("Accessing mapped buffers not implemented.");
- }
-
- // File not mapped, access it directly.
- return implRead (dst);
- }
-
- public int read (ByteBuffer dst, long position)
- throws IOException
- {
- if (position < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (file_obj instanceof FileOutputStream)
- throw new NonReadableChannelException ();
-
- int result;
- long oldPosition;
-
- oldPosition = implPosition ();
- result = implRead (dst);
- implPosition (oldPosition);
-
- return result;
- }
-
- private int implRead (ByteBuffer dst) throws IOException
- {
- int result;
- byte[] buffer = new byte [dst.remaining ()];
-
- result = implRead (buffer, 0, buffer.length);
- dst.put (buffer, 0, result);
-
- return result;
- }
-
- private native int implRead (byte[] buffer, int offset, int length)
- throws IOException;
-
- public long read (ByteBuffer[] dsts, int offset, int length)
- throws IOException
- {
- long result = 0;
-
- for (int i = offset; i < offset + length; i++)
- {
- result += read (dsts [i]);
- }
-
- return result;
- }
-
- public int write (ByteBuffer src) throws IOException
- {
- // Check if file is mapped into memory.
- if (buf != null)
- {
- // FIXME: implement this
- throw new Error ("Accessing mapped buffers not implemented.");
- }
-
- // File not mapped, access it directly.
- return implWrite (src);
- }
-
- public int write (ByteBuffer src, long position)
- throws IOException
- {
- if (position < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (file_obj instanceof FileInputStream)
- throw new NonWritableChannelException ();
-
- int result;
- long oldPosition;
-
- oldPosition = implPosition ();
- result = implWrite (src);
- implPosition (oldPosition);
-
- return result;
- }
-
- private int implWrite (ByteBuffer src) throws IOException
- {
- byte[] buffer = new byte [src.remaining ()];
-
- src.get (buffer, 0, buffer.length);
- return implWrite (buffer, 0, buffer.length);
- }
-
- private native int implWrite (byte[] buffer, int offset, int length)
- throws IOException;
-
- public long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException
- {
- long result = 0;
-
- for (int i = offset;i < offset + length;i++)
- {
- result += write (srcs[i]);
- }
-
- return result;
- }
-
- public MappedByteBuffer map (FileChannel.MapMode mode, long position,
- long size)
- throws IOException
- {
- if ((mode != MapMode.READ_ONLY
- && mode != MapMode.READ_WRITE
- && mode != MapMode.PRIVATE)
- || position < 0
- || size < 0
- || size > Integer.MAX_VALUE)
- throw new IllegalArgumentException ();
-
- // FIXME: Make this working.
- int cmode = mode.m;
- map_address = nio_mmap_file (position, size, cmode);
- length = (int) size;
- buf = new MappedByteBufferImpl (this);
- return buf;
- }
-
- static MappedByteBuffer create_direct_mapped_buffer (RawData map_address,
- long length)
- throws IOException
- {
- FileChannelImpl ch = new FileChannelImpl ();
- ch.map_address = map_address;
- ch.length = (int) length;
- ch.buf = new MappedByteBufferImpl (ch);
- return ch.buf;
- }
-
- /**
- * msync with the disk
- */
- public void force (boolean metaData) throws IOException
- {
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- // FIXME: What to do with metaData ?
-
- nio_msync (map_address, length);
- }
-
- public long transferTo (long position, long count, WritableByteChannel target)
- throws IOException
- {
- if (position < 0
- || count < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (file_obj instanceof FileOutputStream)
- throw new NonReadableChannelException ();
-
- // XXX: count needs to be casted from long to int. Dataloss ?
- ByteBuffer buffer = ByteBuffer.allocate ((int) count);
- read (buffer, position);
- return target.write (buffer);
- }
-
- public long transferFrom (ReadableByteChannel src, long position, long count)
- throws IOException
- {
- if (position < 0
- || count < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (file_obj instanceof FileInputStream)
- throw new NonWritableChannelException ();
-
- // XXX: count needs to be casted from long to int. Dataloss ?
- ByteBuffer buffer = ByteBuffer.allocate ((int) count);
- src.read (buffer);
- return write (buffer, position);
- }
-
- public FileLock lock (long position, long size, boolean shared)
- throws IOException
- {
- if (position < 0
- || size < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (shared &&
- file_obj instanceof FileOutputStream)
- throw new NonReadableChannelException ();
-
- if (!shared &&
- file_obj instanceof FileInputStream)
- throw new NonWritableChannelException ();
-
- throw new Error ("Not implemented");
- }
-
- public FileLock tryLock (long position, long size, boolean shared)
- throws IOException
- {
- if (position < 0
- || size < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- throw new Error ("Not implemented");
- }
-
- public long position ()
- throws IOException
- {
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- return implPosition ();
- }
-
- public FileChannel position (long newPosition)
- throws IOException
- {
- if (newPosition < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- return implPosition (newPosition);
- }
-
- public FileChannel truncate (long size)
- throws IOException
- {
- if (size < 0)
- throw new IllegalArgumentException ();
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if (file_obj instanceof FileInputStream)
- throw new NonWritableChannelException ();
-
- return implTruncate (size);
- }
-}
diff --git a/libjava/gnu/java/nio/natFileChannelImpl.cc b/libjava/gnu/java/nio/natFileChannelImpl.cc
deleted file mode 100644
index 6119775d55a..00000000000
--- a/libjava/gnu/java/nio/natFileChannelImpl.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// natFileChannelImpl.cc
-
-/* Copyright (C) 2003 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-
-#include <jvm.h>
-
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include <gnu/gcj/RawData.h>
-#include <gnu/java/nio/FileChannelImpl.h>
-#include <java/io/FileDescriptor.h>
-#include <java/io/IOException.h>
-#include <java/nio/ByteBuffer.h>
-#include <java/nio/channels/FileChannel.h>
-
-jlong
-gnu::java::nio::FileChannelImpl::size ()
-{
- return fd->getLength ();
-}
-
-jlong
-gnu::java::nio::FileChannelImpl::implPosition ()
-{
- return fd->getFilePointer ();
-}
-
-java::nio::channels::FileChannel*
-gnu::java::nio::FileChannelImpl::implPosition (jlong newPosition)
-{
- fd->seek (newPosition, ::java::io::FileDescriptor::SET, true);
- return this;
-}
-
-jint
-gnu::java::nio::FileChannelImpl::implRead (JArray<jbyte>* buffer,
- jint offset, jint len)
-{
- return fd->read (buffer, offset, len);
-}
-
-jint
-gnu::java::nio::FileChannelImpl::implWrite (JArray<jbyte>* buffer,
- jint offset, jint len)
-{
- fd->write (buffer, offset, len);
- return len;
-}
-
-java::nio::channels::FileChannel*
-gnu::java::nio::FileChannelImpl::implTruncate (jlong size)
-{
- fd->setLength (size);
- return this;
-}
-
-gnu::gcj::RawData*
-gnu::java::nio::FileChannelImpl::nio_mmap_file (jlong /*pos*/, jlong /*size*/,
- jint /*mode*/)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("mmap not implemented"));
-}
-
-void
-gnu::java::nio::FileChannelImpl::nio_unmmap_file (gnu::gcj::RawData* /*address*/,
- jint /*size*/)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("munmap not implemented"));
-}
-
-void
-gnu::java::nio::FileChannelImpl::nio_msync (gnu::gcj::RawData* /*map_address*/,
- jint /*length*/)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("msync not implemented"));
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastServerRef.java b/libjava/gnu/java/rmi/server/UnicastServerRef.java
index a3a999f2e9f..e2f38ff5f8c 100644
--- a/libjava/gnu/java/rmi/server/UnicastServerRef.java
+++ b/libjava/gnu/java/rmi/server/UnicastServerRef.java
@@ -138,8 +138,9 @@ public boolean unexportObject(Remote obj, boolean force) {
private Object getHelperClass(Class cls, String type) {
try {
String classname = cls.getName();
- ClassLoader cl = cls.getClassLoader(); //DONT use "Class scls = Class.forName(classname + type);"
- Class scls = cl.loadClass(classname + type);
+ ClassLoader cl = cls.getClassLoader();
+ Class scls = cl == null ? Class.forName(classname + type)
+ : cl.loadClass(classname + type);
if (type.equals("_Stub")) {
try {
// JDK 1.2 stubs
@@ -225,7 +226,9 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash)
* lets us know that.
*/
try {
- args[i] = in.readObject();
+ // need to handle primitive types
+ args[i] = ((RMIObjectInputStream)in).readValue(meth.getParameterTypes()[i]);
+
}
catch (Exception t) {
t.printStackTrace();
@@ -257,3 +260,5 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash)
}
}
+
+
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index c6b376867f0..daf11ca1ad8 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -114,6 +114,9 @@
/* Define if gethostbyaddr_r returns `int'. */
#undef GETHOSTBYADDR_R_RETURNS_INT
+/* Define if usleep is declared in <unistd.h>. */
+#undef HAVE_USLEEP_DECL
+
/* Define if struct tm has tm_gmtoff field. */
#undef STRUCT_TM_HAS_GMTOFF
@@ -319,6 +322,9 @@
/* Define if you have the unlink function. */
#undef HAVE_UNLINK
+/* Define if you have the usleep function. */
+#undef HAVE_USLEEP
+
/* Define if you have the utime function. */
#undef HAVE_UTIME
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 9395feb09c4..38155d3a3ec 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -326,6 +326,9 @@ extern void _Jv_GetTypesFromSignature (jmethodID method,
JArray<jclass> **arg_types_out,
jclass *return_type_out);
+extern jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
+ jint flags);
+
extern jobject _Jv_CallAnyMethodA (jobject obj, jclass return_type,
jmethodID meth, jboolean is_constructor,
JArray<jclass> *parameter_types,
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index 52cc6d2cfde..2c6054ec93c 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -92,6 +92,10 @@ _Jv_platform_close_on_exec (jint fd)
#undef fcntl
#ifdef JV_HASH_SYNCHRONIZATION
+#ifndef HAVE_USLEEP_DECL
+extern "C" int usleep (useconds_t useconds);
+#endif /* not HAVE_USLEEP_DECL */
+
inline void
_Jv_platform_usleep (unsigned long usecs)
{
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index e27a10e095f..72812cbc2aa 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -201,12 +201,14 @@ public class Container extends Component
/**
* Adds the specified component to the container at the end of the
* component list. This method should not be used. Instead, use
- * <code>add(Component, Object</code>.
+ * <code>add(Component, Object)</code>.
*
* @param name The name of the component to be added.
* @param component The component to be added.
*
* @return The same component that was added.
+ *
+ * @see #add(Component,Object)
*/
public Component add(String name, Component comp)
{
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index 13ae133beee..c286381c36a 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.awt;
+import gnu.java.awt.EmbeddedWindowSupport;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.awt.event.WindowListener;
@@ -93,6 +94,19 @@ public class Window extends Container implements Accessible
graphicsConfiguration = gc;
}
+ Window(int window_id, int width, int height)
+ {
+ this();
+
+ Toolkit tk = getToolkit();
+ if (!(tk instanceof EmbeddedWindowSupport))
+ throw new UnsupportedOperationException
+ ("Embedded windows not supported by the current peers: " + tk.getClass());
+
+ peer = ((EmbeddedWindowSupport) getToolkit())
+ .createEmbeddedWindow (window_id, width, height);
+ }
+
/**
* Initializes a new instance of <code>Window</code> with the specified
* parent. The window will initially be invisible.
diff --git a/libjava/java/awt/event/ActionEvent.java b/libjava/java/awt/event/ActionEvent.java
index 4f77fe06eea..97f98070416 100644
--- a/libjava/java/awt/event/ActionEvent.java
+++ b/libjava/java/awt/event/ActionEvent.java
@@ -205,7 +205,7 @@ public class ActionEvent extends AWTEvent
StringBuffer s = new StringBuffer(id == ACTION_PERFORMED
? "ACTION_PERFORMED,cmd="
: "unknown type,cmd=");
- s.append(actionCommand).append(",when=").append(when).append("modifiers");
+ s.append(actionCommand).append(",when=").append(when).append(",modifiers");
int len = s.length();
s.setLength(len + 1);
if ((modifiers & META_MASK) != 0)
diff --git a/libjava/java/awt/geom/CubicCurve2D.java b/libjava/java/awt/geom/CubicCurve2D.java
index 2d303c7f6a7..2bc0b358b19 100644
--- a/libjava/java/awt/geom/CubicCurve2D.java
+++ b/libjava/java/awt/geom/CubicCurve2D.java
@@ -204,7 +204,7 @@ public abstract class CubicCurve2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -213,7 +213,7 @@ public abstract class CubicCurve2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
@@ -223,52 +223,56 @@ public abstract class CubicCurve2D implements Shape, Cloneable
public int currentSegment(float[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = (float) getX1();
coords[1] = (float) getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = (float) getCtrlX1();
coords[1] = (float) getCtrlY1();
coords[2] = (float) getCtrlX2();
coords[3] = (float) getCtrlY2();
coords[4] = (float) getX2();
coords[5] = (float) getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return SEG_CUBICTO;
+ result = SEG_CUBICTO;
+ break;
+ default:
+ throw new NoSuchElementException("cubic iterator out of bounds");
}
- throw new NoSuchElementException("cubic iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 3);
+ return result;
}
public int currentSegment(double[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = getX1();
coords[1] = getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = getCtrlX1();
coords[1] = getCtrlY1();
coords[2] = getCtrlX2();
coords[3] = getCtrlY2();
coords[4] = getX2();
coords[5] = getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return SEG_CUBICTO;
- }
- throw new NoSuchElementException("cubic iterator out of bounds");
+ result = SEG_CUBICTO;
+ break;
+ default:
+ throw new NoSuchElementException("cubic iterator out of bounds");
+ }
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 3);
+ return result;
}
};
}
diff --git a/libjava/java/awt/geom/Line2D.java b/libjava/java/awt/geom/Line2D.java
index d2dd65c4341..15b2ecae80c 100644
--- a/libjava/java/awt/geom/Line2D.java
+++ b/libjava/java/awt/geom/Line2D.java
@@ -668,7 +668,7 @@ public abstract class Line2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -677,7 +677,7 @@ public abstract class Line2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java
index 05748fc979d..6aed0590756 100644
--- a/libjava/java/awt/geom/QuadCurve2D.java
+++ b/libjava/java/awt/geom/QuadCurve2D.java
@@ -215,7 +215,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -224,7 +224,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
@@ -234,48 +234,52 @@ public abstract class QuadCurve2D implements Shape, Cloneable
public int currentSegment(float[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = (float) getX1();
coords[1] = (float) getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = (float) getCtrlX();
coords[1] = (float) getCtrlY();
coords[2] = (float) getX2();
coords[3] = (float) getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return SEG_QUADTO;
+ result = SEG_QUADTO;
+ break;
+ default:
+ throw new NoSuchElementException("quad iterator out of bounds");
}
- throw new NoSuchElementException("quad iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 2);
+ return result;
}
public int currentSegment(double[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = getX1();
coords[1] = getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = getCtrlX();
coords[1] = getCtrlY();
coords[2] = getX2();
coords[3] = getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return SEG_QUADTO;
+ result = SEG_QUADTO;
+ break;
+ default:
+ throw new NoSuchElementException("quad iterator out of bounds");
}
- throw new NoSuchElementException("quad iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 2);
+ return result;
}
};
}
diff --git a/libjava/java/awt/geom/Rectangle2D.java b/libjava/java/awt/geom/Rectangle2D.java
index e0a278a575d..e63e1bad134 100644
--- a/libjava/java/awt/geom/Rectangle2D.java
+++ b/libjava/java/awt/geom/Rectangle2D.java
@@ -395,7 +395,7 @@ public abstract class Rectangle2D extends RectangularShape
return new PathIterator()
{
/** Current coordinate. */
- private int current = (maxx >= minx && maxy >= miny) ? 6 : 0;
+ private int current = (maxx <= minx && maxy <= miny) ? 6 : 0;
public int getWindingRule()
{
diff --git a/libjava/java/awt/im/InputContext.java b/libjava/java/awt/im/InputContext.java
index 6218847a079..ab483377d4f 100644
--- a/libjava/java/awt/im/InputContext.java
+++ b/libjava/java/awt/im/InputContext.java
@@ -1,5 +1,5 @@
/* InputContext.java -- provides the context for text input
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -339,7 +339,6 @@ public class InputContext
*
* @throws UnsupportedOperationException if there is no current input method,
* or the input method does not support reconversion
- * @throws UnsupportedOperationException if ther
* @since 1.3
*/
public void reconvert()
diff --git a/libjava/java/awt/image/MemoryImageSource.java b/libjava/java/awt/image/MemoryImageSource.java
index 0e8d4620672..5006afe79e5 100644
--- a/libjava/java/awt/image/MemoryImageSource.java
+++ b/libjava/java/awt/image/MemoryImageSource.java
@@ -74,7 +74,7 @@ public class MemoryImageSource implements ImageProducer
this.props = props;
int max = (( scansize > width ) ? scansize : width );
pixelb = new byte[ max * height ];
- System.arraycopy( pix, 0, pixelb, 0, max );
+ System.arraycopy( pix, 0, pixelb, 0, max * height );
}
/**
Constructs an ImageProducer from memory
@@ -100,7 +100,7 @@ public class MemoryImageSource implements ImageProducer
this.props = props;
int max = (( scansize > width ) ? scansize : width );
pixeli = new int[ max * height ];
- System.arraycopy( pix, 0, pixeli, 0, max );
+ System.arraycopy( pix, 0, pixeli, 0, max * height );
}
/**
Constructs an ImageProducer from memory using the default RGB ColorModel
@@ -226,6 +226,7 @@ public class MemoryImageSource implements ImageProducer
if( props != null ) {
ic.setProperties( props );
}
+ ic.setDimensions(width, height);
if( pixeli != null ) {
ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
} else {
diff --git a/libjava/java/beans/PropertyEditorManager.java b/libjava/java/beans/PropertyEditorManager.java
index cb03563d50e..aa0e1776dea 100644
--- a/libjava/java/beans/PropertyEditorManager.java
+++ b/libjava/java/beans/PropertyEditorManager.java
@@ -140,9 +140,13 @@ public class PropertyEditorManager
return (PropertyEditor)found.newInstance();
}
+ ClassLoader contextClassLoader
+ = Thread.currentThread().getContextClassLoader();
+
try
{
- found = Class.forName(editedClass.getName()+"Editor");
+ found = Class.forName(editedClass.getName()+"Editor", true,
+ contextClassLoader);
registerEditor(editedClass,found);
return (PropertyEditor)found.newInstance();
}
@@ -150,14 +154,18 @@ public class PropertyEditorManager
{
}
- String appendName = "." + ClassHelper.getTruncatedClassName(editedClass) + "Editor";
+ String appendName
+ = "."
+ + ClassHelper.getTruncatedClassName(editedClass)
+ + "Editor";
synchronized(editorSearchPath)
{
for(int i=0;i<editorSearchPath.length;i++)
{
try
{
- found = Class.forName(editorSearchPath[i] + appendName);
+ found = Class.forName(editorSearchPath[i] + appendName,
+ true, contextClassLoader);
registerEditor(editedClass,found);
return (PropertyEditor)found.newInstance();
}
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index e22a23a4326..4c599d11d1b 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/io/FileOutputStream.java b/libjava/java/io/FileOutputStream.java
index 12543506643..f0d34e3fe5a 100644
--- a/libjava/java/io/FileOutputStream.java
+++ b/libjava/java/io/FileOutputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index da01b57ba8d..4014fcd3dc2 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -224,7 +224,10 @@ public class ObjectOutputStream extends OutputStream
}
if (obj instanceof ObjectStreamClass)
- writeClassDescriptor ((ObjectStreamClass) obj);
+ {
+ writeClassDescriptor ((ObjectStreamClass) obj);
+ break;
+ }
if ((replacementEnabled || obj instanceof Serializable)
&& ! replaceDone)
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index 08fedb0e095..de00f4d141c 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index db05cb618a6..06c9c804d9e 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -243,7 +243,7 @@ public:
private:
- void checkMemberAccess (jint flags);
+ void memberAccessCheck (jint flags);
void initializeClass (void);
@@ -328,6 +328,9 @@ private:
friend void _Jv_SetVTableEntries (jclass, _Jv_VTable *, jboolean *);
friend void _Jv_MakeVTable (jclass);
+ friend jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
+ jint flags);
+
// Return array class corresponding to element type KLASS, creating it if
// necessary.
inline friend jclass
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index 44f5b5ab529..bd776913fdd 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -72,14 +72,7 @@ public final class Class implements Serializable
public Method getDeclaredMethod (String methodName, Class[] parameterTypes)
throws NoSuchMethodException, SecurityException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkMemberAccess(this, Member.DECLARED);
- Package p = getPackage();
- if (p != null)
- sm.checkPackageAccess(p.getName());
- }
+ memberAccessCheck(Member.DECLARED);
if ("<init>".equals(methodName) || "<clinit>".equals(methodName))
throw new NoSuchMethodException(methodName);
@@ -101,9 +94,7 @@ public final class Class implements Serializable
public Field getField (String fieldName)
throws NoSuchFieldException, SecurityException
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMemberAccess (this, java.lang.reflect.Member.DECLARED);
+ memberAccessCheck (Member.PUBLIC);
Field fld = getField(fieldName, fieldName.hashCode());
if (fld == null)
throw new NoSuchFieldException(fieldName);
@@ -148,14 +139,7 @@ public final class Class implements Serializable
public Method getMethod (String methodName, Class[] parameterTypes)
throws NoSuchMethodException, SecurityException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkMemberAccess(this, Member.PUBLIC);
- Package p = getPackage();
- if (p != null)
- sm.checkPackageAccess(p.getName());
- }
+ memberAccessCheck(Member.PUBLIC);
if ("<init>".equals(methodName) || "<clinit>".equals(methodName))
throw new NoSuchMethodException(methodName);
@@ -334,14 +318,6 @@ public final class Class implements Serializable
{
}
- // Do a security check.
- private void checkMemberAccess (int flags)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkMemberAccess(this, flags);
- }
-
// Initialize the class.
private native void initializeClass ();
@@ -361,4 +337,20 @@ public final class Class implements Serializable
return "";
return name.substring(0, lastInd);
}
+
+ /**
+ * Perform security checks common to all of the methods that
+ * get members of this Class.
+ */
+ private void memberAccessCheck(int which)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ {
+ sm.checkMemberAccess(this, which);
+ Package pkg = getPackage();
+ if (pkg != null)
+ sm.checkPackageAccess(pkg.getName());
+ }
+ }
}
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index 5ae70cdba95..008a19e6603 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -162,12 +162,10 @@ public abstract class ClassLoader
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
- /* FIXME: security, getClassContext() not implemented.
Class c = VMSecurityManager.getClassContext()[1];
ClassLoader cl = c.getClassLoader();
- if (cl != null && cl != this)
+ if (cl != null && ! cl.isAncestorOf(this))
sm.checkPermission(new RuntimePermission("getClassLoader"));
- */
}
return parent;
}
@@ -996,4 +994,20 @@ public abstract class ClassLoader
packageAssertionStatus = new HashMap();
classAssertionStatus = new HashMap();
}
+
+ /**
+ * Return true if this loader is either the specified class loader
+ * or an ancestor thereof.
+ * @param loader the class loader to check
+ */
+ final boolean isAncestorOf(ClassLoader loader)
+ {
+ while (loader != null)
+ {
+ if (this == loader)
+ return true;
+ loader = loader.parent;
+ }
+ return false;
+ }
}
diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java
index 932600b5f8f..5c6037ed8a7 100644
--- a/libjava/java/lang/Runtime.java
+++ b/libjava/java/lang/Runtime.java
@@ -1,5 +1,5 @@
/* Runtime.java -- access to the VM process
- Copyright (C) 1998, 2002 Free Software Foundation
+ Copyright (C) 1998, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -65,7 +65,7 @@ public class Runtime
/**
* The current security manager. This is located here instead of in
- * Runtime, to avoid security problems, as well as bootstrap issues.
+ * System, to avoid security problems, as well as bootstrap issues.
* Make sure to access it in a thread-safe manner; it is package visible
* to avoid overhead in java.lang.
*/
diff --git a/libjava/java/lang/e_pow.c b/libjava/java/lang/e_pow.c
index e53a8a287cc..b21c0e92b39 100644
--- a/libjava/java/lang/e_pow.c
+++ b/libjava/java/lang/e_pow.c
@@ -179,7 +179,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/
}
/* (x<0)**(non-int) is NaN */
- /* CYGNUS LOCAL: This used to be
+ /* GCJ LOCAL: This used to be
if((((hx>>31)+1)|yisint)==0) return (x-x)/(x-x);
but ANSI C says a right shift of a signed negative quantity is
implementation defined. */
diff --git a/libjava/java/lang/fdlibm.h b/libjava/java/lang/fdlibm.h
index 1544c0aad9e..b98120dafb9 100644
--- a/libjava/java/lang/fdlibm.h
+++ b/libjava/java/lang/fdlibm.h
@@ -15,7 +15,7 @@
#include <config.h>
#include <stdlib.h>
-/* CYGNUS LOCAL: Include files. */
+/* GCJ LOCAL: Include files. */
#include "ieeefp.h"
#include "mprec.h"
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index 0db8228d63b..4b0858225df 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -101,7 +101,7 @@ java::lang::Class::forName (jstring className)
{
klass = t->classAt (i);
}
- loader = klass->getClassLoader();
+ loader = klass->getClassLoaderInternal();
}
catch (::java::lang::ArrayIndexOutOfBoundsException *e)
{
@@ -113,13 +113,31 @@ java::lang::Class::forName (jstring className)
java::lang::ClassLoader *
java::lang::Class::getClassLoader (void)
{
-#if 0
- // FIXME: the checks we need to do are more complex. See the spec.
- // Currently we can't implement them.
java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
if (s != NULL)
- s->checkPermission (new RuntimePermission (JvNewStringLatin1 ("getClassLoader")));
-#endif
+ {
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ ClassLoader *caller_loader = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ caller_loader = caller->getClassLoaderInternal();
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
+ // If the caller has a non-null class loader, and that loader
+ // is not this class' loader or an ancestor thereof, then do a
+ // security check.
+ if (caller_loader != NULL && ! caller_loader->isAncestorOf(loader))
+ s->checkPermission (new RuntimePermission (JvNewStringLatin1 ("getClassLoader")));
+ }
// The spec requires us to return `null' for primitive classes. In
// other cases we have the option of returning `null' for classes
@@ -136,13 +154,14 @@ java::lang::Class::getClassLoader (void)
java::lang::reflect::Constructor *
java::lang::Class::getConstructor (JArray<jclass> *param_types)
{
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
+
jstring partial_sig = getSignature (param_types, true);
jint hash = partial_sig->hashCode ();
int i = isPrimitive () ? 0 : method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (methods[i].name, init_name)
&& _Jv_equal (methods[i].signature, partial_sig, hash))
{
@@ -163,7 +182,7 @@ java::lang::Class::getConstructor (JArray<jclass> *param_types)
JArray<java::lang::reflect::Constructor *> *
java::lang::Class::_getConstructors (jboolean declared)
{
- // FIXME: this method needs access checks.
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
int numConstructors = 0;
int max = isPrimitive () ? 0 : method_count;
@@ -206,13 +225,14 @@ java::lang::Class::_getConstructors (jboolean declared)
java::lang::reflect::Constructor *
java::lang::Class::getDeclaredConstructor (JArray<jclass> *param_types)
{
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
+
jstring partial_sig = getSignature (param_types, true);
jint hash = partial_sig->hashCode ();
int i = isPrimitive () ? 0 : method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (methods[i].name, init_name)
&& _Jv_equal (methods[i].signature, partial_sig, hash))
{
@@ -256,9 +276,7 @@ java::lang::Class::getField (jstring name, jint hash)
java::lang::reflect::Field *
java::lang::Class::getDeclaredField (jstring name)
{
- java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
- if (s != NULL)
- s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED);
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
int hash = name->hashCode();
for (int i = 0; i < field_count; i++)
{
@@ -277,9 +295,7 @@ java::lang::Class::getDeclaredField (jstring name)
JArray<java::lang::reflect::Field *> *
java::lang::Class::getDeclaredFields (void)
{
- java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
- if (s != NULL)
- s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED);
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
JArray<java::lang::reflect::Field *> *result
= (JArray<java::lang::reflect::Field *> *)
JvNewObjectArray (field_count, &java::lang::reflect::Field::class$, NULL);
@@ -361,6 +377,8 @@ java::lang::Class::_getDeclaredMethod (jstring name,
JArray<java::lang::reflect::Method *> *
java::lang::Class::getDeclaredMethods (void)
{
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
+
int numMethods = 0;
int max = isPrimitive () ? 0 : method_count;
int i;
@@ -424,7 +442,7 @@ java::lang::Class::getClasses (void)
JArray<jclass> *
java::lang::Class::getDeclaredClasses (void)
{
- checkMemberAccess (java::lang::reflect::Member::DECLARED);
+ memberAccessCheck (java::lang::reflect::Member::DECLARED);
// Until we have inner classes, it always makes sense to return an
// empty array.
JArray<jclass> *result
@@ -482,9 +500,7 @@ java::lang::Class::_getFields (JArray<java::lang::reflect::Field *> *result,
JArray<java::lang::reflect::Field *> *
java::lang::Class::getFields (void)
{
- // FIXME: security checking.
-
- using namespace java::lang::reflect;
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
int count = _getFields (NULL, 0);
@@ -518,7 +534,6 @@ java::lang::Class::_getMethod (jstring name, JArray<jclass> *param_types)
int i = klass->isPrimitive () ? 0 : klass->method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name)
&& _Jv_equaln (klass->methods[i].signature, partial_sig, p_len)
&& (klass->methods[i].accflags
@@ -642,7 +657,7 @@ java::lang::Class::getMethods (void)
{
using namespace java::lang::reflect;
- // FIXME: security checks.
+ memberAccessCheck(Member::PUBLIC);
// This will overestimate the size we need.
jint count = _getMethods (NULL, 0);
@@ -696,12 +711,7 @@ java::lang::Class::isInstance (jobject obj)
jobject
java::lang::Class::newInstance (void)
{
- // FIXME: do accessibility checks here. There currently doesn't
- // seem to be any way to do these.
- // FIXME: we special-case one check here just to pass a Plum Hall
- // test. Once access checking is implemented, remove this.
- if (this == &java::lang::Class::class$)
- throw new java::lang::IllegalAccessException;
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
if (isPrimitive ()
|| isInterface ()
@@ -1744,7 +1754,26 @@ _Jv_MakeVTable (jclass klass)
{
for (int i = 0; i < klass->vtable_method_count; ++i)
if (! flags[i])
- // FIXME: messsage.
- throw new java::lang::AbstractMethodError ();
+ {
+ using namespace java::lang;
+ while (klass != NULL)
+ {
+ for (int j = 0; j < klass->method_count; ++j)
+ {
+ if (klass->methods[i].index == i)
+ {
+ StringBuffer *buf = new StringBuffer ();
+ buf->append (_Jv_NewStringUtf8Const (klass->methods[i].name));
+ buf->append ((jchar) ' ');
+ buf->append (_Jv_NewStringUtf8Const (klass->methods[i].signature));
+ throw new AbstractMethodError (buf->toString ());
+ }
+ }
+ klass = klass->getSuperclass ();
+ }
+ // Couldn't find the name, which is weird.
+ // But we still must throw the error.
+ throw new AbstractMethodError ();
+ }
}
}
diff --git a/libjava/java/lang/reflect/Field.java b/libjava/java/lang/reflect/Field.java
index 6410a7f770d..b54a103d9bc 100644
--- a/libjava/java/lang/reflect/Field.java
+++ b/libjava/java/lang/reflect/Field.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -12,15 +12,6 @@ package java.lang.reflect;
* @author Per Bothner <bothner@cygnus.com>
* @date September 1998; February 1999.
*/
-/* Status: Mostly implemented.
- * However, access checks are not implemented. See natField.cc for
- * _Jv_CheckFieldAccessibility as well as the missing getCaller.
- * Note that the idea is to have to compiler convert calls to
- * setXXX(...) and getXXX(...) to setXXX(CALLER, ...) and getXXX(CALLER, ...),
- * where CALLER is reference to the class that contains the calls to
- * setXXX or getXXX. This is easy for the compiler, and replaces
- * expensive stack and table searching with a constant.
- */
public final class Field extends AccessibleObject implements Member
{
@@ -39,12 +30,12 @@ public final class Field extends AccessibleObject implements Member
}
public boolean equals (Object fld)
- {
- if (! (fld instanceof Field))
- return false;
- Field f = (Field) fld;
- return declaringClass == f.declaringClass && offset == f.offset;
- }
+ {
+ if (! (fld instanceof Field))
+ return false;
+ Field f = (Field) fld;
+ return declaringClass == f.declaringClass && offset == f.offset;
+ }
public Class getDeclaringClass ()
{
@@ -62,11 +53,6 @@ public final class Field extends AccessibleObject implements Member
return (declaringClass.hashCode() ^ offset);
}
- // The idea is that the compiler will magically translate
- // fld.getShort(obj) to fld.getShort(THISCLASS, obj).
- // This makes checking assessiblity more efficient,
- // since we don't have to do any stack-walking.
-
public boolean getBoolean (Object obj)
throws IllegalArgumentException, IllegalAccessException
{
diff --git a/libjava/java/lang/reflect/natArray.cc b/libjava/java/lang/reflect/natArray.cc
index 78751229eab..9fa2ef79d3b 100644
--- a/libjava/java/lang/reflect/natArray.cc
+++ b/libjava/java/lang/reflect/natArray.cc
@@ -1,6 +1,6 @@
// natField.cc - Implementation of java.lang.reflect.Field native methods.
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,7 @@ details. */
#include <jvm.h>
#include <gcj/cni.h>
#include <java/lang/reflect/Array.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/Byte.h>
#include <java/lang/Short.h>
@@ -38,8 +39,8 @@ java::lang::reflect::Array::newInstance (jclass componentType, jint length)
return _Jv_NewPrimArray (componentType, length);
}
else
+ // FIXME: class loader?
return JvNewObjectArray (length, componentType, NULL);
-
}
jobject
@@ -52,10 +53,26 @@ java::lang::reflect::Array::newInstance (jclass componentType,
jint* dims = elements (dimensions);
if (ndims == 1)
return newInstance (componentType, dims[0]);
+
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ ClassLoader *caller_loader = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ caller_loader = caller->getClassLoaderInternal();
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jclass arrayType = componentType;
- for (int i = 0; i < ndims; i++) // FIXME 2nd arg should
- // be "current" loader
- arrayType = _Jv_GetArrayClass (arrayType, 0);
+ for (int i = 0; i < ndims; i++)
+ arrayType = _Jv_GetArrayClass (arrayType, caller_loader);
return _Jv_NewMultiArray (arrayType, ndims, dims);
}
@@ -343,8 +360,10 @@ java::lang::reflect::Array::setBoolean (jobject array,
void
java::lang::reflect::Array::set (jobject array, jint index,
- jobject value, jclass elType)
+ jobject value, jclass elType)
{
+ // We don't have to call getElementType here, or check INDEX,
+ // because it was already done in the Java wrapper.
if (! _Jv_IsInstanceOf (value, elType))
throw new java::lang::IllegalArgumentException;
elements ((jobjectArray) array) [index] = value;
diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc
index 7f90b1243e4..466c7544112 100644
--- a/libjava/java/lang/reflect/natConstructor.cc
+++ b/libjava/java/lang/reflect/natConstructor.cc
@@ -1,6 +1,6 @@
// natConstructor.cc - Native code for Constructor class.
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -13,6 +13,8 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
+#include <java/lang/IllegalAccessException.h>
#include <java/lang/reflect/Constructor.h>
#include <java/lang/reflect/Method.h>
#include <java/lang/reflect/InvocationTargetException.h>
@@ -46,6 +48,24 @@ java::lang::reflect::Constructor::newInstance (jobjectArray args)
if (parameter_types == NULL)
getType ();
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
+ if (! isAccessible() && ! _Jv_CheckAccess(caller, declaringClass,
+ declaringClass->getModifiers()))
+ throw new java::lang::IllegalAccessException;
+
using namespace java::lang::reflect;
if (Modifier::isAbstract (declaringClass->getModifiers()))
throw new InstantiationException;
diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc
index 93e27a280ce..5f104a9d999 100644
--- a/libjava/java/lang/reflect/natField.cc
+++ b/libjava/java/lang/reflect/natField.cc
@@ -1,6 +1,6 @@
// natField.cc - Implementation of java.lang.reflect.Field native methods.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,7 @@ details. */
#include <jvm.h>
#include <java/lang/reflect/Field.h>
#include <java/lang/reflect/Modifier.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/IllegalAccessException.h>
#include <java/lang/NullPointerException.h>
@@ -46,31 +47,36 @@ java::lang::reflect::Field::getType ()
{
jfieldID fld = _Jv_FromReflectedField (this);
JvSynchronize sync (declaringClass);
- _Jv_ResolveField (fld, declaringClass->getClassLoader ());
+ _Jv_ResolveField (fld, declaringClass->getClassLoaderInternal ());
return fld->type;
}
-static void
-_Jv_CheckFieldAccessibility (jfieldID /*fld*/, jclass /*caller*/)
-{
-#if 0
- if (caller == NULL)
- caller = getCaller();
-#endif
-#if 0
- _Jv_ushort flags = fld->getModifiers();
- check accesss;
-#endif
-}
-
static void*
getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
{
+ // FIXME: we know CALLER is NULL here. At one point we planned to
+ // have the compiler insert the caller as a hidden argument in some
+ // calls. However, we never implemented that, so we have to find
+ // the caller by hand instead.
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jfieldID fld = _Jv_FromReflectedField (field);
_Jv_ushort flags = fld->getModifiers();
- if (! (flags & java::lang::reflect::Modifier::PUBLIC)
- && ! field->isAccessible ())
- _Jv_CheckFieldAccessibility (fld, caller);
+ if (! field->isAccessible ()
+ && ! _Jv_CheckAccess (caller, field->getDeclaringClass(), flags))
+ throw new java::lang::IllegalAccessException;
+
if (flags & java::lang::reflect::Modifier::STATIC)
{
jclass fldClass = field->getDeclaringClass ();
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index c0f7077cc40..7f391f91969 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -1,6 +1,6 @@
// natMethod.cc - Native code for Method class.
-/* Copyright (C) 1998, 1999, 2000, 2001 , 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 , 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -30,6 +30,7 @@ details. */
#include <java/lang/Double.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/NullPointerException.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/Class.h>
#include <gcj/method.h>
#include <gnu/gcj/RawData.h>
@@ -142,19 +143,33 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
if (parameter_types == NULL)
getType ();
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jmethodID meth = _Jv_FromReflectedMethod (this);
+ jclass klass;
if (! java::lang::reflect::Modifier::isStatic(meth->accflags))
{
- jclass k = obj ? obj->getClass() : NULL;
if (! obj)
throw new java::lang::NullPointerException;
- if (! declaringClass->isAssignableFrom(k))
+ klass = obj->getClass();
+ if (! declaringClass->isAssignableFrom(klass))
throw new java::lang::IllegalArgumentException;
- // FIXME: access checks.
// Find the possibly overloaded method based on the runtime type
// of the object.
- meth = _Jv_LookupDeclaredMethod (k, meth->name, meth->signature);
+ meth = _Jv_LookupDeclaredMethod (klass, meth->name, meth->signature);
}
else
{
@@ -162,8 +177,12 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
// here and not in _Jv_CallAnyMethodA because JNI initializes a
// class whenever a method lookup is done.
_Jv_InitClass (declaringClass);
+ klass = declaringClass;
}
+ if (! isAccessible() && ! _Jv_CheckAccess(caller, klass, meth->accflags))
+ throw new IllegalArgumentException;
+
return _Jv_CallAnyMethodA (obj, return_type, meth, false,
parameter_types, args);
}
@@ -207,7 +226,7 @@ java::lang::reflect::Method::getType ()
jclass *elts = elements (exception_types);
for (int i = 0; i < count; ++i)
elts[i] = _Jv_FindClass (method->throws[i],
- declaringClass->getClassLoader ());
+ declaringClass->getClassLoaderInternal ());
}
void
@@ -218,7 +237,7 @@ _Jv_GetTypesFromSignature (jmethodID method,
{
_Jv_Utf8Const* sig = method->signature;
- java::lang::ClassLoader *loader = declaringClass->getClassLoader();
+ java::lang::ClassLoader *loader = declaringClass->getClassLoaderInternal();
char *ptr = sig->data;
int numArgs = 0;
/* First just count the number of parameters. */
@@ -344,19 +363,11 @@ _Jv_CallAnyMethodA (jobject obj,
jclass *paramelts = elements (parameter_types);
- // FIXME: at some point the compiler is going to add extra arguments
- // to some functions. In particular we are going to do this for
- // handling access checks in reflection. We must add these hidden
- // arguments here.
-
// Special case for the `this' argument of a constructor. Note that
// the JDK 1.2 docs specify that the new object must be allocated
// before argument conversions are done.
if (is_constructor)
- {
- // FIXME: must special-case String, arrays, maybe others here.
- obj = JvAllocObject (return_type);
- }
+ obj = JvAllocObject (return_type);
const int size_per_arg = sizeof(jvalue);
ffi_cif cif;
@@ -488,8 +499,6 @@ _Jv_CallAnyMethodA (jobject obj,
JArray<jclass> *parameter_types,
jobjectArray args)
{
- // FIXME: access checks.
-
if (parameter_types->length == 0 && args == NULL)
{
// The JDK accepts this, so we do too.
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 12c86914e30..fa6f660ffb7 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -213,7 +213,7 @@ public final class URL implements Serializable
* @param port The port number to use, or -1 to use the protocol's default
* port
* @param file The "file" portion of the URL.
- * @param handler The protocol handler to use with this URL.
+ * @param ph The protocol handler to use with this URL.
*
* @exception MalformedURLException If no protocol handler can be loaded
* for the specified protocol.
@@ -222,8 +222,8 @@ public final class URL implements Serializable
*
* @since 1.2
*/
- public URL(String protocol, String host, int port, String file,
- URLStreamHandler ph)
+ public URL (String protocol, String host, int port, String file,
+ URLStreamHandler ph)
throws MalformedURLException
{
if (protocol == null)
@@ -320,7 +320,7 @@ public final class URL implements Serializable
*
* @param context The context in which to parse the specification
* @param spec The string to parse as an URL
- * @param handler The stream handler for the URL
+ * @param ph The stream handler for the URL
*
* @exception MalformedURLException If a protocol handler cannot be found
* or the URL cannot be parsed
@@ -718,6 +718,14 @@ public final class URL implements Serializable
return ph.toExternalForm(this);
}
+ /**
+ * This internal method is used in two different constructors to load
+ * a protocol handler for this URL.
+ *
+ * @param protocol The protocol to load a handler for
+ *
+ * @return A URLStreamHandler for this protocol, or null when not found.
+ */
private static synchronized URLStreamHandler
getURLStreamHandler (String protocol)
{
diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java
index 10b67352f04..9a468bf71af 100644
--- a/libjava/java/net/URLClassLoader.java
+++ b/libjava/java/net/URLClassLoader.java
@@ -311,6 +311,9 @@ public class URLClassLoader extends SecureClassLoader
if (jarfile == null)
return null;
+ if (name.startsWith("/"))
+ name = name.substring(1);
+
JarEntry je = jarfile.getJarEntry(name);
if(je != null)
return new JarURLResource(this, name, je);
@@ -654,6 +657,11 @@ public class URLClassLoader extends SecureClassLoader
*/
protected void addURL(URL newUrl)
{
+ addURLImpl(newUrl);
+ }
+
+ private void addURLImpl(URL newUrl)
+ {
synchronized(urlloaders)
{
if (newUrl == null)
@@ -690,7 +698,7 @@ public class URLClassLoader extends SecureClassLoader
{
for (int i = 0; i < newUrls.length; i++)
{
- addURL(newUrls[i]);
+ addURLImpl(newUrls[i]);
}
}
diff --git a/libjava/java/nio/MappedByteBufferImpl.java b/libjava/java/nio/MappedByteBufferImpl.java
index 422794872b7..f28f1137535 100644
--- a/libjava/java/nio/MappedByteBufferImpl.java
+++ b/libjava/java/nio/MappedByteBufferImpl.java
@@ -38,8 +38,8 @@ exception statement from your version. */
package java.nio;
-import gnu.java.nio.FileChannelImpl;
import java.io.IOException;
+import java.nio.channels.FileChannelImpl;
import gnu.gcj.RawData;
public class MappedByteBufferImpl extends MappedByteBuffer
diff --git a/libjava/java/util/logging/Handler.java b/libjava/java/util/logging/Handler.java
index 324532187d3..c0fb1cd653a 100644
--- a/libjava/java/util/logging/Handler.java
+++ b/libjava/java/util/logging/Handler.java
@@ -379,7 +379,7 @@ h.setFormatter(h.getFormatter());</pre>
*/
public boolean isLoggable(LogRecord record)
{
- if (record.getLevel().intValue() < level.intValue())
+ if (record.getLevel().intValue() <= level.intValue())
return false;
if (filter != null)
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index 06238cea176..b6bc5414d08 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -308,7 +308,7 @@ public class ZipFile implements ZipConstants
*/
protected void finalize() throws IOException
{
- if (!closed) close();
+ if (!closed && raf != null) close();
}
/**
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
index 20b6cc51cb3..20396398d10 100644
--- a/libjava/javax/naming/CompoundName.java
+++ b/libjava/javax/naming/CompoundName.java
@@ -142,13 +142,17 @@ public class CompoundName implements Name, Cloneable, Serializable
// Otherwise, fall through.
}
// Quotes are only special at the start of a component.
- else if (new_element.length () == 0 && special == beginQuote)
+ else if (new_element.length () == 0
+ && special == beginQuote
+ && beginQuote != null)
{
quote = endQuote;
i += special.length ();
continue;
}
- else if (new_element.length () == 0 && special == beginQuote2)
+ else if (new_element.length () == 0
+ && special == beginQuote2
+ && beginQuote2 != null)
{
quote = endQuote2;
i += special.length ();
diff --git a/libjava/javax/naming/spi/NamingManager.java b/libjava/javax/naming/spi/NamingManager.java
index 6d02f9d2cba..8b215cee5c5 100644
--- a/libjava/javax/naming/spi/NamingManager.java
+++ b/libjava/javax/naming/spi/NamingManager.java
@@ -83,13 +83,17 @@ public class NamingManager
try
{
- icf = (InitialContextFactory) Class.forName (java_naming_factory_initial).newInstance ();
+ icf = (InitialContextFactory)Class.forName
+ (java_naming_factory_initial, true,
+ Thread.currentThread().getContextClassLoader())
+ .newInstance ();
}
catch (Exception exception)
{
NoInitialContextException e
- = new NoInitialContextException ("Can't load InitialContextFactory class: "
- + java_naming_factory_initial);
+ = new NoInitialContextException
+ ("Can't load InitialContextFactory class: "
+ + java_naming_factory_initial);
e.setRootCause(exception);
throw e;
}
diff --git a/libjava/javax/swing/AbstractButton.java b/libjava/javax/swing/AbstractButton.java
index 951650dbdbd..d44d9775f3a 100644
--- a/libjava/javax/swing/AbstractButton.java
+++ b/libjava/javax/swing/AbstractButton.java
@@ -71,740 +71,731 @@ import javax.swing.text.AttributeSet;
public abstract class AbstractButton extends JComponent
implements ItemSelectable, SwingConstants
{
- Icon default_icon, pressed_button, disabled_button,
- selected_button, disabled_selected_button, current_icon;
- String text;
-
- int vert_align = CENTER;
- int hori_align = CENTER;
- int hori_text_pos = CENTER;
- int vert_text_pos = CENTER;
-
- boolean paint_border = true, paint_focus;
- Action action_taken;
- ButtonModel model;
- Insets margin;
-
-
- public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
-
- /**
- * AccessibleAbstractButton
- */
- protected abstract class AccessibleAbstractButton
- extends AccessibleJComponent
- implements AccessibleAction, AccessibleValue, AccessibleText {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor AccessibleAbstractButton
- * @param component TODO
- */
- protected AccessibleAbstractButton(AbstractButton component) {
- super(component);
- // TODO
- } // AccessibleAbstractButton()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getAccessibleStateSet
- * @returns AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet() {
- return null; // TODO
- } // getAccessibleStateSet()
-
- /**
- * getAccessibleName
- * @returns String
- */
- public String getAccessibleName() {
- return null; // TODO
- } // getAccessibleName()
-
- /**
- * getAccessibleIcon
- * @returns AccessibleIcon[]
- */
- public AccessibleIcon[] getAccessibleIcon() {
- return null; // TODO
- } // getAccessibleIcon()
-
- /**
- * getAccessibleRelationSet
- * @returns AccessibleRelationSet
- */
- public AccessibleRelationSet getAccessibleRelationSet() {
- return null; // TODO
- } // getAccessibleRelationSet()
-
- /**
- * getAccessibleAction
- * @returns AccessibleAction
- */
- public AccessibleAction getAccessibleAction() {
- return null; // TODO
- } // getAccessibleAction()
-
- /**
- * getAccessibleValue
- * @returns AccessibleValue
- */
- public AccessibleValue getAccessibleValue() {
- return null; // TODO
- } // getAccessibleValue()
-
- /**
- * getAccessibleActionCount
- * @returns int
- */
- public int getAccessibleActionCount() {
- return 0; // TODO
- } // getAccessibleActionCount()
-
- /**
- * getAccessibleActionDescription
- * @param value0 TODO
- * @returns String
- */
- public String getAccessibleActionDescription(int value0) {
- return null; // TODO
- } // getAccessibleActionDescription()
-
- /**
- * doAccessibleAction
- * @param value0 TODO
- * @returns boolean
- */
- public boolean doAccessibleAction(int value0) {
- return false; // TODO
- } // doAccessibleAction()
-
- /**
- * getCurrentAccessibleValue
- * @returns Number
- */
- public Number getCurrentAccessibleValue() {
- return null; // TODO
- } // getCurrentAccessibleValue()
-
- /**
- * setCurrentAccessibleValue
- * @param value0 TODO
- * @returns boolean
- */
- public boolean setCurrentAccessibleValue(Number value0) {
- return false; // TODO
- } // setCurrentAccessibleValue()
-
- /**
- * getMinimumAccessibleValue
- * @returns Number
- */
- public Number getMinimumAccessibleValue() {
- return null; // TODO
- } // getMinimumAccessibleValue()
-
- /**
- * getMaximumAccessibleValue
- * @returns Number
- */
- public Number getMaximumAccessibleValue() {
- return null; // TODO
- } // getMaximumAccessibleValue()
-
- /**
- * getAccessibleText
- * @returns AccessibleText
- */
- public AccessibleText getAccessibleText() {
- return null; // TODO
- } // getAccessibleText()
-
- /**
- * getIndexAtPoint
- * @param value0 TODO
- * @returns int
- */
- public int getIndexAtPoint(Point value0) {
- return 0; // TODO
- } // getIndexAtPoint()
-
- /**
- * getCharacterBounds
- * @param value0 TODO
- * @returns Rectangle
- */
- public Rectangle getCharacterBounds(int value0) {
- return null; // TODO
- } // getCharacterBounds()
-
- /**
- * getCharCount
- * @returns int
- */
- public int getCharCount() {
- return 0; // TODO
- } // getCharCount()
-
- /**
- * getCaretPosition
- * @returns int
- */
- public int getCaretPosition() {
- return 0; // TODO
- } // getCaretPosition()
-
- /**
- * getAtIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getAtIndex(int value0, int value1) {
- return null; // TODO
- } // getAtIndex()
-
- /**
- * getAfterIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getAfterIndex(int value0, int value1) {
- return null; // TODO
- } // getAfterIndex()
-
- /**
- * getBeforeIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getBeforeIndex(int value0, int value1) {
- return null; // TODO
- } // getBeforeIndex()
-
- /**
- * getCharacterAttribute
- * @param value0 TODO
- * @returns AttributeSet
- */
- public AttributeSet getCharacterAttribute(int value0) {
- return null; // TODO
- } // getCharacterAttribute()
-
- /**
- * getSelectionStart
- * @returns int
- */
- public int getSelectionStart() {
- return 0; // TODO
- } // getSelectionStart()
-
- /**
- * getSelectionEnd
- * @returns int
- */
- public int getSelectionEnd() {
- return 0; // TODO
- } // getSelectionEnd()
-
- /**
- * getSelectedText
- * @returns String
- */
- public String getSelectedText() {
- return null; // TODO
- } // getSelectedText()
-
- /**
- * getTextRectangle
- * @returns Rectangle
- */
- private Rectangle getTextRectangle() {
- return null; // TODO
- } // getTextRectangle()
-
-
- } // AccessibleAbstractButton
-
-
- static private class JFocusListener implements FocusListener
- {
- AbstractButton c;
-
- JFocusListener(AbstractButton c)
- {
- this.c = c;
- }
-
- public void focusLost(FocusEvent event)
- {
- c.getModel().setArmed(false);
-
- System.out.println("LOST FOCUS");
- if (c.isFocusPainted())
- {
- c.repaint();
- }
- }
- public void focusGained(FocusEvent event)
- {
- System.out.println("GAIN FOCUS");
- }
- }
-
-
- /**********************************************
- *
- *
- * Constructors
- *
- *
- ****************/
-
- AbstractButton()
- {
- this("",null);
- }
-
- AbstractButton(String text,
- Icon icon)
- {
- this.text = text;
- setIcon(icon);
-
- setAlignmentX(LEFT_ALIGNMENT);
- setAlignmentY(CENTER_ALIGNMENT);
-
- addFocusListener( new JFocusListener(this) );
-
- setModel(new DefaultButtonModel(this));
-
- updateUI(); // get a proper ui
- }
-
-
- /**********************************************
- *
- *
- * Actions etc
- *
- *
- ****************/
-
- public ButtonModel getModel()
- { return model; }
- public void setModel(ButtonModel newModel)
- { model = newModel; }
-
- public String getActionCommand()
- { return getModel().getActionCommand(); }
- public void setActionCommand(String aCommand)
- { getModel().setActionCommand(aCommand); }
-
- public void addActionListener(ActionListener l)
- { getModel().addActionListener(l); }
- public void removeActionListener(ActionListener l)
- { getModel().removeActionListener(l); }
-
- public void addChangeListener(ChangeListener l)
- { getModel().addChangeListener(l); }
- public void removeChangeListener(ChangeListener l)
- { getModel().removeChangeListener(l); }
-
- public void addItemListener(ItemListener l)
- { getModel().addItemListener(l); }
- public void removeItemListener(ItemListener l)
- { getModel().removeItemListener(l); }
-
- public int getHorizontalAlignment()
- { return hori_align; }
- public int getHorizontalTextPosition()
- { return hori_text_pos; }
- public int getVerticalAlignment()
- { return vert_align; }
- public int getVerticalTextPosition()
- { return vert_text_pos; }
-
-
- protected void fireItemStateChanged(ItemEvent event)
- { getModel().fireItemStateChanged(event); }
- protected void fireStateChanged(ChangeEvent event)
- { getModel().fireStateChanged(event); }
- protected void fireActionPerformed(ActionEvent event)
- { getModel().fireActionPerformed(event); }
-
- public void setVerticalAlignment(int alignment)
- { vert_align = alignment; }
- public void setHorizontalAlignment(int alignment)
- { hori_align = alignment; }
- public void setVerticalTextPosition(int textPosition)
- { vert_text_pos = textPosition; }
- public void setHorizontalTextPosition(int textPosition)
- { hori_text_pos = textPosition; }
-
- public int getMnemonic()
- { return getModel().getMnemonic(); }
- public void setMnemonic(char mne)
- { getModel().setMnemonic(mne); }
- public void setMnemonic(int mne)
- { getModel().setMnemonic(mne); }
-
- public void setRolloverEnabled(boolean b)
- { getModel().setRollover(b); }
- public boolean isRolloverEnabled()
- { return getModel().isRollover(); }
-
-
- public boolean isBorderPainted()
- { return paint_border; }
- public void setBorderPainted(boolean b)
- {
- if (b != paint_border)
- {
- paint_border = b;
- revalidate();
- repaint();
- }
- }
-
- public Action getAction()
- { return action_taken; }
- public void setAction(Action a)
- {
- action_taken = a;
- revalidate();
- repaint();
- }
-
- public void setSelected(boolean b)
- { getModel().setSelected(b); }
- public boolean isSelected()
- { return getModel().isSelected(); }
-
-
- public Icon getIcon()
- { return default_icon; }
- public void setIcon(Icon defaultIcon)
- {
- if (default_icon == defaultIcon)
- return;
-
- default_icon = defaultIcon;
- if (default_icon != null)
- {
- // XXX FIXME - icons do not know their parent
-// default_icon.setParent(this);
- }
- revalidate();
- repaint();
- }
-
- public String getText()
- { return text; }
- public void setLabel(String label)
- { setText(label); }
- public String getLabel()
- { return getText(); }
- public void setText(String text)
- {
- this.text = text;
- revalidate();
- repaint();
- }
-
-
- public Insets getMargin()
- { return margin; }
- public void setMargin(Insets m)
- {
- margin = m;
- revalidate();
- repaint();
- }
-
- public void setEnabled(boolean b)
- {
- super.setEnabled(b);
- getModel().setEnabled(b);
- repaint();
- }
-
- public Icon getPressedIcon()
- { return pressed_button; }
- public void setPressedIcon(Icon pressedIcon)
- {
- pressed_button = pressedIcon;
- revalidate();
- repaint();
- }
-
-
- public Icon getDisabledIcon()
- { return disabled_button; }
- public void setDisabledIcon(Icon disabledIcon)
- {
- disabled_button = disabledIcon;
- revalidate();
- repaint();
- }
-
- public boolean isFocusPainted()
- { return paint_focus; }
- public void setFocusPainted(boolean b)
- {
- boolean old = paint_focus;
- paint_focus = b;
-
- firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY,
- old,
- b);
- if (hasFocus())
- {
- revalidate();
- repaint();
- }
- }
-
- public boolean isFocusTraversable()
- {
- //Identifies whether or not this component can receive the focus.
- return true;
- }
-
-
- protected int checkHorizontalKey(int key, String exception)
- {
- // Verify that key is a legal value for the horizontalAlignment properties.
- return 0;
- }
- protected int checkVerticalKey(int key, String exception)
- {
- // Ensures that the key is a valid.
- return 0;
- }
- protected void configurePropertiesFromAction(Action a)
- {
- //Factory method which sets the ActionEvent source's properties according to values from the Action instance.
- }
-
- protected ActionListener createActionListener()
- {
- return new ActionListener()
- {
- public void actionPerformed(ActionEvent e) { }
- };
- }
-
- protected PropertyChangeListener createActionPropertyChangeListener(Action a)
- {
- //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
- return null;
- }
- protected ChangeListener createChangeListener()
- {
- // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation.
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent e) { }
- };
- }
-
- protected ItemListener createItemListener()
- {
- return new ItemListener()
- {
- public void itemStateChanged(ItemEvent e) { }
- };
- }
-
-
- public void doClick()
- {
- doClick(100);
- }
- public void doClick(int pressTime)
- {
- //Toolkit.tlkBeep ();
- //Programmatically perform a "click".
- }
-
-
- public Icon getDisabledSelectedIcon()
- {
- //Returns the icon used by the button when it's disabled and selected.
- return disabled_selected_button;
- }
-
-
- public Icon getRolloverIcon()
- {
- // Returns the rollover icon for the button.
- return null;
- }
-
- Icon getRolloverSelectedIcon()
- {
- // Returns the rollover selection icon for the button.
- return null;
- }
- Icon getSelectedIcon()
- {
- // Returns the selected icon for the button.
- return selected_button;
- }
-
-
- public Object[] getSelectedObjects()
- {
- //Returns an array (length 1) containing the label or null if the button is not selected.
- return null;
- }
-
-
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
- {
- //This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
- return current_icon == img;
- }
-
- public boolean isContentAreaFilled()
- {
- // Checks whether the "content area" of the button should be filled.
- return false;
- }
-
-
-
- protected void paintBorder(Graphics g)
- {
- // Paint the button's border if BorderPainted property is true.
- if (isBorderPainted())
- super.paintBorder(g);
- }
- protected String paramString()
- {
- // Returns a string representation of this AbstractButton.
- return "AbstractButton";
- }
-
-
- public void setContentAreaFilled(boolean b)
- {
- //Sets whether the button should paint the content area or leave it transparent.
- }
-
-
- public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
- {
- // Sets the disabled selection icon for the button.
- }
-
- public void setRolloverIcon(Icon rolloverIcon)
- {
- // Sets the rollover icon for the button.
- }
- public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
- {
- // Sets the rollover selected icon for the button.
- }
-
-
- public void setSelectedIcon(Icon selectedIcon)
- {
- // Sets the selected icon for the button.
- }
-
-
- public void setUI(ButtonUI ui)
- { // Sets the L&F object that renders this component.
- super.setUI(ui);
- }
-
- public ButtonUI getUI()
- {
- //Returns the L&F object that renders this component.
- return (ButtonUI) ui;
- }
-
- public void updateUI()
- {
- /*
- // Notification from the UIFactory that the L&F has changed.
- if (getUI() == null)
- {
- setUI(getUI());
- }
- */
- }
-
- protected void processActionEvent(ActionEvent e)
- {
- System.out.println("PROCESS-ACTION-EVENT: " + e);
- }
-
-
- protected void processMouseEvent(MouseEvent e)
- {
- // System.out.println("PROCESS-MOUSE-EVENT: " + e + ", PRESSED-IN-MODEL="+getModel().isPressed());
-
- switch (e.getID())
- {
- case MouseEvent.MOUSE_MOVED:
- {
- break;
- }
- case MouseEvent.MOUSE_PRESSED:
- {
- if (! isEnabled())
- {
- System.out.println("button not enabled, ignoring press");
- }
- else
- {
- System.out.println("telling model:press: " + getModel());
- getModel().setPressed(true);
- repaint();
- }
- break;
- }
-
- case MouseEvent.MOUSE_RELEASED:
- {
- if (! isEnabled())
- {
- System.out.println("button not enabled, ignoring release");
- }
- else
- {
- int flags = 0;
-
- System.out.println(" XXX--> " + getActionCommand());
-
- fireActionPerformed(new ActionEvent(this,
- ActionEvent.ACTION_PERFORMED,
- getActionCommand(),
- flags));
-
- //System.out.println("telling model:release");
- getModel().setPressed(false);
- repaint();
- }
- break;
- }
- case MouseEvent.MOUSE_CLICKED:
- {
- break;
- }
- }
- }
+ Icon default_icon, pressed_button, disabled_button,
+ selected_button, disabled_selected_button, current_icon;
+ String text;
+
+ int vert_align = CENTER;
+ int hori_align = CENTER;
+ int hori_text_pos = CENTER;
+ int vert_text_pos = CENTER;
+
+ boolean paint_border = true, paint_focus;
+ Action action_taken;
+ ButtonModel model;
+ Insets margin;
+
+ public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
+
+ /**
+ * AccessibleAbstractButton
+ */
+ protected abstract class AccessibleAbstractButton
+ extends AccessibleJComponent
+ implements AccessibleAction, AccessibleValue, AccessibleText {
+
+ /**
+ * Constructor AccessibleAbstractButton
+ * @param component TODO
+ */
+ protected AccessibleAbstractButton(AbstractButton component) {
+ super(component);
+ // TODO
+ } // AccessibleAbstractButton()
+
+ /**
+ * getAccessibleStateSet
+ * @returns AccessibleStateSet
+ */
+ public AccessibleStateSet getAccessibleStateSet() {
+ return null; // TODO
+ } // getAccessibleStateSet()
+
+ /**
+ * getAccessibleName
+ * @returns String
+ */
+ public String getAccessibleName() {
+ return null; // TODO
+ } // getAccessibleName()
+
+ /**
+ * getAccessibleIcon
+ * @returns AccessibleIcon[]
+ */
+ public AccessibleIcon[] getAccessibleIcon() {
+ return null; // TODO
+ } // getAccessibleIcon()
+
+ /**
+ * getAccessibleRelationSet
+ * @returns AccessibleRelationSet
+ */
+ public AccessibleRelationSet getAccessibleRelationSet() {
+ return null; // TODO
+ } // getAccessibleRelationSet()
+
+ /**
+ * getAccessibleAction
+ * @returns AccessibleAction
+ */
+ public AccessibleAction getAccessibleAction() {
+ return null; // TODO
+ } // getAccessibleAction()
+
+ /**
+ * getAccessibleValue
+ * @returns AccessibleValue
+ */
+ public AccessibleValue getAccessibleValue() {
+ return null; // TODO
+ } // getAccessibleValue()
+
+ /**
+ * getAccessibleActionCount
+ * @returns int
+ */
+ public int getAccessibleActionCount() {
+ return 0; // TODO
+ } // getAccessibleActionCount()
+
+ /**
+ * getAccessibleActionDescription
+ * @param value0 TODO
+ * @returns String
+ */
+ public String getAccessibleActionDescription(int value0) {
+ return null; // TODO
+ } // getAccessibleActionDescription()
+
+ /**
+ * doAccessibleAction
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean doAccessibleAction(int value0) {
+ return false; // TODO
+ } // doAccessibleAction()
+
+ /**
+ * getCurrentAccessibleValue
+ * @returns Number
+ */
+ public Number getCurrentAccessibleValue() {
+ return null; // TODO
+ } // getCurrentAccessibleValue()
+
+ /**
+ * setCurrentAccessibleValue
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean setCurrentAccessibleValue(Number value0) {
+ return false; // TODO
+ } // setCurrentAccessibleValue()
+
+ /**
+ * getMinimumAccessibleValue
+ * @returns Number
+ */
+ public Number getMinimumAccessibleValue() {
+ return null; // TODO
+ } // getMinimumAccessibleValue()
+
+ /**
+ * getMaximumAccessibleValue
+ * @returns Number
+ */
+ public Number getMaximumAccessibleValue() {
+ return null; // TODO
+ } // getMaximumAccessibleValue()
+
+ /**
+ * getAccessibleText
+ * @returns AccessibleText
+ */
+ public AccessibleText getAccessibleText() {
+ return null; // TODO
+ } // getAccessibleText()
+
+ /**
+ * getIndexAtPoint
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getIndexAtPoint(Point value0) {
+ return 0; // TODO
+ } // getIndexAtPoint()
+
+ /**
+ * getCharacterBounds
+ * @param value0 TODO
+ * @returns Rectangle
+ */
+ public Rectangle getCharacterBounds(int value0) {
+ return null; // TODO
+ } // getCharacterBounds()
+
+ /**
+ * getCharCount
+ * @returns int
+ */
+ public int getCharCount() {
+ return 0; // TODO
+ } // getCharCount()
+
+ /**
+ * getCaretPosition
+ * @returns int
+ */
+ public int getCaretPosition() {
+ return 0; // TODO
+ } // getCaretPosition()
+
+ /**
+ * getAtIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getAtIndex(int value0, int value1) {
+ return null; // TODO
+ } // getAtIndex()
+
+ /**
+ * getAfterIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getAfterIndex(int value0, int value1) {
+ return null; // TODO
+ } // getAfterIndex()
+
+ /**
+ * getBeforeIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getBeforeIndex(int value0, int value1) {
+ return null; // TODO
+ } // getBeforeIndex()
+
+ /**
+ * getCharacterAttribute
+ * @param value0 TODO
+ * @returns AttributeSet
+ */
+ public AttributeSet getCharacterAttribute(int value0) {
+ return null; // TODO
+ } // getCharacterAttribute()
+
+ /**
+ * getSelectionStart
+ * @returns int
+ */
+ public int getSelectionStart() {
+ return 0; // TODO
+ } // getSelectionStart()
+
+ /**
+ * getSelectionEnd
+ * @returns int
+ */
+ public int getSelectionEnd() {
+ return 0; // TODO
+ } // getSelectionEnd()
+
+ /**
+ * getSelectedText
+ * @returns String
+ */
+ public String getSelectedText() {
+ return null; // TODO
+ } // getSelectedText()
+
+ /**
+ * getTextRectangle
+ * @returns Rectangle
+ */
+ private Rectangle getTextRectangle() {
+ return null; // TODO
+ } // getTextRectangle()
+
+
+ } // AccessibleAbstractButton
+
+
+ static private class JFocusListener implements FocusListener
+ {
+ AbstractButton c;
+
+ JFocusListener(AbstractButton c)
+ {
+ this.c = c;
+ }
+
+ public void focusLost(FocusEvent event)
+ {
+ c.getModel().setArmed(false);
+
+ System.out.println("LOST FOCUS");
+ if (c.isFocusPainted())
+ {
+ c.repaint();
+ }
+ }
+ public void focusGained(FocusEvent event)
+ {
+ System.out.println("GAIN FOCUS");
+ }
+ }
+
+ AbstractButton()
+ {
+ this("",null);
+ }
+
+ AbstractButton(String text,
+ Icon icon)
+ {
+ this.text = text;
+ setIcon(icon);
+
+ setAlignmentX(LEFT_ALIGNMENT);
+ setAlignmentY(CENTER_ALIGNMENT);
+
+ addFocusListener( new JFocusListener(this) );
+
+ setModel(new DefaultButtonModel(this));
+
+ updateUI(); // get a proper ui
+ }
+
+ public ButtonModel getModel()
+ { return model; }
+
+ public void setModel(ButtonModel newModel)
+ { model = newModel; }
+
+ public String getActionCommand()
+ { return getModel().getActionCommand(); }
+
+ public void setActionCommand(String aCommand)
+ { getModel().setActionCommand(aCommand); }
+
+ public void addActionListener(ActionListener l)
+ { getModel().addActionListener(l); }
+
+ public void removeActionListener(ActionListener l)
+ { getModel().removeActionListener(l); }
+
+ public void addChangeListener(ChangeListener l)
+ { getModel().addChangeListener(l); }
+
+ public void removeChangeListener(ChangeListener l)
+ { getModel().removeChangeListener(l); }
+
+ public void addItemListener(ItemListener l)
+ { getModel().addItemListener(l); }
+
+ public void removeItemListener(ItemListener l)
+ { getModel().removeItemListener(l); }
+
+ public int getHorizontalAlignment()
+ { return hori_align; }
+
+ public int getHorizontalTextPosition()
+ { return hori_text_pos; }
+
+ public int getVerticalAlignment()
+ { return vert_align; }
+
+ public int getVerticalTextPosition()
+ { return vert_text_pos; }
+
+ protected void fireItemStateChanged(ItemEvent event)
+ {
+ }
+
+ protected void fireStateChanged(ChangeEvent event)
+ {
+ }
+
+ protected void fireActionPerformed(ActionEvent event)
+ {
+ }
+
+ public void setVerticalAlignment(int alignment)
+ { vert_align = alignment; }
+
+ public void setHorizontalAlignment(int alignment)
+ { hori_align = alignment; }
+
+ public void setVerticalTextPosition(int textPosition)
+ { vert_text_pos = textPosition; }
+
+ public void setHorizontalTextPosition(int textPosition)
+ { hori_text_pos = textPosition; }
+
+ public int getMnemonic()
+ { return getModel().getMnemonic(); }
+
+ public void setMnemonic(char mne)
+ { getModel().setMnemonic(mne); }
+
+ public void setMnemonic(int mne)
+ { getModel().setMnemonic(mne); }
+
+ public void setRolloverEnabled(boolean b)
+ { getModel().setRollover(b); }
+
+ public boolean isRolloverEnabled()
+ { return getModel().isRollover(); }
+
+ public boolean isBorderPainted()
+ { return paint_border; }
+
+ public void setBorderPainted(boolean b)
+ {
+ if (b != paint_border)
+ {
+ paint_border = b;
+ revalidate();
+ repaint();
+ }
+ }
+
+ public Action getAction()
+ { return action_taken; }
+
+ public void setAction(Action a)
+ {
+ action_taken = a;
+ revalidate();
+ repaint();
+ }
+
+ public void setSelected(boolean b)
+ { getModel().setSelected(b); }
+
+ public boolean isSelected()
+ { return getModel().isSelected(); }
+
+ public Icon getIcon()
+ { return default_icon; }
+
+ public void setIcon(Icon defaultIcon)
+ {
+ if (default_icon == defaultIcon)
+ return;
+
+ default_icon = defaultIcon;
+ if (default_icon != null)
+ {
+ // XXX FIXME - icons do not know their parent
+ // default_icon.setParent(this);
+ }
+ revalidate();
+ repaint();
+ }
+
+ public String getText()
+ { return text; }
+
+ public void setLabel(String label)
+ { setText(label); }
+
+ public String getLabel()
+ { return getText(); }
+
+ public void setText(String text)
+ {
+ this.text = text;
+ revalidate();
+ repaint();
+ }
+
+ public Insets getMargin()
+ { return margin; }
+
+ public void setMargin(Insets m)
+ {
+ margin = m;
+ revalidate();
+ repaint();
+ }
+
+ public void setEnabled(boolean b)
+ {
+ super.setEnabled(b);
+ getModel().setEnabled(b);
+ repaint();
+ }
+
+ public Icon getPressedIcon()
+ { return pressed_button; }
+
+ public void setPressedIcon(Icon pressedIcon)
+ {
+ pressed_button = pressedIcon;
+ revalidate();
+ repaint();
+ }
+
+ public Icon getDisabledIcon()
+ { return disabled_button; }
+
+ public void setDisabledIcon(Icon disabledIcon)
+ {
+ disabled_button = disabledIcon;
+ revalidate();
+ repaint();
+ }
+
+ public boolean isFocusPainted()
+ { return paint_focus; }
+
+ public void setFocusPainted(boolean b)
+ {
+ boolean old = paint_focus;
+ paint_focus = b;
+
+ firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY,
+ old,
+ b);
+ if (hasFocus())
+ {
+ revalidate();
+ repaint();
+ }
+ }
+
+ public boolean isFocusTraversable()
+ {
+ //Identifies whether or not this component can receive the focus.
+ return true;
+ }
+
+
+ protected int checkHorizontalKey(int key, String exception)
+ {
+ // Verify that key is a legal value for the horizontalAlignment properties.
+ return 0;
+ }
+
+ protected int checkVerticalKey(int key, String exception)
+ {
+ // Ensures that the key is a valid.
+ return 0;
+ }
+
+ protected void configurePropertiesFromAction(Action a)
+ {
+ //Factory method which sets the ActionEvent source's properties according to values from the Action instance.
+ }
+
+ protected ActionListener createActionListener()
+ {
+ return new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e) { }
+ };
+ }
+
+ protected PropertyChangeListener createActionPropertyChangeListener(Action a)
+ {
+ //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
+ return null;
+ }
+
+ protected ChangeListener createChangeListener()
+ {
+ // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation.
+ return new ChangeListener()
+ {
+ public void stateChanged(ChangeEvent e) { }
+ };
+ }
+
+ protected ItemListener createItemListener()
+ {
+ return new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e) { }
+ };
+ }
+
+ public void doClick()
+ {
+ doClick(100);
+ }
+
+ public void doClick(int pressTime)
+ {
+ //Toolkit.tlkBeep ();
+ //Programmatically perform a "click".
+ }
+
+ public Icon getDisabledSelectedIcon()
+ {
+ //Returns the icon used by the button when it's disabled and selected.
+ return disabled_selected_button;
+ }
+
+ public Icon getRolloverIcon()
+ {
+ // Returns the rollover icon for the button.
+ return null;
+ }
+
+ Icon getRolloverSelectedIcon()
+ {
+ // Returns the rollover selection icon for the button.
+ return null;
+ }
+
+ Icon getSelectedIcon()
+ {
+ // Returns the selected icon for the button.
+ return selected_button;
+ }
+
+ public Object[] getSelectedObjects()
+ {
+ //Returns an array (length 1) containing the label or null if the button is not selected.
+ return null;
+ }
+
+ public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
+ {
+ //This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
+ return current_icon == img;
+ }
+
+ public boolean isContentAreaFilled()
+ {
+ // Checks whether the "content area" of the button should be filled.
+ return false;
+ }
+
+ protected void paintBorder(Graphics g)
+ {
+ // Paint the button's border if BorderPainted property is true.
+ if (isBorderPainted())
+ super.paintBorder(g);
+ }
+
+ protected String paramString()
+ {
+ // Returns a string representation of this AbstractButton.
+ return "AbstractButton";
+ }
+
+ public void setContentAreaFilled(boolean b)
+ {
+ //Sets whether the button should paint the content area or leave it transparent.
+ }
+
+ public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
+ {
+ // Sets the disabled selection icon for the button.
+ }
+
+ public void setRolloverIcon(Icon rolloverIcon)
+ {
+ // Sets the rollover icon for the button.
+ }
+ public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
+ {
+ // Sets the rollover selected icon for the button.
+ }
+
+ public void setSelectedIcon(Icon selectedIcon)
+ {
+ // Sets the selected icon for the button.
+ }
+
+ public void setUI(ButtonUI ui)
+ { // Sets the L&F object that renders this component.
+ super.setUI(ui);
+ }
+
+ public ButtonUI getUI()
+ {
+ //Returns the L&F object that renders this component.
+ return (ButtonUI) ui;
+ }
+
+ public void updateUI()
+ {
+ /*
+ // Notification from the UIFactory that the L&F has changed.
+ if (getUI() == null)
+ {
+ setUI(getUI());
+ }
+ */
+ }
+
+ protected void processActionEvent(ActionEvent e)
+ {
+ System.out.println("PROCESS-ACTION-EVENT: " + e);
+ }
+
+ protected void processMouseEvent(MouseEvent e)
+ {
+ // System.out.println("PROCESS-MOUSE-EVENT: " + e + ", PRESSED-IN-MODEL="+getModel().isPressed());
+
+ switch (e.getID())
+ {
+ case MouseEvent.MOUSE_MOVED:
+ {
+ break;
+ }
+ case MouseEvent.MOUSE_PRESSED:
+ {
+ if (! isEnabled())
+ {
+ System.out.println("button not enabled, ignoring press");
+ }
+ else
+ {
+ System.out.println("telling model:press: " + getModel());
+ getModel().setPressed(true);
+ repaint();
+ }
+ break;
+ }
+
+ case MouseEvent.MOUSE_RELEASED:
+ {
+ if (! isEnabled())
+ {
+ System.out.println("button not enabled, ignoring release");
+ }
+ else
+ {
+ int flags = 0;
+
+ System.out.println(" XXX--> " + getActionCommand());
+
+ fireActionPerformed(new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED,
+ getActionCommand(),
+ flags));
+
+ //System.out.println("telling model:release");
+ getModel().setPressed(false);
+ repaint();
+ }
+ break;
+ }
+ case MouseEvent.MOUSE_CLICKED:
+ {
+ break;
+ }
+ }
+ }
}
diff --git a/libjava/javax/swing/ButtonModel.java b/libjava/javax/swing/ButtonModel.java
index 6d6aa7abbf2..ae0c721003b 100644
--- a/libjava/javax/swing/ButtonModel.java
+++ b/libjava/javax/swing/ButtonModel.java
@@ -76,12 +76,4 @@ public interface ButtonModel extends ItemSelectable
void setSelected(boolean b);
boolean isSelected();
-
-
- // there are not in the spec !!
-
-
- void fireItemStateChanged(ItemEvent event);
- void fireStateChanged(ChangeEvent event);
- void fireActionPerformed(ActionEvent event);
}
diff --git a/libjava/javax/swing/SwingUtilities.java b/libjava/javax/swing/SwingUtilities.java
index a123ad83438..a9113f0ff40 100644
--- a/libjava/javax/swing/SwingUtilities.java
+++ b/libjava/javax/swing/SwingUtilities.java
@@ -58,70 +58,71 @@ import javax.accessibility.AccessibleStateSet;
public class SwingUtilities implements SwingConstants
{
public static FontMetrics getFontMetrics (Font font)
-{
- return Toolkit.getDefaultToolkit().getFontMetrics(font);
- }
+ {
+ return Toolkit.getDefaultToolkit ().getFontMetrics (font);
+ }
public static JRootPane getRootPane (Component a)
- {
- if (a instanceof JRootPane)
- return (JRootPane) a;
+ {
+ if (a instanceof JRootPane)
+ return (JRootPane) a;
- a = a.getParent();
-
- if (a != null)
- {
- return getRootPane(a);
- }
+ a = a.getParent();
- return null;
- }
+ if (a != null)
+ {
+ return getRootPane(a);
+ }
+
+ return null;
+ }
public static void updateComponentTreeUI(JFrame comp)
- {
- }
+ {
+ }
public static String layoutCompoundLabel(JComponent c,
- FontMetrics fm,
- String text,
- Icon i,
- int vert_a,
- int hor_i,
- int vert_text_pos,
- int hor_text_pos,
- Rectangle vr,
- Rectangle ir,
- Rectangle tr,
- int gap)
- {
- // view rect 'vr' already ok,
- // we need to compute ir (icon rect) and tr (text-rect)
+ FontMetrics fm,
+ String text,
+ Icon i,
+ int vert_a,
+ int hor_i,
+ int vert_text_pos,
+ int hor_text_pos,
+ Rectangle vr,
+ Rectangle ir,
+ Rectangle tr,
+ int gap)
+ {
+ // view rect 'vr' already ok,
+ // we need to compute ir (icon rect) and tr (text-rect)
- int next_x = 0;//vr.x;
- int next_y = 0;//vr.y;
+ int next_x = 0;//vr.x;
+ int next_y = 0;//vr.y;
- ir.height = ir.width = ir.y = ir.x = 0;
+ ir.height = ir.width = ir.y = ir.x = 0;
- if (i != null)
- {
- ir.x = vr.x;
- ir.y = vr.y;
- ir.width = i.getIconWidth();
- ir.height = i.getIconWidth();
+ if (i != null)
+ {
+ ir.x = vr.x;
+ ir.y = vr.y;
+ ir.width = i.getIconWidth();
+ ir.height = i.getIconWidth();
- next_x += gap + i.getIconWidth();
- next_y += gap + i.getIconHeight();
- }
+ next_x += gap + i.getIconWidth();
+ next_y += gap + i.getIconHeight();
+ }
- tr.x = next_x;
- tr.y = vr.y + (vr.height/2);
+ tr.x = next_x;
+ tr.y = vr.y + (vr.height/2);
+
+ tr.width = fm.stringWidth(text);
+ tr.height = fm.getHeight() + fm.getAscent()/2;
- tr.width = fm.stringWidth(text);
- tr.height = fm.getHeight() + fm.getAscent()/2;
+ return text;
+ }
- return text;
- }
}
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
index 556e8fffdf7..7defebd2b09 100644
--- a/libjava/javax/swing/UIManager.java
+++ b/libjava/javax/swing/UIManager.java
@@ -50,131 +50,137 @@ import javax.swing.plaf.metal.MetalLookAndFeel;
public class UIManager implements Serializable
{
- static final long serialVersionUID = -5547433830339189365L;
-
- static class LookAndFeelInfo
- {
- String name, clazz;
+ public static class LookAndFeelInfo
+ {
+ String name, clazz;
- LookAndFeelInfo(String name,
- String clazz)
- {
- this.name = name;
- this.clazz = clazz;
- }
- String getName() { return name; }
- String getClassName() { return clazz; }
+ LookAndFeelInfo(String name,
+ String clazz)
+ {
+ this.name = name;
+ this.clazz = clazz;
}
-
- static LookAndFeelInfo [] installed = {
- new LookAndFeelInfo("Metal",
- "javax.swing.plaf.metal.MetalLookAndFeel")
- };
+ String getName() { return name; }
+ String getClassName() { return clazz; }
+ }
+ private static final long serialVersionUID = -5547433830339189365L;
+
+ static LookAndFeelInfo [] installed = {
+ new LookAndFeelInfo ("Metal", "javax.swing.plaf.metal.MetalLookAndFeel")
+ };
+
+ static LookAndFeel[] aux_installed;
+
+ static LookAndFeel look_and_feel = new MetalLookAndFeel();
- static LookAndFeel[] aux_installed;
-
- static LookAndFeel look_and_feel = new MetalLookAndFeel();
-
+ public UIManager()
+ {
+ // Do nothing here.
+ }
- UIManager()
- {
- }
+ public static void addPropertyChangeListener (PropertyChangeListener listener)
+ {
+ // FIXME
+ }
- public static void addPropertyChangeListener(PropertyChangeListener listener)
- {
- // Add a PropertyChangeListener to the listener list.
- }
+ public static void removePropertyChangeListener (PropertyChangeListener listener)
+ // Remove a PropertyChangeListener from the listener list.
+ {
+ // FIXME
+ }
- public static void addAuxiliaryLookAndFeel(LookAndFeel l)
- {
- // Add a LookAndFeel to the list of auxiliary look and feels.
- if (aux_installed == null)
- {
- aux_installed = new LookAndFeel[1];
- aux_installed[0] = l;
- return;
- }
+ /**
+ * @since 1.4
+ */
+ public static PropertyChangeListener[] getPropertyChangeListeners ()
+ {
+ // FIXME
+ throw new Error ("Not implemented");
+ }
+
+ public static void addAuxiliaryLookAndFeel (LookAndFeel l)
+ {
+ // Add a LookAndFeel to the list of auxiliary look and feels.
+ if (aux_installed == null)
+ {
+ aux_installed = new LookAndFeel[1];
+ aux_installed[0] = l;
+ return;
+ }
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
- System.arraycopy(aux_installed, 0,
- T, 0,
- aux_installed.length);
- aux_installed = T;
- aux_installed[aux_installed.length-1] = l;
- }
+ LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
+ System.arraycopy(aux_installed, 0, T, 0, aux_installed.length);
+ aux_installed = T;
+ aux_installed[aux_installed.length-1] = l;
+ }
- public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
- {
- if (aux_installed == null)
- return false;
-
- for (int i=0;i<aux_installed.length;i++)
- {
- if (aux_installed[i] == laf)
- {
- aux_installed[ i ] = aux_installed[aux_installed.length-1];
-
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
- System.arraycopy(aux_installed, 0,
- T, 0,
- aux_installed.length-1);
- aux_installed = T;
- return true;
- }
- }
- return false;
- }
-
- public static LookAndFeel[] getAuxiliaryLookAndFeels()
- { return aux_installed; }
+ public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
+ {
+ if (aux_installed == null)
+ return false;
+
+ for (int i=0;i<aux_installed.length;i++)
+ {
+ if (aux_installed[i] == laf)
+ {
+ aux_installed[ i ] = aux_installed[aux_installed.length-1];
+ LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
+ System.arraycopy (aux_installed, 0, T, 0, aux_installed.length-1);
+ aux_installed = T;
+ return true;
+ }
+ }
+ return false;
+ }
+ public static LookAndFeel[] getAuxiliaryLookAndFeels()
+ { return aux_installed; }
- public static Object get(Object key)
- { return getLookAndFeel().getDefaults().get(key); }
+ public static Object get(Object key)
+ { return getLookAndFeel().getDefaults().get(key); }
- /**
- * Returns a border from the defaults table.
- */
- public static Border getBorder(Object key)
- {
- return (Border) getLookAndFeel().getDefaults().get(key);
- }
+ /**
+ * Returns a border from the defaults table.
+ */
+ public static Border getBorder(Object key)
+ {
+ return (Border) getLookAndFeel().getDefaults().get(key);
+ }
- /**
- * Returns a drawing color from the defaults table.
- */
- public static Color getColor(Object key)
- {
- return (Color) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * this string can be passed to Class.forName()
- */
- public static String getCrossPlatformLookAndFeelClassName()
- {
- return "javax.swing.plaf.metal.MetalLookAndFeel";
- }
+ /**
+ * Returns a drawing color from the defaults table.
+ */
+ public static Color getColor(Object key)
+ {
+ return (Color) getLookAndFeel().getDefaults().get(key);
+ }
- /**
- * Returns the default values for this look and feel.
- */
- static UIDefaults getDefaults()
- {
- return getLookAndFeel().getDefaults();
- }
+ /**
+ * this string can be passed to Class.forName()
+ */
+ public static String getCrossPlatformLookAndFeelClassName()
+ {
+ return "javax.swing.plaf.metal.MetalLookAndFeel";
+ }
- /**
- * Returns a dimension from the defaults table.
- */
- static Dimension getDimension(Object key)
- {
- System.out.println("UIManager.getDim");
- return new Dimension(200,100);
- }
+ /**
+ * Returns the default values for this look and feel.
+ */
+ static UIDefaults getDefaults()
+ {
+ return getLookAndFeel().getDefaults();
+ }
+ /**
+ * Returns a dimension from the defaults table.
+ */
+ static Dimension getDimension(Object key)
+ {
+ System.out.println("UIManager.getDim");
+ return new Dimension(200,100);
+ }
/**
* Retrieves a font from the defaults table of the current
@@ -189,34 +195,35 @@ public class UIManager implements Serializable
return (Font) getLookAndFeel().getDefaults().get(key);
}
- static Icon getIcon(Object key)
- // Returns an Icon from the defaults table.
- {
- return (Icon) getLookAndFeel().getDefaults().get(key);
- }
- static Insets getInsets(Object key)
- // Returns an Insets object from the defaults table.
- {
- return (Insets) getLookAndFeel().getDefaults().getInsets(key);
- }
+ static Icon getIcon(Object key)
+ // Returns an Icon from the defaults table.
+ {
+ return (Icon) getLookAndFeel().getDefaults().get(key);
+ }
+
+ static Insets getInsets(Object key)
+ // Returns an Insets object from the defaults table.
+ {
+ return (Insets) getLookAndFeel().getDefaults().getInsets(key);
+ }
- static LookAndFeelInfo[] getInstalledLookAndFeels()
- {
- return installed;
- }
+ static LookAndFeelInfo[] getInstalledLookAndFeels()
+ {
+ return installed;
+ }
- static int getInt(Object key)
- {
- Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
- if (x == null)
- return 0;
- return x.intValue();
- }
- static LookAndFeel getLookAndFeel()
- {
- return look_and_feel;
- }
+ static int getInt(Object key)
+ {
+ Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
+ if (x == null)
+ return 0;
+ return x.intValue();
+ }
+ static LookAndFeel getLookAndFeel()
+ {
+ return look_and_feel;
+ }
/**
* Returns the <code>UIDefaults</code> table of the currently active
@@ -227,73 +234,67 @@ public class UIManager implements Serializable
return getLookAndFeel().getDefaults();
}
+ static String getString(Object key)
+ // Returns a string from the defaults table.
+ {
+ return (String) getLookAndFeel().getDefaults().get(key);
+ }
+
+ static String getSystemLookAndFeelClassName()
+ // Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
+ {
+ return getCrossPlatformLookAndFeelClassName();
+ }
- static String getString(Object key)
- // Returns a string from the defaults table.
- {
- return (String) getLookAndFeel().getDefaults().get(key);
- }
- static String getSystemLookAndFeelClassName()
- // Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
- {
- return getCrossPlatformLookAndFeelClassName();
- }
+ public static ComponentUI getUI(JComponent target)
+ // Returns the L&F object that renders the target component.
+ {
+ ComponentUI ui = getDefaults().getUI(target);
+ //System.out.println("GET-UI-> " + ui + ", for " + target);
+ return ui;
+ }
+ public static void installLookAndFeel(String name, String className)
+ // Creates a new look and feel and adds it to the current array.
+ {
+ }
- public static ComponentUI getUI(JComponent target)
- // Returns the L&F object that renders the target component.
- {
- ComponentUI ui = getDefaults().getUI(target);
- //System.out.println("GET-UI-> " + ui + ", for " + target);
- return ui;
- }
+ public static void installLookAndFeel(LookAndFeelInfo info)
+ // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
+ {
+ }
+ public static Object put(Object key, Object value)
+ // Stores an object in the defaults table.
+ {
+ return getLookAndFeel().getDefaults().put(key,value);
+ }
- public static void installLookAndFeel(String name, String className)
- // Creates a new look and feel and adds it to the current array.
- {
- }
- public static void installLookAndFeel(LookAndFeelInfo info)
- // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
- {
- }
- public static Object put(Object key, Object value)
- // Stores an object in the defaults table.
- {
- return getLookAndFeel().getDefaults().put(key,value);
- }
- public static void removePropertyChangeListener(PropertyChangeListener listener)
- // Remove a PropertyChangeListener from the listener list.
- {
- }
- public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
- // Replaces the current array of installed LookAndFeelInfos.
- {
- }
- public static void setLookAndFeel(LookAndFeel newLookAndFeel)
- {
- if (look_and_feel != null)
- look_and_feel.uninitialize();
+ public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
+ // Replaces the current array of installed LookAndFeelInfos.
+ {
+ }
+
+ public static void setLookAndFeel(LookAndFeel newLookAndFeel)
+ {
+ if (look_and_feel != null)
+ look_and_feel.uninitialize();
- // Set the current default look and feel using a LookAndFeel object.
- look_and_feel = newLookAndFeel;
- look_and_feel.initialize();
+ // Set the current default look and feel using a LookAndFeel object.
+ look_and_feel = newLookAndFeel;
+ look_and_feel.initialize();
- // revalidate();
- // repaint();
- }
-
- public static void setLookAndFeel(String className)
- throws ClassNotFoundException,
- InstantiationException,
- IllegalAccessException,
- UnsupportedLookAndFeelException
- {
- // Set the current default look and feel using a class name.
- Class c = Class.forName(className);
- LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
- setLookAndFeel(a);
- }
-
+ //revalidate();
+ //repaint();
+ }
+ public static void setLookAndFeel (String className)
+ throws ClassNotFoundException, InstantiationException, IllegalAccessException,
+ UnsupportedLookAndFeelException
+ {
+ // Set the current default look and feel using a class name.
+ Class c = Class.forName(className);
+ LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
+ setLookAndFeel(a);
+ }
}
diff --git a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
index 1aa51fd64c0..43df7edffb9 100644
--- a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
+++ b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
@@ -52,90 +52,90 @@ import javax.swing.event.EventListenerList;
public class DefaultColorSelectionModel
implements ColorSelectionModel, Serializable
{
- static final long serialVersionUID = 580150227676302096L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * changeEvent
- */
- protected transient ChangeEvent changeEvent;
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList;
-
- /**
- * selectedColor
- */
- private Color selectedColor;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DefaultColorSelectionModel
- */
- public DefaultColorSelectionModel() {
- // TODO
- } // DefaultColorSelectionModel()
-
- /**
- * Constructor DefaultColorSelectionModel
- * @param color TODO
- */
- public DefaultColorSelectionModel(Color color) {
- // TODO
- } // DefaultColorSelectionModel()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getSelectedColor
- * @returns Color
- */
- public Color getSelectedColor() {
- return null; // TODO
- } // getSelectedColor()
-
- /**
- * setSelectedColor
- * @param color TODO
- */
- public void setSelectedColor(Color color) {
- // TODO
- } // setSelectedColor()
-
- /**
- * addChangeListener
- * @param listener TODO
- */
- public void addChangeListener(ChangeListener listener) {
- // TODO
- } // addChangeListener()
-
- /**
- * removeChangeListener
- * @param listener TODO
- */
- public void removeChangeListener(ChangeListener listener) {
- // TODO
- } // removeChangeListener()
-
- /**
- * fireStateChanged
- */
- protected void fireStateChanged() {
- // TODO
- } // fireStateChanged()
-
-
-} // DefaultColorSelectionModel
+ private static final long serialVersionUID = -8117143602864778804L;
+
+ private Color selectedColor;
+
+ protected transient ChangeEvent changeEvent = new ChangeEvent (this);
+ protected EventListenerList listenerList = new EventListenerList ();
+
+ /**
+ * Creates a new color selection model.
+ */
+ public DefaultColorSelectionModel()
+ {
+ this (Color.white);
+ }
+
+ /**
+ * Creates a new color selection model with a given selected color.
+ *
+ * @param color The selected color.
+ */
+ public DefaultColorSelectionModel (Color color)
+ {
+ super();
+ this.selectedColor = color;
+ }
+
+ /**
+ * Returns the selected color.
+ *
+ * @return The selected color.
+ */
+ public Color getSelectedColor()
+ {
+ return selectedColor;
+ }
+
+ /**
+ * @param color The color to set.
+ */
+ public void setSelectedColor (Color color)
+ {
+ this.selectedColor = color;
+ }
+
+ /**
+ * Adds a listener to this model.
+ *
+ * @param listener The listener to add.
+ */
+ public void addChangeListener (ChangeListener listener)
+ {
+ listenerList.add (ChangeListener.class, listener);
+ }
+
+ /**
+ * Removes a listener from this model.
+ *
+ * @param listener The listener to remove.
+ */
+ public void removeChangeListener (ChangeListener listener)
+ {
+ listenerList.remove (ChangeListener.class, listener);
+ }
+
+ /**
+ * Returns all currently added <code>ChangeListener</code> objects.
+ *
+ * @return Array of <code>ChangeListener</code> objects.
+ */
+ public ChangeListener[] getChangeListeners()
+ {
+ return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
+ }
+
+ /**
+ * Calls all the <code>stateChanged()</code> method of all added
+ * <code>ChangeListener</code> objects with <code>changeEvent</code>
+ * as argument.
+ */
+ protected void fireStateChanged()
+ {
+ ChangeListener[] listeners = getChangeListeners();
+
+ for (int i = 0; i < listeners.length; i++)
+ listeners [i].stateChanged (changeEvent);
+ }
+}
diff --git a/libjava/javax/swing/event/AncestorEvent.java b/libjava/javax/swing/event/AncestorEvent.java
index c6173932bb9..d62be28ba29 100644
--- a/libjava/javax/swing/event/AncestorEvent.java
+++ b/libjava/javax/swing/event/AncestorEvent.java
@@ -50,9 +50,9 @@ public class AncestorEvent extends AWTEvent
{
private static final long serialVersionUID = -8079801679695605002L;
- public static final int ANCESTOR_ADDED = 0;
- public static final int ANCESTOR_MOVED = 1;
+ public static final int ANCESTOR_ADDED = 1;
public static final int ANCESTOR_REMOVED = 2;
+ public static final int ANCESTOR_MOVED = 3;
private JComponent sourceComponent;
private Container ancestor;
diff --git a/libjava/javax/swing/event/InternalFrameEvent.java b/libjava/javax/swing/event/InternalFrameEvent.java
index 15d12f2efcf..863fd292f88 100644
--- a/libjava/javax/swing/event/InternalFrameEvent.java
+++ b/libjava/javax/swing/event/InternalFrameEvent.java
@@ -81,7 +81,7 @@ public class InternalFrameEvent extends AWTEvent
/**
* Internal frame iconified event
*/
- public static final int INTERNAL_FRAME_ICONIFIED = 2552;
+ public static final int INTERNAL_FRAME_ICONIFIED = 25552;
/**
* Internal frame last event
@@ -91,7 +91,7 @@ public class InternalFrameEvent extends AWTEvent
/**
* Internal frame opened event
*/
- public static final int INTERNAL_FRAME_OPENED = 25550;
+ public static final int INTERNAL_FRAME_OPENED = 25549;
/**
* Creates a <code>JInternalFrameEvent</code> object.
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
index 8b8a8513fc3..d59ab253322 100644
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ b/libjava/javax/swing/plaf/basic/BasicBorders.java
@@ -1300,7 +1300,7 @@ public class BasicBorders
* painted if the orientation of the enclosed JSplitPane is
* <code>JSplitPane.VERTICAL_SPLIT</code> (at least in versions
* 1.3.1 and 1.4.1). GNU Classpath does not replicate this bug. A
- * report has been filed with Sun (review ID 188773).
+ * report has been filed with Sun (bug ID 4885629).
*
* <p>Note that the bottom left pixel of the border has a different
* color depending on the orientation of the enclosed JSplitPane.
diff --git a/libjava/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
index 0adad4dafa5..51c694a7331 100644
--- a/libjava/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
@@ -38,22 +38,32 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import java.awt.*;
-
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.LabelUI;
public class BasicLabelUI extends LabelUI
+ implements PropertyChangeListener
{
int gap = 3;
-
Color foreground;
public static ComponentUI createUI(final JComponent c) {
return new BasicLabelUI();
}
-
+
public void installUI(final JComponent c) {
super.installUI(c);
@@ -182,20 +192,11 @@ public class BasicLabelUI extends LabelUI
g.drawLine(0,0,100,100);
- BasicGraphicsUtils.drawString(g,
- text,
- 0,
- 0,//textRect.x,
- 0);//textRect.y);
+ BasicGraphicsUtils.drawString(g, text, 0, 0 /*textRect.x*/, 0 /*textRect.y*/);
}
-}
-
-
-
-
-
-
-
-
-
+ public void propertyChange (PropertyChangeEvent event)
+ {
+ throw new Error ("Not implemented");
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
index c9e0c798e4e..ff73edbc871 100644
--- a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -64,7 +64,7 @@ import javax.swing.text.JTextComponent;
public abstract class BasicLookAndFeel extends LookAndFeel
implements Serializable
{
- static final long serialVersionUID = 5484702182266873258L;
+ static final long serialVersionUID = -6096995660290287879L;
/**
* Constructor BasicLookAndFeel
diff --git a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index a5c813d62f7..bbdcfb5500a 100644
--- a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -38,11 +38,18 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.*;
-import java.awt.*;
-import javax.swing.plaf.*;
-
-public class BasicTabbedPaneUI extends TabbedPaneUI
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import javax.swing.JComponent;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.TabbedPaneUI;
+
+public class BasicTabbedPaneUI extends TabbedPaneUI
+ implements SwingConstants
{
public static ComponentUI createUI(final JComponent c)
{
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
index 0930610a3a9..321889c5124 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextUI.java
@@ -38,12 +38,25 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
-import java.awt.*;
-import javax.swing.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.TextUI;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.EditorKit;
+import javax.swing.text.Element;
+import javax.swing.text.JTextComponent;
+import javax.swing.text.Position;
+import javax.swing.text.View;
+import javax.swing.text.ViewFactory;
public class BasicTextUI extends TextUI
+ implements ViewFactory
{
int gap = 3;
View view = null; // was: new RootView();
@@ -167,9 +180,10 @@ public class BasicTextUI extends TextUI
{
return 0;
}
-}
-
-
-
-
+ public View create (Element elem)
+ {
+ // subclasses have to implement this to get this functionality
+ return null;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
index 996fd4e4a3c..fccabd1d529 100644
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -36,14 +36,14 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package javax.swing.plaf.metal;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
+package javax.swing.plaf.metal;
+import javax.swing.UIDefaults;
+import javax.swing.plaf.basic.BasicDefaults;
+import javax.swing.plaf.basic.BasicLookAndFeel;
-public class MetalLookAndFeel extends LookAndFeel
+public class MetalLookAndFeel extends BasicLookAndFeel
{
public boolean isNativeLookAndFeel() { return true; }
public boolean isSupportedLookAndFeel() { return true; }
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 81ef0f7d36a..eace628acfc 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -491,7 +491,7 @@ static jclass
java::lang::ClassLoader *loader = NULL;
if (env->klass != NULL)
- loader = env->klass->getClassLoader ();
+ loader = env->klass->getClassLoaderInternal ();
if (loader == NULL)
{
@@ -1189,7 +1189,7 @@ static jfieldID
// FIXME: what if field_class == NULL?
- java::lang::ClassLoader *loader = clazz->getClassLoader ();
+ java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
while (clazz != NULL)
{
// We acquire the class lock so that fields aren't resolved
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index 6d3e06b0c4b..c1baa587784 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -609,25 +609,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O
(*env)->ReleaseStringUTFChars (env, jname, name);
}
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_create
- (JNIEnv *env, jobject obj, jstring jtypename)
-{
- const char *typename;
- gpointer widget;
-
- typename = (*env)->GetStringUTFChars (env, jtypename, NULL);
-
- gdk_threads_enter ();
- gtk_button_get_type ();
- widget = gtk_object_newv (gtk_type_from_name (typename),
- 0, NULL);
-/* widget = gtk_type_new (gtk_type_from_name (typename)); */
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, jtypename, typename);
- NSA_SET_PTR (env, obj, widget);
-}
-
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
(JNIEnv *env, jobject obj)
{
@@ -638,14 +619,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
gdk_threads_enter ();
gtk_widget_realize (GTK_WIDGET (ptr));
if(GTK_IS_BUTTON(ptr))
- {
- g_print("-- connecting a button --\n");
connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
- }
else
- {
connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
- g_print("Connection object %p with window %p (but ptr is %p)\n", obj, GTK_WIDGET(ptr)->window, ptr);
- }
gdk_threads_leave ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
index 2573a1823c3..3c400114e4b 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
@@ -90,10 +90,10 @@ keysym_to_awt_keycode (guint keyval)
vk = gdk_keyval_to_upper (keyval);
- if (vk <= 0x41 && vk <= 0x5A) /* VK_A through VK_Z */
+ if (vk >= 0x41 && vk <= 0x5A) /* VK_A through VK_Z */
return vk;
- if (vk <= 0x30 && vk <= 39) /* VK_0 through VK_9 */
+ if (vk >= 0x30 && vk <= 0x39) /* VK_0 through VK_9 */
return vk;
switch (vk)
@@ -232,6 +232,24 @@ keysym_to_awt_keycode (guint keyval)
}
}
+static int
+generates_key_typed_event (guint keyval)
+{
+ guint vk;
+
+ vk = gdk_keyval_to_upper (keyval);
+
+ if ((vk >= 0x20 && vk <= 0x7e) /* Most printable keysyms on a
+ standard US keyboard. */
+ || (vk >= 0xFF9F && vk <= 0xFFB9) /* Numeric Keypad keysyms. */
+ || vk == GDK_BackSpace
+ || vk == GDK_Delete
+ || vk == GDK_Return)
+ return 1;
+ else
+ return 0;
+}
+
void
awt_event_handler (GdkEvent *event)
{
@@ -275,6 +293,7 @@ awt_event_handler (GdkEvent *event)
|| event->type == GDK_CONFIGURE
|| event->type == GDK_EXPOSE
|| event->type == GDK_KEY_PRESS
+ || event->type == GDK_KEY_RELEASE
|| event->type == GDK_FOCUS_CHANGE
|| event->type == GDK_MOTION_NOTIFY)
&& gdk_property_get (event->any.window,
@@ -468,29 +487,70 @@ awt_event_handler (GdkEvent *event)
NULL,
NULL,
(guchar **)&obj_ptr);
-
+
/* if (grab && GTK_WIDGET_HAS_DEFAULT (widget) ) */
/* { */
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
postKeyEventID,
(jint) AWT_KEY_PRESSED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- keysym_to_awt_keycode (event->key.keyval),
+ state_to_awt_mods (event->key.state),
+ keysym_to_awt_keycode (event->key.keyval),
(jchar) (event->key.length) ?
event->key.string[0] :
AWT_KEY_CHAR_UNDEFINED);
- if (event->key.length)
+
+ if (event->key.length
+ && generates_key_typed_event(event->key.keyval))
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
postKeyEventID,
(jint) AWT_KEY_TYPED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
+ state_to_awt_mods (event->key.state),
VK_UNDEFINED,
(jchar) event->key.string[0]);
}
}
break;
+ case GDK_KEY_RELEASE:
+ {
+ GtkWidget *widget;
+ GtkWindow *window;
+
+ gdk_window_get_user_data (event->any.window, (void **) &widget);
+
+ window = GTK_WINDOW (gtk_widget_get_ancestor (widget,
+ GTK_TYPE_WINDOW));
+ if (window
+ && GTK_WIDGET_IS_SENSITIVE (window)
+ && window->focus_widget
+ && GTK_WIDGET_IS_SENSITIVE (window->focus_widget)
+ && window->focus_widget->window)
+ {
+ gtk_widget_activate (window->focus_widget);
+ gdk_property_get (window->focus_widget->window,
+ gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
+ gdk_atom_intern ("CARDINAL", FALSE),
+ 0,
+ sizeof (jobject),
+ FALSE,
+ NULL,
+ NULL,
+ NULL,
+ (guchar **)&obj_ptr);
+
+ (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_RELEASED,
+ (jlong) event->key.time,
+ state_to_awt_mods (event->key.state),
+ keysym_to_awt_keycode (event->key.keyval),
+ (jchar) (event->key.length) ?
+ event->key.string[0] :
+ AWT_KEY_CHAR_UNDEFINED);
+ }
+ }
+ break;
case GDK_FOCUS_CHANGE:
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
postFocusEventID,
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
index cd4d7e2fe7b..7c59f20a56e 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
@@ -54,6 +54,7 @@ jmethodID postFocusEventID;
jmethodID postAdjustmentEventID;
jmethodID postItemEventID;
jmethodID postListItemEventID;
+jmethodID postTextEventID;
JNIEnv *gdk_env;
#ifdef PORTABLE_NATIVE_SYNC
@@ -72,7 +73,8 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
char **argv;
char *homedir, *rcpath = NULL;
/* jclass gtkgenericpeer; */
- jclass gtkcomponentpeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer, gtkmenuitempeer;
+ jclass gtkcomponentpeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
+ gtkmenuitempeer, gtktextcomponentpeer;
NSA_INIT (env, clazz);
@@ -132,7 +134,10 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
gtkscrollbarpeer = (*env)->FindClass (env,
"gnu/java/awt/peer/gtk/GtkScrollbarPeer");
gtklistpeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkListPeer");
- gtkmenuitempeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkMenuItemPeer");
+ gtkmenuitempeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkMenuItemPeer");
+ gtktextcomponentpeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkTextComponentPeer");
/* gdkColor = (*env)->FindClass (env, */
/* "gnu/java/awt/peer/gtk/GdkColor"); */
/* gdkColorID = (*env)->GetMethodID (env, gdkColor, "<init>", "(III)V"); */
@@ -162,6 +167,9 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
postListItemEventID = (*env)->GetMethodID (env, gtklistpeer,
"postItemEvent",
"(II)V");
+ postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer,
+ "postTextEvent",
+ "()V");
}
/*
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
index a246b372904..2bd3df8cf35 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
@@ -46,6 +46,17 @@ struct range_scrollbar
};
static void
+post_change_event (GtkRange *range,
+ struct range_scrollbar *rs)
+{
+ GtkAdjustment *adj;
+ adj = gtk_range_get_adjustment (range);
+ (*gdk_env)->CallVoidMethod (gdk_env, *(rs->scrollbar), postAdjustmentEventID,
+ AWT_ADJUSTMENT_TRACK, (jint) adj->value);
+
+}
+
+static void
post_adjustment_event (GtkRange *range, GtkScrollType scroll,
struct range_scrollbar *rs)
{
@@ -56,15 +67,23 @@ post_adjustment_event (GtkRange *range, GtkScrollType scroll,
switch (scroll)
{
+ case GTK_SCROLL_STEP_UP:
+ case GTK_SCROLL_STEP_RIGHT:
case GTK_SCROLL_STEP_FORWARD:
type = AWT_ADJUSTMENT_UNIT_INCREMENT;
break;
+ case GTK_SCROLL_STEP_DOWN:
+ case GTK_SCROLL_STEP_LEFT:
case GTK_SCROLL_STEP_BACKWARD:
type = AWT_ADJUSTMENT_UNIT_DECREMENT;
break;
+ case GTK_SCROLL_PAGE_UP:
+ case GTK_SCROLL_PAGE_RIGHT:
case GTK_SCROLL_PAGE_FORWARD:
type = AWT_ADJUSTMENT_BLOCK_INCREMENT;
break;
+ case GTK_SCROLL_PAGE_DOWN:
+ case GTK_SCROLL_PAGE_LEFT:
case GTK_SCROLL_PAGE_BACKWARD:
type = AWT_ADJUSTMENT_BLOCK_DECREMENT;
break;
@@ -118,9 +137,14 @@ Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks
rs->scrollbar = (jobject *) malloc (sizeof (jobject));
*(rs->scrollbar) = (*env)->NewGlobalRef (env, obj);
gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)),
- "move_slider",
+ "move-slider",
GTK_SIGNAL_FUNC (post_adjustment_event), rs);
+ gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)),
+ "value-changed",
+ GTK_SIGNAL_FUNC (post_change_event), rs);
+
+
connect_awt_hook (env, obj, 1, GTK_SCROLLBAR (ptr)->range);
gdk_threads_leave ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
index 8cdff34f11b..de590352dd1 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
@@ -361,6 +361,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
const char *str;
GtkWidget *text = NULL; // type of GtkTextView (TextArea)
GtkTextBuffer *buf;
+ jobject *obj_ptr;
ptr = NSA_GET_PTR (env, obj);
str = (*env)->GetStringUTFChars (env, contents, NULL);
@@ -370,6 +371,18 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
if (GTK_IS_EDITABLE (ptr))
{
gtk_entry_set_text (GTK_ENTRY (ptr), str);
+
+ if (gdk_property_get (GTK_WIDGET(ptr)->window,
+ gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
+ gdk_atom_intern ("CARDINAL", FALSE),
+ 0,
+ sizeof (jobject),
+ FALSE,
+ NULL,
+ NULL,
+ NULL,
+ (guchar **)&obj_ptr))
+ (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postTextEventID);
}
else
{
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
index fa1f19b5a1d..1cfa6c472cd 100644
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ b/libjava/jni/gtk-peer/gtkpeer.h
@@ -266,6 +266,7 @@ extern jmethodID postFocusEventID;
extern jmethodID postAdjustmentEventID;
extern jmethodID postItemEventID;
extern jmethodID postListItemEventID;
+extern jmethodID postTextEventID;
extern jmethodID syncAttrsID;
extern jclass gdkColor;
extern jmethodID gdkColorID;
diff --git a/libjava/mauve-libgcj b/libjava/mauve-libgcj
index a2ccd5f9785..53187b8d03d 100644
--- a/libjava/mauve-libgcj
+++ b/libjava/mauve-libgcj
@@ -25,3 +25,6 @@ JDBC2.0
# The behaviour of the garbarge collector cannot be predicted.
# Note the . at the end so we do test java.lang.reflect
!java.lang.ref.
+
+# We don't have CollationElementIterator.setText.
+!java.text.CollationElementIterator.
diff --git a/libjava/posix.cc b/libjava/posix.cc
index de58ab025c0..73c0f5f4329 100644
--- a/libjava/posix.cc
+++ b/libjava/posix.cc
@@ -15,6 +15,7 @@ details. */
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
+#include <stdio.h>
#include <jvm.h>
#include <java/lang/Thread.h>
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 8d9cc6d97d7..9f8477334da 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -1,6 +1,6 @@
// prims.cc - Code for core of runtime environment.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -1137,3 +1137,21 @@ _Jv_remJ (jlong dividend, jlong divisor)
return dividend % divisor;
}
+
+
+
+// Return true if SELF_KLASS can access a field or method in
+// OTHER_KLASS. The field or method's access flags are specified in
+// FLAGS.
+jboolean
+_Jv_CheckAccess (jclass self_klass, jclass other_klass, jint flags)
+{
+ using namespace java::lang::reflect;
+ return ((self_klass == other_klass)
+ || ((flags & Modifier::PUBLIC) != 0)
+ || (((flags & Modifier::PROTECTED) != 0)
+ && other_klass->isAssignableFrom (self_klass))
+ || (((flags & Modifier::PRIVATE) == 0)
+ && _Jv_ClassNameSamePackage (self_klass->name,
+ other_klass->name)));
+}
diff --git a/libjava/resolve.cc b/libjava/resolve.cc
index 7cf0b0a3f8e..d79affea9eb 100644
--- a/libjava/resolve.cc
+++ b/libjava/resolve.cc
@@ -166,15 +166,7 @@ _Jv_ResolvePoolEntry (jclass klass, int index)
if (! _Jv_equalUtf8Consts (field->name, field_name))
continue;
- // now, check field access.
-
- if ( (cls == klass)
- || ((field->flags & Modifier::PUBLIC) != 0)
- || (((field->flags & Modifier::PROTECTED) != 0)
- && cls->isAssignableFrom (klass))
- || (((field->flags & Modifier::PRIVATE) == 0)
- && _Jv_ClassNameSamePackage (cls->name,
- klass->name)))
+ if (_Jv_CheckAccess (klass, cls, field->flags))
{
/* resove the field using the class' own loader
if necessary */
@@ -347,20 +339,10 @@ _Jv_SearchMethodInClass (jclass cls, jclass klass,
method_signature)))
continue;
- if (cls == klass
- || ((method->accflags & Modifier::PUBLIC) != 0)
- || (((method->accflags & Modifier::PROTECTED) != 0)
- && cls->isAssignableFrom (klass))
- || (((method->accflags & Modifier::PRIVATE) == 0)
- && _Jv_ClassNameSamePackage (cls->name,
- klass->name)))
- {
- return method;
- }
+ if (_Jv_CheckAccess (klass, cls, method->accflags))
+ return method;
else
- {
- throw new java::lang::IllegalAccessError;
- }
+ throw new java::lang::IllegalAccessError;
}
return 0;
}
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index ac9493bd357..8c37e22858e 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,27 @@
+2003-07-20 Tom Tromey <tromey@redhat.com>
+
+ * libjava.mauve/mauve.exp (mauve_find_harness_files): New proc.
+ (test_mauve): Use it.
+ (test_mauve_sim): Likewise.
+
+2003-07-19 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp (gcj_verify_list_tests): Only change
+ directory if new directory exists.
+
+2003-07-13 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp: Fixed variable init.
+
+2003-07-10 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp: New file.
+ * libjava.verify/README.verify: New file.
+
+2003-07-09 Jeff Sturm <jsturm@one-point.com>
+
+ * libjava.lang/SyncTest.java (run): Cache .class value.
+
2003-06-08 Roger Sayle <roger@eyesopen.com>
* libjava.lang/MathBuiltin.java: New test case.
diff --git a/libjava/testsuite/libjava.lang/SyncTest.java b/libjava/testsuite/libjava.lang/SyncTest.java
index 7cb6a56d397..85573f8a4b9 100644
--- a/libjava/testsuite/libjava.lang/SyncTest.java
+++ b/libjava/testsuite/libjava.lang/SyncTest.java
@@ -3,8 +3,11 @@ public class SyncTest implements Runnable {
static int counter;
public void run() {
+ // We cache the .class value; otherwise this code is
+ // slow enough that it will time out in some situations.
+ Object lock = SyncTest.class;
for (int n = 0; n < 1000000; n++)
- synchronized (SyncTest.class) {
+ synchronized (lock) {
counter++;
}
}
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index dcd8a57fd1a..4ef1a104fd2 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -74,6 +74,16 @@ proc find_mauve_sources {} {
return 0
}
+# Find all the harness files and return a list of them, with no
+# suffix.
+proc mauve_find_harness_files {} {
+ set result {}
+ foreach file [glob -nocomplain -- *.class gnu/testlet/*.class] {
+ lappend result [file root $file]
+ }
+ return $result
+}
+
# Run all the Mauve tests. Return 1 on success, 0 on any failure. If
# the tests are skipped, that is treated like success.
proc test_mauve {} {
@@ -159,7 +169,7 @@ proc test_mauve {} {
set ok 1
set objlist {}
- foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} {
+ foreach base [mauve_find_harness_files] {
set file $base.class
set obj $base.o
set x [libjava_prune_warnings \
@@ -298,9 +308,7 @@ proc test_mauve_sim {} {
set ok 1
set objlist {}
- foreach base {gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness \
- gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException \
- gnu/testlet/config} {
+ foreach base [mauve_find_harness_files] {
set file $base.class
set obj $base.o
set x [libjava_prune_warnings \