aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-23 22:04:18 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-23 22:04:18 +0000
commit9dd2f715952a4694a8617d341099d4936e7e4b8b (patch)
tree74ea7a4232cf2022b59354917d8272255397b664 /libjava
parentcaa2579055a1c25bb7be5846c562b5d1dc15f9fb (diff)
Mainline merge as of 2003-02-23.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@63336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog1019
-rw-r--r--libjava/Makefile.am62
-rw-r--r--libjava/Makefile.in141
-rwxr-xr-xlibjava/configure573
-rw-r--r--libjava/configure.host1
-rw-r--r--libjava/configure.in2
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java12
-rw-r--r--libjava/gnu/awt/xlib/XToolkit.java2
-rw-r--r--libjava/gnu/gcj/runtime/NameFinder.java2
-rw-r--r--libjava/gnu/gcj/runtime/natStackTrace.cc5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java24
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java7
-rw-r--r--libjava/gnu/java/nio/ByteBufferImpl.java388
-rw-r--r--libjava/gnu/java/nio/CharBufferImpl.java148
-rw-r--r--libjava/gnu/java/nio/DoubleBufferImpl.java120
-rw-r--r--libjava/gnu/java/nio/FileChannelImpl.java181
-rw-r--r--libjava/gnu/java/nio/FloatBufferImpl.java114
-rw-r--r--libjava/gnu/java/nio/IntBufferImpl.java118
-rw-r--r--libjava/gnu/java/nio/LongBufferImpl.java116
-rw-r--r--libjava/gnu/java/nio/SelectorProviderImpl.java6
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java10
-rw-r--r--libjava/gnu/java/nio/ShortBufferImpl.java126
-rw-r--r--libjava/gnu/java/nio/natByteBufferImpl.cc10
-rw-r--r--libjava/gnu/java/nio/natCharBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natDoubleBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natFloatBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natIntBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natLongBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natServerSocketChannelImpl.cc77
-rw-r--r--libjava/gnu/java/nio/natShortBufferImpl.cc112
-rw-r--r--libjava/gnu/java/nio/natSocketChannelImpl.cc82
-rw-r--r--libjava/gnu/java/security/provider/SHA1PRNG.java32
-rw-r--r--libjava/include/posix.h18
-rw-r--r--libjava/include/win32.h8
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java28
-rw-r--r--libjava/java/awt/Choice.java28
-rw-r--r--libjava/java/awt/Component.java21
-rw-r--r--libjava/java/awt/Container.java64
-rw-r--r--libjava/java/awt/ContainerOrderFocusTraversalPolicy.java15
-rw-r--r--libjava/java/awt/Dialog.java32
-rw-r--r--libjava/java/awt/FlowLayout.java6
-rw-r--r--libjava/java/awt/Font.java3
-rw-r--r--libjava/java/awt/Frame.java3
-rw-r--r--libjava/java/awt/Graphics.java3
-rw-r--r--libjava/java/awt/Graphics2D.java6
-rw-r--r--libjava/java/awt/GridBagConstraints.java46
-rw-r--r--libjava/java/awt/KeyboardFocusManager.java2
-rw-r--r--libjava/java/awt/Label.java5
-rw-r--r--libjava/java/awt/List.java37
-rw-r--r--libjava/java/awt/Menu.java12
-rw-r--r--libjava/java/awt/MenuComponent.java2
-rw-r--r--libjava/java/awt/PopupMenu.java2
-rw-r--r--libjava/java/awt/ScrollPane.java3
-rw-r--r--libjava/java/awt/ScrollPaneAdjustable.java42
-rw-r--r--libjava/java/awt/Scrollbar.java34
-rw-r--r--libjava/java/awt/TextArea.java8
-rw-r--r--libjava/java/awt/TextComponent.java24
-rw-r--r--libjava/java/awt/TextField.java36
-rw-r--r--libjava/java/awt/Toolkit.java29
-rw-r--r--libjava/java/awt/Window.java66
-rw-r--r--libjava/java/awt/color/ICC_ColorSpace.java19
-rw-r--r--libjava/java/awt/datatransfer/DataFlavor.java46
-rw-r--r--libjava/java/awt/dnd/DragSourceContext.java8
-rw-r--r--libjava/java/awt/dnd/DragSourceDragEvent.java13
-rw-r--r--libjava/java/awt/dnd/DragSourceDropEvent.java19
-rw-r--r--libjava/java/awt/dnd/DragSourceEvent.java8
-rw-r--r--libjava/java/awt/dnd/DropTarget.java53
-rw-r--r--libjava/java/awt/dnd/DropTargetContext.java21
-rw-r--r--libjava/java/awt/dnd/DropTargetDragEvent.java52
-rw-r--r--libjava/java/awt/dnd/DropTargetDropEvent.java90
-rw-r--r--libjava/java/awt/dnd/DropTargetListener.java2
-rw-r--r--libjava/java/awt/dnd/MouseDragGestureRecognizer.java13
-rw-r--r--libjava/java/awt/image/ColorModel.java2
-rw-r--r--libjava/java/awt/image/ImageFilter.java12
-rw-r--r--libjava/java/awt/print/Paper.java2
-rw-r--r--libjava/java/awt/print/PrinterJob.java6
-rw-r--r--libjava/java/io/BufferedOutputStream.java8
-rw-r--r--libjava/java/io/InputStreamReader.java7
-rw-r--r--libjava/java/io/OutputStreamWriter.java7
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc19
-rw-r--r--libjava/java/lang/Class.java4
-rw-r--r--libjava/java/lang/System.java12
-rw-r--r--libjava/java/lang/Thread.java564
-rw-r--r--libjava/java/lang/Win32Process.java52
-rw-r--r--libjava/java/lang/natObject.cc5
-rw-r--r--libjava/java/lang/natRuntime.cc3
-rw-r--r--libjava/java/lang/natSystem.cc5
-rw-r--r--libjava/java/lang/natWin32Process.cc294
-rw-r--r--libjava/java/math/BigDecimal.java6
-rw-r--r--libjava/java/math/BigInteger.java305
-rw-r--r--libjava/java/net/DatagramSocket.java44
-rw-r--r--libjava/java/net/NetPermission.java2
-rw-r--r--libjava/java/net/NetworkInterface.java5
-rw-r--r--libjava/java/net/ServerSocket.java2
-rw-r--r--libjava/java/net/Socket.java41
-rw-r--r--libjava/java/net/SocketImpl.java2
-rw-r--r--libjava/java/net/SocketPermission.java112
-rw-r--r--libjava/java/net/URLDecoder.java6
-rw-r--r--libjava/java/nio/Buffer.java32
-rw-r--r--libjava/java/nio/ByteBuffer.java545
-rw-r--r--libjava/java/nio/CharBuffer.java246
-rw-r--r--libjava/java/nio/DoubleBuffer.java78
-rw-r--r--libjava/java/nio/FloatBuffer.java80
-rw-r--r--libjava/java/nio/IntBuffer.java79
-rw-r--r--libjava/java/nio/LongBuffer.java79
-rw-r--r--libjava/java/nio/MappedByteBuffer.java23
-rw-r--r--libjava/java/nio/ShortBuffer.java79
-rw-r--r--libjava/java/nio/channels/DatagramChannel.java22
-rw-r--r--libjava/java/nio/channels/FileChannel.java243
-rw-r--r--libjava/java/nio/channels/Pipe.java3
-rw-r--r--libjava/java/nio/channels/SelectableChannel.java4
-rw-r--r--libjava/java/nio/channels/SelectionKey.java8
-rw-r--r--libjava/java/nio/channels/ServerSocketChannel.java2
-rw-r--r--libjava/java/nio/channels/SocketChannel.java17
-rw-r--r--libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java2
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelectableChannel.java8
-rw-r--r--libjava/java/nio/channels/spi/SelectorProvider.java20
-rw-r--r--libjava/java/nio/charset/Charset.java5
-rw-r--r--libjava/java/nio/charset/CharsetEncoder.java5
-rw-r--r--libjava/java/nio/charset/IllegalCharsetNameException.java13
-rw-r--r--libjava/java/nio/charset/UnsupportedCharsetException.java13
-rw-r--r--libjava/java/security/SecureRandom.java8
-rw-r--r--libjava/java/sql/Timestamp.java34
-rw-r--r--libjava/java/util/Properties.java74
-rw-r--r--libjava/java/util/natTimeZone.cc5
-rw-r--r--libjava/java/util/zip/InflaterInputStream.java4
-rw-r--r--libjava/java/util/zip/ZipEntry.java10
-rw-r--r--libjava/java/util/zip/ZipFile.java9
-rw-r--r--libjava/java/util/zip/ZipInputStream.java4
-rw-r--r--libjava/javax/accessibility/AccessibleContext.java2
-rw-r--r--libjava/javax/sql/ConnectionEvent.java13
-rw-r--r--libjava/jni.cc87
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c36
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c3
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c45
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c33
-rw-r--r--libjava/libgcj.spec.in2
-rw-r--r--libjava/testsuite/ChangeLog32
-rw-r--r--libjava/testsuite/lib/libjava.exp4
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp13
-rw-r--r--libjava/testsuite/libjava.mauve/xfails17
-rw-r--r--libjava/verify.cc65
-rw-r--r--libjava/win32.cc4
147 files changed, 6145 insertions, 2497 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 37240097bd1..c35bdf2bdb0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,1022 @@
+2002-02-21 Anthony Green <green@redhat.com>
+
+ * java/lang/Thread.java (Thread): New constructor taking stack
+ size parameter (ignored for now).
+ * Many methods: Merged GNU Classpath documentation.
+
+ * java/lang/Class.java (finalize): throws a Throwable.
+
+2003-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/zip/ZipEntry.java (setComment): Don't check length when
+ argument is null.
+
+2003-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
+ then 65535 chars throw IllegalArgumentException.
+
+2003-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/zip/ZipFile.java (finalize): New method.
+
+2003-02-21 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natSocketChannelImpl.cc:
+ Reverse logic for DISABLE_JAVA_NET. Thanks to Krister Walfridsson
+ <cato@df.lth.se> for pointing to it.
+
+2003-02-20 Raif S. Naffah <raif@fl.net.au>
+
+ * java/math/BigInteger.java (euclidInv): Take result array as an
+ argument. Updated all callers.
+ (modInverse): Removed unused variables.
+
+2003-02-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to
+ config.status.
+ * configure: Rebuilt.
+
+2003-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natSocketChannelImpl.cc:
+ Added support for platforms without network support.
+
+2003-02-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately
+ after config.h. Use <> for consistency.
+ * java/lang/natObject.cc: Likewise.
+ * java/lang/natRuntime.cc: Likewise.
+ * java/lang/natSystem.cc: Likewise.
+ * java/util/natTimeZone.cc: Likewise.
+ * win32.cc: Likewise.
+ * include/posix.h (fcntl, socket, connect, close, bind, accept,
+ listen, write, read): Undef to avoid interference from OS macros.
+
+2003-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/ByteBufferImpl.java
+ (ByteBufferImpl): Renamed two variables.
+ * gnu/java/nio/CharBufferImpl.java
+ (CharBufferImpl): Renamed two variables.
+ * gnu/java/nio/DoubleBufferImpl.java
+ (DoubleBufferImpl): Renamed two variables.
+ * gnu/java/nio/FloatBufferImpl.java
+ (FloatBufferImpl): Renamed two variables.
+ * gnu/java/nio/IntBufferImpl.java
+ (IntBufferImpl): Renamed two variables.
+ * gnu/java/nio/LongBufferImpl.java
+ (LongBufferImpl): Renamed two variables.
+ * gnu/java/nio/ShortBufferImpl.java
+ (ShortBufferImpl): Renamed two variables.
+ * java/nio/CharBuffer.java
+ (wrap): Fixed arguments to CharBufferImpl constructor.
+ (hasArray): Only not read-only buffers have backing arrays.
+ (length): Documentation added.
+ (subSequence): Documentation added.
+ * java/nio/DoubleBuffer.java
+ (hasArray): Only not read-only buffers have backing arrays.
+ * java/nio/FloatBuffer.java
+ (hasArray): Only not read-only buffers have backing arrays.
+ * java/nio/IntBuffer.java
+ (hasArray): Only not read-only buffers have backing arrays.
+ * java/nio/LongBuffer.java
+ (hasArray): Only not read-only buffers have backing arrays.
+ * java/nio/ShortBuffer.java
+ (hasArray): Only not read-only buffers have backing arrays.
+
+2003-02-19 Michael Koch <konqueror@gmx.de>
+
+ * javax/accessibility/AccessibleContext.java
+ (ACCESSIBLE_DESCRIPTION_PROPERTY): Fixed typo.
+
+2003-02-19 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/ScrollPaneAdjustable.java: Reformated.
+
+2003-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/awt/j2d/Graphics2DImpl.java
+ (getFontRenderContext): New method.
+ (drawGlyphVector): New method.
+ * java/awt/Graphics2D.java
+ (getFontRenderContext): New abstract method.
+ (drawGlyphVector): New abstract method.
+
+2003-02-18 Hans Boehm <Hans.Boehm@hp.com>
+
+ * gnu/awt/xlib/XToolkit.java (getFontMetrics): initialize
+ if necessary.
+
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java,
+ gnu/java/awt/peer/gtk/GtkTextAreaPeer.java,
+ gnu/java/awt/peer/gtk/GtkTextFieldPeer.java,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+ (setFont, gtkSetFont): add.
+ gnu/java/awt/peer/gtk/GtkComponentPeer.java (GtkComponentPeer):
+ Propagate font to peer. (setFont): add FIXME comment.
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+ (gtkTextGetSize): fix height, width computation.
+
+ * gnu/java/awt/peer/gtk/GtkFontPeer.java (GtkFontPeer):
+ Make X font name a bit less bogus.
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+ (post_adjustment_event): Pass on GTK_SCROLL_NONE.
+
+ * java/awt/Scrollbar.java (setValues): Fix visibleAmount range check.
+ (processAdjustmentEvent): Adjust value.
+
+ * java/awt/FlowLayout.java (layoutContainer) Fix 2 indexing and one
+ logic errors.
+
+ * java/awt/Component.java (setVisible, show, hide): Call show and
+ hide methods in subclasses.
+ (getPreferredSize): don't set prefSize before we have peer.
+
+ * java/awt/TextArea.java, java/awt/TextField.java (getPreferredSize):
+ Guess (0,0) if we don't have peer.
+
+
+2003-02-18 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/FileChannel.java
+ (toString): New implementation, added documentation.
+ (map): Added exception documentation.
+ (size): Added exception documentation.
+ (write): New methods, documentation work.
+ (read): New methods, documentation work.
+ (implCloseChannel): Rewrote exception documentation.
+ (force): Throws IOException, added documentation.
+ (lock): New methods.
+ (tryLock): New methods.
+ (position): New methods.
+ (transferTo): New method.
+ (transferFrom): New method.
+ (truncate): New method.
+ * java/nio/channels/spi/SelectorProvider.java
+ (provider): Implemented.
+ * Makefile.am
+ (ordinary_java_source_files): Added the following files:
+ gnu/java/nio/DatagramChannelImpl.java
+ gnu/java/nio/FileChannelImpl.java
+ gnu/java/nio/PipeImpl.java
+ gnu/java/nio/SelectionKeyImpl.java
+ gnu/java/nio/SelectorImpl.java
+ gnu/java/nio/SelectorProviderImpl.java
+ gnu/java/nio/ServerSocketChannelImpl.java
+ gnu/java/nio/SocketChannelImpl.java
+ java/nio/channels/FileLock.java
+ (nat_java_source_files): Added the following files:
+ gnu/java/nio/natFileChannelImpl.cc
+ gnu/java/nio/natSelectorImpl.cc
+ gnu/java/nio/natSocketChannelImpl.cc
+ * Makefile.in: Regenerated.
+
+2003-02-17 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/image/ColorModel.java: Re-merged with Classpath.
+ * java/awt/image/ImageFilter.java: Likewise.
+
+2003-02-17 Raif S. Naffah <raif@fl.net.au>
+
+ * java/math/BigInteger.java (euclidInv): Return array of
+ `BigInteger's. Changed all callers.
+
+2003-02-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/util/Properties.java (store): Move the code formerly in
+ list(), into this method.
+ (list (PrintStream)): Just call list (PrintWriter) with a
+ PrintWriter object constructed from the given PrintStream object.
+ (list (PrintWriter)): Emulate the output of Properties.list()
+ as found in JDK 1.3/1.4.
+
+2003-02-17 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (connect): Merged with classpath.
+ (disconnect): Merged documentation with classpath.
+ (receice): Merged documentation with classpath.
+ (send): Merged documentation with classpath.
+
+2003-02-17 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/dnd/DragSourceContext.java
+ (addDragSourceListener): Added documentation.
+ * java/awt/dnd/DragSourceDragEvent.java
+ (serialVersionUID): New member variable.
+ (getDropAction): Reformated.
+ * java/awt/dnd/DragSourceDropEvent.java
+ (serialVersionUID): New member variable.
+ (dropSuccess): Renamed from success for serialization issues.
+ * java/awt/dnd/DragSourceEvent.java
+ (serialVersionUID): New member variable.
+ * java/awt/dnd/DropTarget.java
+ (serialVersionUID): New member variable.
+ (DropTarget): Implemented, documentation reworked.
+ (setComponent): Documentation added.
+ (getComponent): Documentation added.
+ (setDefaultActions): Documentation added.
+ (getDefaultActions): Documentation added.
+ (addDropTargetListener): Documentation added.
+ * java/awt/dnd/DropTargetContext.java
+ (DropTargetContext): Documentation added.
+ (TransferableProxy.TransferableProxy): New method.
+ (dropComplete): Fixed documentation.
+ (getTransferable): Fixed documentation.
+ (createTransferableProxy): Implemented.
+ * java/awt/dnd/DropTargetDragEvent.java
+ (DropTargetDragEvent): Documentation added.
+ (serialVersionUID): New member variable.
+ (DropTargetDragEvent): Throw exceptions, documentation added.
+ (acceptDrag): Implemented.
+ (getCurrentDataFlavors): Implemented.3yy
+ (getCurrentDataFlavorsAsList): Implemented.
+ (isDataFlavorSupported): Implemented.
+ (rejectDrag): Implemented.
+ * java/awt/dnd/DropTargetDropEvent.java
+ (DropTargetDropEvent): Documentation added.
+ (serialVersionUID): New member variable.
+ (actions): Renamed from srcActions for serialization issues.
+ (isLocalTx): Renamed from isLocalTx for serialization issues.
+ (DropTargetDropEvent): New implementation, throw exceptions,
+ documentation added.
+ (getCurrentDataFlavors): Implemented.
+ (getCurrentDataFlavorsAsList): Implemented.
+ (isDataFlavorSupported): Implemented.
+ (getSourceActions): Implemented.
+ (getDropAction): Implemented.
+ (getTransferable): Implemented.
+ (acceptDrop): Implemented.
+ (rejectDrop): Implemented.
+ * java/awt/dnd/DropTargetListener.java
+ (drop): Fixed documentation.
+ * java/awt/dnd/MouseDragGestureRecognizer.java
+ (MouseDragGestureRecognizer): Documentation added.
+
+2003-02-17 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/font/FontRenderContext.java,
+ java/awt/font/ShapeGraphicAttribute.java,
+ java/awt/font/MultipleMaster.java,
+ java/awt/font/TransformAttribute.java,
+ java/awt/font/GlyphJustificationInfo.java,
+ java/awt/font/LineBreakMeasurer.java,
+ java/awt/font/TextMeasurer.java,
+ java/awt/font/TextLayout.java,
+ java/awt/font/LineMetrics.java,
+ java/awt/font/TextAttribute.java,
+ java/awt/font/GlyphMetrics.java,
+ java/awt/font/OpenType.java,
+ java/awt/font/GlyphVector.java,
+ java/awt/font/GraphicAttribute.java,
+ java/awt/font/ImageGraphicAttribute.java,
+ java/awt/font/NumericShaper.java: New files.
+ * Makefile.am
+ (awt_java_source_files): Added the following files:
+ java/awt/font/FontRenderContext.java
+ java/awt/font/ShapeGraphicAttribute.java
+ java/awt/font/MultipleMaster.java
+ java/awt/font/TransformAttribute.java
+ java/awt/font/GlyphJustificationInfo.java
+ java/awt/font/LineBreakMeasurer.java
+ java/awt/font/TextMeasurer.java
+ java/awt/font/TextLayout.java
+ java/awt/font/LineMetrics.java
+ java/awt/font/TextAttribute.java
+ java/awt/font/GlyphMetrics.java
+ java/awt/font/OpenType.java
+ java/awt/font/GlyphVector.java
+ java/awt/font/GraphicAttribute.java
+ java/awt/font/ImageGraphicAttribute.java
+ java/awt/font/NumericShaper.java
+ * Makefile.in: Regenerated.
+
+2003-02-17 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/print/Paper.java
+ (Paper): Implements Cloneable.
+ * java/awt/print/PrinterJob.java
+ (setJobName): Return value must be void.
+ (print): Throws PrinterException.
+
+2003-02-16 Tom Tromey <tromey@redhat.com>
+
+ * verify.cc (_Jv_BytecodeVerifier::pop_jump): Removed unused
+ variable.
+
+2003-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/datatransfer/DataFlavor.java
+ (isRepresentationClassByteBuffer): Removed try-catch block.
+ (isRepresentationClassCharBuffer): Removed try-catch block.
+ (isRepresentationClassReader): Removed try-catch block.
+
+2003-02-15 Jesse Rosenstock <jmr@ugcs.caltech.edu>
+
+ * java/nio/charset/Charset.java
+ (isRegistered): Fixed method args and implementation.
+ * java/nio/charset/CharsetEncoder.java
+ (unmappableCharacterAction): New method.
+
+2003-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/CheckboxMenuItem.java
+ (CheckBoxMenuItem): Dont implement Serializable.
+ (getListeners): New method,
+ (getItemListeners): New method.
+ * java/awt/Choice.java
+ (getListeners): New method,
+ (getItemListeners): New method.
+ * java/awt/Container.java
+ (getListeners): Added exception documentation.
+ (setFocusTraversalKeys): Throw exceptions, added documentattion.
+ (getFocusTraversalKeys): Added documentation.
+ (areFocusTraversalKeysSet): Added documentation.
+ (applyComponentOrientation): Added documentation.
+ * java/awt/ContainerOrderFocusTraversalPolicy.java
+ (implicitDownCycleTraversal): Renamed from downCycle for
+ serialization.
+ (ContainerOrderFocusTraversalPolicy): Added documentation.
+ (accept): Reformated.
+ * java/awt/Dialog.java
+ (Dialog): Dont implement Serializable.
+ (Dialog): Added documentation.
+ * java/awt/Font.java
+ (Font): Dont use absolute class name.
+ * java/awt/Frame.java
+ (Frame): Font implement Serializable.
+ * java/awt/List.java
+ (getListeners): New method,
+ (getActionListeners): New method.
+ (getItemListeners): New method.
+ * java/awt/Menu.java
+ (countItems): New deprecated method.
+ * java/awt/Scrollbar.java
+ (getListeners): New method,
+ (getAdjustmentListeners): New method,
+ * java/awt/TextComponent.java
+ (getListeners): New method,
+ (getTextListeners): New method,
+ * java/awt/TextField.java
+ (getListeners): New method,
+ (getActionListeners): New method.
+ * java/awt/Window.java
+ (windowFocusListener): New member variable.
+ (windowStateListener): New member variable.
+ (getWindowFocusListeners): New method.
+ (getWindowStateListeners): New method.
+ (addWindowFocusListener): New method.
+ (addWindowStateListener): New method.
+ (removeWindowFocusListener): New method.
+ (removeWindowStateListener): New method.
+ * java/awt/datatransfer/DataFlavor.java
+ (isRepresentationClassByteBuffer): New method.
+ (isRepresentationClassCharBuffer): New method.
+ (isRepresentationClassReader): New method.
+
+2003-02-14 Mark Wielaard <mark@klomp.org>
+
+ * java/math/BigDecimal.java (BigDecimal(String)): Always set scale to
+ zero when there is an exponent and the significant is zero.
+ (divide): Always set scale to newScale even in special ZERO case.
+
+2003-02-14 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/System.java (properties): Use Properties.clone.
+ (setProperties): Likewise.
+
+2003-02-14 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natServerSocketChannelImpl.cc: Removed.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (SocketAccept): Removed.
+ (accept): Commented out use of SocketAccept.
+
+2003-02-13 Tom Tromey <tromey@redhat.com>
+
+ * verify.cc (state::seen_subrs): New field.
+ (state::state): Initialize it.
+ (state::clean_subrs): New method.
+ (state::~state): Call it.
+ (state::copy): Copy subroutine list.
+ (state::add_subr): New method.
+ (state::merge): Only register a change if the current subroutine
+ hasn't yet been noted.
+
+2003-02-13 Mark Wielaard <mark@klomp.org>
+
+ * java/io/InputStreamReader.java (getEncoding): Return null when
+ closed.
+ * java/io/OutputStreamWriter.java (getEncoding): Likewise.
+
+2003-02-13 Mark Wielaard <mark@klomp.org>
+
+ * java/util/zip/InflaterInputStream.java (read): Return zero when len
+ is zero.
+
+2003-02-13 Mark Wielaard <mark@klomp.org>
+
+ * java/io/BufferedOutputStream.java (write(int)): Only flush when
+ next byte cannot be buffered.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Label.java
+ (Label): Don't implement Serializable directly.
+ (addNotify): Fixed typo in documentation.
+ * java/awt/List.java
+ (List): Don't implement Serializable directly.
+ * java/awt/PopupMenu.java
+ (PopupMenu): Don't implement Serializable directly.
+ * java/awt/ScrollPane.java
+ (ScrollPane): Don't implement Serializable directly.
+ * java/awt/Scrollbar.java
+ (Scrollbar): Don't implement Serializable directly.
+ * java/awt/TextArea.java
+ (preferredSize): Fixed method arguments.
+ * java/awt/TextField.java
+ (TextField): Don't implement Serializable directly.
+ * java/awt/color/ICC_ColorSpace.java
+ (fromCIOXYZ): Documentation added.
+ (getMinValue): Documentation added.
+ (getMaxValue): Documentation added.
+ * java/awt/datatransfer/DataFlavor.java
+ (isMimeTypeEqual): May not be final.
+ (clone): Throws CloneNotSupportedException.
+ (getReaderForText): Don't throws UnsupportedEncodingException.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics.java
+ (drawString): New stubbed method.
+ * java/awt/Graphics.java
+ (drawString): New method.
+
+2003-02-13 Casey Marshall <rsdio@metastatic.org>
+
+ PR libgcj/9271:
+ * java/security/SecureRandom.java (next): Avoid bias in results.
+
+2003-02-13 Michael <konqueror@gmx.de>
+
+ * gnu/java/nio/FileChannelImpl.java
+ (lengthInternal): Must be native.
+ (size): Check if channel is already closed.
+ (implCloseChannel): Reformated.
+ (read): w was unused, removed it.
+ (read): Removed.
+ (read): New method.
+ (write): New method.
+ (map): Check arguments.
+ (force): Throws IOException, check if channel is closed.
+ (transferTo): New method.
+ (transferFrom): New method.
+ (lock): New method.
+ (tryLock): New method.
+ (position): New method.
+ (truncate): New method.
+ (nio_mmap_file): Uncommented.
+ (nio_munmap_file): Uncommented.
+ (nio_msync): Uncommented.
+ * gnu/java/nio/natFileChannelImpl.cc: New file.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBuffer.java
+ (endian): New member variable.
+ (get): New methods.
+ (equals): New method.
+ (compareTo): New method.
+ (order): New methods.
+ (compact): New method.
+ (isDirect): New method.
+ (slice): New method.
+ (duplicate): New method.
+ (asReadOnlyBuffer): New method.
+ (asCharBuffer): New method.
+ (asDoubleBuffer): New method.
+ (asFloatBuffer): New method.
+ (asIntBuffer): New method.
+ (asLongBuffer): New method.
+ (asShortBuffer): New method.
+ (get*): New methods.
+ (put*): New methods.
+ (toString): New method.
+ * java/nio/CharBuffer.java
+ (CharBuffer): Implement Comparable instead of Cloneable.
+ (get): May not be final.
+ (put): May not be final.
+
+2002-02-13 Ranjit Mathew <rmathew@hotmail.com>
+
+ * gnu/gcj/runtime/NameFinder.java (createStackTraceElement): Use
+ lastIndexOf( ) instead of indexOf( ) to find the colon before
+ the line number, because Win32 file names might contain a
+ drive letter and a colon at the start of an absolute path.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natSocketChannelImpl.cc
+ (SocketConnect): This is not implemented yet.
+ (SocketBind): This is not implemented yet.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natByteBufferImpl.cc,
+ gnu/java/nio/natCharBufferImpl.cc,
+ gnu/java/nio/natDoubleBufferImpl.cc,
+ gnu/java/nio/natFloatBufferImpl.cc,
+ gnu/java/nio/natIntBufferImpl.cc,
+ gnu/java/nio/natLongBufferImpl.cc,
+ gnu/java/nio/natShortBufferImpl.cc:
+ Added copyright and license.
+ * java/nio/DoubleBuffer.java,
+ java/nio/FloatBuffer.java,
+ java/nio/IntBuffer.java,
+ java/nio/LongBuffer.java,
+ java/nio/ShortBuffer.java
+ (array): Throw exceptions.
+ (arrayOffset): Throw exceptions.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/util/prefs/FileBasedFactory.java,
+ gnu/java/util/prefs/MemmoryBasedFactory.java,
+ gnu/java/util/prefs/MemoryBasedPreferences.java,
+ gnu/java/util/prefs/NodeReader.java,
+ gnu/java/util/prefs/NodeWriter.java,
+ java/util/prefs/AbstractPreferences.java,
+ java/util/prefs/BackingStoreException.java,
+ java/util/prefs/InvalidPreferencesFormatException.java,
+ java/util/prefs/NodeChangeEvent.java,
+ java/util/prefs/NodeChangeListener.java,
+ java/util/prefs/PreferenceChangeEvent.java,
+ java/util/prefs/PreferenceChangeListener.java,
+ java/util/prefs/Preferences.java,
+ java/util/prefs/PreferencesFactory.java:
+ New files, all merged from classpath.
+ * Makefile.am
+ (ordinary_java_source_files): Added the following files:
+ gnu/java/util/prefs/FileBasedFactory.java,
+ gnu/java/util/prefs/MemmoryBasedFactory.java,
+ gnu/java/util/prefs/MemoryBasedPreferences.java,
+ gnu/java/util/prefs/NodeReader.java,
+ gnu/java/util/prefs/NodeWriter.java,
+ (core_java_source_files): Added the following files:
+ java/util/prefs/AbstractPreferences.java,
+ java/util/prefs/BackingStoreException.java,
+ java/util/prefs/InvalidPreferencesFormatException.java,
+ java/util/prefs/NodeChangeEvent.java,
+ java/util/prefs/NodeChangeListener.java,
+ java/util/prefs/PreferenceChangeEvent.java,
+ java/util/prefs/PreferenceChangeListener.java,
+ java/util/prefs/Preferences.java,
+ java/util/prefs/PreferencesFactory.java
+ * Makefile.in: Regenerated.
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * java/net/NetPermission.java
+ (NetPermission): Make doucmentation match the method declaration.
+ * java/net/NetworkInterface.java
+ (equals): Reformated for GNU coding style.
+ * java/net/ServerSocket.java: Merged with classpath.
+ * java/net/Socket.java: Partly merged with classpath (Added some @since).
+ * java/net/SocketImpl.java
+ (localPort): Merged with classpath (initialize with -1).
+ * java/net/SocketPermission.java: Merged with classpath (reindented).
+ * java/net/URLDecoder.java: Merged with classpath (reindented).
+
+2003-02-13 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/GridBagConstraints.java
+ (FIRST_LINE_ENT, FIRST_LINE_START, LAST_LINE_END, LAST_LINE_START,
+ LINE_END, LINE_START, PAGE_END, PAGE_START): New constants.
+ * java/awt/KeyboardFocusManager.java
+ (setGlobalCurrentFocusCycleRoot): Must be public.
+ * java/awt/MenuComponent.java
+ (MenuComponent): Must be public.
+ * java/awt/Toolkit.java:
+ Added some empty lines to make documentation more readable.
+ (getFontPeer): Added @deprecated.
+ (getColorModel): Added exception documentation.
+ (getProperty): Fixed documentation.
+
+2003-02-12 Jeff Sturm <jsturm@one-point.com>
+
+ * configure.host (alpha*-*): Default to -mieee.
+ * configure.in (IEEESPEC): New.
+ * libgcj.spec.in (jc1): Add IEEESPEC.
+ * configure: Rebuild.
+
+2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
+
+ * include/win32.h: Include ws2tcpip.h instead of
+ winsock.h to obtain definition of the socklen_t type.
+ Remove IP_TOS definition - not needed with ws2tcpip.h
+ (_Jv_connect): Correct slight formatting error.
+
+2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
+
+ * jni.cc (_Jv_LookupJNIMethod): Modify to accept the
+ size of the arguments for a JNI function. For Win32,
+ modify to search for all forms of possible exported
+ names of an stdcall JNI function.
+ (_Jv_JNIMethod::call): Modify to calculate the size
+ of the arguments passed to a JNI function and pass
+ it to _Jv_LookupJNIMethod.
+
+2003-02-12 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/Channels.java: New file.
+ * Makefile.am
+ (ordinary_java_source_files): Added java/nio/channels/Channels.java.
+ * Makefile.in: Regenerated.
+
+2003-02-12 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBuffer.java
+ (allocate): Implemented.
+ (wrap): Implemented.
+ * java/nio/CharBuffer.java:
+ Some documentation added and reworked.
+ (endian): Removed.
+ (allocate): Implemented.
+ (wrap): Implemented.
+ (array): Throw exceptions.
+ (arrayOffset): Throw exceptions.
+ (toString): Implemented.
+ (length): Implemented.
+ (put): Implemented.
+ (charAt): Implemented.
+
+2003-02-11 John Leuner <jewel@debian.org>
+
+ * java/util/zip/ZipInputStream.java: Fix problem with 0-length
+ reads from end of file.
+
+2003-02-11 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/io/natFileDescriptorWin32.cc
+ (java::io::FileDescriptor::read): Return -1 (EOF) if ReadFile( )
+ returns with Win32 error code ERROR_BROKEN_PIPE.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.in
+ (libgcj_la_OBJECTS): Removed natSelctorImpl.la.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/ByteBufferImpl.java:
+ Reformated and removed some code.
+ (backing_buffer): Removed.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (ByteBufferImpl): Use parent constructor, initialize readOnly.
+ * gnu/java/nio/CharBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (CharBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * gnu/java/nio/DoubleBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (DoubleBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * gnu/java/nio/FloatBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (FloatBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * gnu/java/nio/IntBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (IntBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * gnu/java/nio/LongBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (LongBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * gnu/java/nio/ShortBufferImpl.java:
+ Reformated and removed some code.
+ (array_offset): Removed.
+ (ro): Renamed to readOnly.
+ (ShortBufferImpl): Use parent constructor, initialize readOnly.
+ (inc_pos): Removed.
+ (order): New method.
+ * Makefile.am
+ (ordinary_java_source_files): Added the following files:
+ gnu/java/nio/ByteBufferImpl.java
+ gnu/java/nio/CharBufferImpl.java
+ gnu/java/nio/DoubleBufferImpl.java
+ gnu/java/nio/FloatBufferImpl.java
+ gnu/java/nio/IntBufferImpl.java
+ gnu/java/nio/LongBufferImpl.java
+ gnu/java/nio/ShortBufferImpl.java
+ java/nio/DoubleBuffer.java
+ java/nio/FloatBuffer.java
+ java/nio/IntBuffer.java
+ java/nio/LongBuffer.java
+ java/nio/ShortBuffer.java
+ (nat_source_files): Added the following files:
+ gnu/java/nio/natByteBufferImpl.cc
+ gnu/java/nio/natCharBufferImpl.cc
+ gnu/java/nio/natDoubleBufferImpl.cc
+ gnu/java/nio/natFloatBufferImpl.cc
+ gnu/java/nio/natIntBufferImpl.cc
+ gnu/java/nio/natLongBufferImpl.cc
+ gnu/java/nio/natShortBufferImpl.cc
+ * Makefile.in: Regenerated.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natCharBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/natDoubleBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/natFloatBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/natIntBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/natLongBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/natShortBufferImpl.cc
+ (nio_cast): Removed.
+ (nio_put_*): Removed.
+ (nio_get_*): Removed.
+ * gnu/java/nio/SelectorProviderImpl.java
+ (openDatagramChannel): Throws IOException.
+ (openPipe): Throws IOException.
+ (openSelector): Throws IOException.
+ (openServerSocketChannel): Throws IOException.
+ (openSocketChannel): Throws IOException.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (ServerSocketChannelImpl): Throws IOException.
+ (implCloseSelectableChannel): Throws IOException.
+ (implConfigureBlocking): Throws IOException.
+ * java/nio/ByteBuffer.java
+ (readOnly): Removed.
+ (hasArray): Use isReadOnly() instead of readOnly.
+ (array): Use isReadOnly() instead of readOnly.
+ (arrayOffset): Use isReadOnly() instead of readOnly.
+ * java/nio/CharBuffer.java
+ (CharBuffer): Implements Cloneable and CharSequence.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/DoubleBuffer.java
+ (DoubleBuffer): Implements Comparable.
+ (endian): Removed.
+ (array_offset): New member variable.
+ (DoubleBuffer): New constuctor.
+ (get): May not be final.
+ (put): May not be final.
+ (arrayOffset): Implemented.
+ (order): Made abstract.
+ (order): Removed.
+ (as*Buffer): Removed.
+ (get*): Removed.
+ (put*): Removed.
+ * java/nio/FloatBuffer.java
+ (FloatBuffer): Implements Comparable.
+ (endian): Removed.
+ (array_offset): New member variable.
+ (FloatBuffer): New constuctor.
+ (get): May not be final.
+ (put): May not be final.
+ (arrayOffset): Implemented.
+ (order): Made abstract.
+ (order): Removed.
+ (as*Buffer): Removed.
+ (get*): Removed.
+ (put*): Removed.
+ * java/nio/IntBuffer.java
+ (IntBuffer): Implements Comparable.
+ (endian): Removed.
+ (array_offset): New member variable.
+ (IntBuffer): New constuctor.
+ (get): May not be final.
+ (put): May not be final.
+ (arrayOffset): Implemented.
+ (order): Made abstract.
+ (order): Removed.
+ (as*Buffer): Removed.
+ (get*): Removed.
+ (put*): Removed.
+ * java/nio/LongBuffer.java
+ (LongBuffer): Implements Comparable.
+ (endian): Removed.
+ (array_offset): New member variable.
+ (LongBuffer): New constuctor.
+ (get): May not be final.
+ (put): May not be final.
+ (arrayOffset): Implemented.
+ (order): Made abstract.
+ (order): Removed.
+ (as*Buffer): Removed.
+ (get*): Removed.
+ (put*): Removed.
+ * java/nio/ShortBuffer.java
+ (ShortBuffer): Implements Comparable.
+ (endian): Removed.
+ (array_offset): New member variable.
+ (ShortBuffer): New constuctor.
+ (get): May not be final.
+ (put): May not be final.
+ (arrayOffset): Implemented.
+ (order): Made abstract.
+ (order): Removed.
+ (as*Buffer): Removed.
+ (get*): Removed.
+ (put*): Removed.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/SelectionKey.java
+ (OP_ACCEPT, OP_CONNECT, OP_READ, OP_WRITE): Initialize with correct
+ values.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/DatagramChannel.java
+ (write): Throws IOException.
+ (connect): Throws IOException.
+ (disconnect): Throws IOException.
+ (read): Throws IOException.
+ (receive): Throws IOException.
+ (send): Throws IOException.
+ * java/nio/channels/Pipe.java
+ (open): Throws IOException.
+ * java/nio/channels/SelectableChannel.java
+ (configureBlocking): Throws IOException.
+ * java/nio/channels/ServerSocketChannel.java
+ (accept): Throws IOException.
+ * java/nio/channels/SocketChannel.java
+ (SocketChannel): Implements ByteChannel, ScatteringByteChannel,
+ GatheringByteChannel.
+ (read): Throws IOException.
+ (write): Throws IOException.
+ (finishConnect): Throws IOException.
+ * java/nio/channels/spi/AbstractInterruptibleChannel.java
+ (end): Throws AsynchronousCloseException.
+ * java/nio/channels/spi/AbstractSelectableChannel.java
+ (configureBlocking): Throws IOException.
+ (implCloseChannel): Throws IOException.
+ (implCloseSelectableChannel): Throws IOException.
+ (implConfigureBlocking): Throws IOException.
+ * java/nio/channels/spi/SelectorProvider.java
+ (openDatagramChannel): Throws IOException.
+ (openPipe): Throws IOException.
+ (openSelector): Throws IOException.
+ (openServerSocketChannel): Throws IOException.
+ (openSocketChannel): Throws IOException.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/FileLockImpl.java,
+ java/nio/channels/FileLock.java: New files.
+
+2003-02-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/charset/IllegalCharsetNameException.java
+ (serialVersionUID): New member variable.
+ (charsetName): New member variable.
+ (IllegalCharsetException): New implementation.
+ (getCharsetName): New implementation.
+ * java/nio/charset/UnsupportedCharsetException.java
+ (serialVersionUID): New member variable.
+ (charsetName): New member variable.
+ (UnsupportedCharsetException): New implementation.
+ (getCharsetName): New implementation.
+
+2003-02-10 Tom Tromey <tromey@redhat.com>
+
+ * javax/sql/ConnectionEvent.java (serialVersionUID): New field.
+ (ex): Renamed from sqlException.
+
+2003-02-10 Raif S. Naffah <raif@fl.net.au>
+
+ * gnu/java/security/provider/SHA1PRNG.java (ensureIsSeeded): new
+ method used to ensure seeding has occurred and that a specific
+ seed can be set and used.
+
+2003-02-10 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/lang/Win32Process.java (destroy): Declare as native.
+ (hasExited): New native method.
+ (exitValue): Define.
+ (getErrorStream): Likewise.
+ (getInputStream): Likewise.
+ (getOutputStream): Likewise.
+ (waitFor): Declare as native.
+ (startProcess): New native method.
+ (cleanup): Likewise.
+ (ConcreteProcess): Define.
+ (outputStream, inputStream, errorStream): New members.
+ (procHandle, exitCode): Likewise.
+
+ * java/lang/natWin32Process.cc
+ (java::lang::ConcreteProcess::cleanup): Define.
+ (java::lang::ConcreteProcess::destroy): Likewise.
+ (java::lang::ConcreteProcess::hasExited): Likewise.
+ (java::lang::ConcreteProcess::waitFor): Likewise.
+ (new_string): Likewise.
+ (java::lang::ConcreteProcess::startProcess): Likewise.
+
+2003-02-10 Raif S. Naffah <raif@fl.net.au>
+
+ * java/math/BigInteger.java:
+ Updated notice to include years 2002 and 3.
+ Added 2 private (int) arrays with values from the HAC (Handbook of
+ Applied Cryptography -A. Menezes & al): k[] that contains bit lengths
+ and t[] that contains nbr. of tests --used in isProbablePrime().
+
+ * java/math/BigInteger.java (make(long)): Merged into valueOf(long).
+
+ * java/math/BigInteger.java (make(int[],int), add(int,int),
+ add(BI,BI,int), times(BI,int), divide(long,long,BI,BI,int), gcd(BI),
+ isProbablePrime(int), shift(BI,int), valueOf(String,int), neg(BI),
+ bitOp(int,BI,BI), and(BI,int)): Use valueOf(long) instead of
+ make(long).
+
+ * java/math/BigInteger.java (euclidInv): Reduce number of work vars
+ (euclidInv(int,int,int)): Now returns an array of 2 ints instead of 3.
+ (euclidInv(BI,BI,BI)): Used to return an array of 2 BIs; now accepts 6
+ BIs and returns void.
+ (modInverse(BI)): Use new signatures of euclidInv().
+
+ * java/math/BigInteger.java (isProbablePrime(int)): Use divide() with
+ static small primes instead of remainder().
+ Use pre-computed max nbr of trials based on bitlength of BI to test.
+ Use pre-computed small primes for the trial tests instead of random
+ numbers.
+
+ * java/math/BigInteger.java (isOdd, isMinusOne, pow): Removed.
+ not used.
+
+ * java/math/BigInteger.java (format(int,StringBuffer)): Removed
+ invoacation of MPN.chars_per_word(). not used.
+
+ * java/math/BigInteger.java (gcd(int,int)): Declared 'tmp' once as
+ local var and used where needed.
+
+ * java/math/BigInteger.java (modPow(BI,BI)): Fixed spelling.
+ Combined declaration with initialisation of locals.
+ Removed unused var.
+
+ * java/math/BigInteger.java: Style changes
+ (pow(int)): Removed 'else' keyword.
+ (toString(int)): idem.
+ (doubleValue()): idem.
+ (bitLength()): idem.
+ (equals(Object)): Use static methods name in same class w/o prepending
+ class name.
+ (doubleValue()): idem.
+ (setNegative(BI)): idem.
+ (negate()): idem.
+ (and(BI,int)): idem.
+ (and(BI)): idem.
+ (gcd(BI)): idem.
+ (byteArrayToIntArray()): Removed casting to (int). this is
+ std. behaviour.
+ (canonicalize()): idem.
+ (alloc(int)): Always instantiate a new BI.
+
+2003-02-10 Tom Tromey <tromey@redhat.com>
+
+ * java/sql/Timestamp.java (compareTo(Object)): New method.
+ (compareTo(Timestamp)): Likewise.
+ (serialVersionUID): Updated.
+
2003-02-07 Mark Wielaard <mark@klomp.org>
* java/util/jar/JarFile.java (JarFile(String, boolean)): Read manifest
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 28b67a3f41b..c68042b8d60 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -897,6 +897,22 @@ java/awt/event/MouseWheelEvent.java \
java/awt/event/MouseWheelListener.java \
java/awt/event/WindowFocusListener.java \
java/awt/event/WindowStateListener.java \
+java/awt/font/FontRenderContext.java \
+java/awt/font/ShapeGraphicAttribute.java \
+java/awt/font/MultipleMaster.java \
+java/awt/font/TransformAttribute.java \
+java/awt/font/GlyphJustificationInfo.java \
+java/awt/font/LineBreakMeasurer.java \
+java/awt/font/TextMeasurer.java \
+java/awt/font/TextLayout.java \
+java/awt/font/LineMetrics.java \
+java/awt/font/TextAttribute.java \
+java/awt/font/GlyphMetrics.java \
+java/awt/font/OpenType.java \
+java/awt/font/GlyphVector.java \
+java/awt/font/GraphicAttribute.java \
+java/awt/font/ImageGraphicAttribute.java \
+java/awt/font/NumericShaper.java \
java/awt/geom/AffineTransform.java \
java/awt/geom/Dimension2D.java \
java/awt/geom/Ellipse2D.java \
@@ -1855,6 +1871,15 @@ java/util/TreeSet.java \
java/util/TooManyListenersException.java \
java/util/Vector.java \
java/util/WeakHashMap.java \
+java/util/prefs/NodeChangeListener.java \
+java/util/prefs/Preferences.java \
+java/util/prefs/PreferenceChangeListener.java \
+java/util/prefs/NodeChangeEvent.java \
+java/util/prefs/InvalidPreferencesFormatException.java \
+java/util/prefs/AbstractPreferences.java \
+java/util/prefs/BackingStoreException.java \
+java/util/prefs/PreferenceChangeEvent.java \
+java/util/prefs/PreferencesFactory.java \
java/util/regex/Matcher.java \
java/util/regex/Pattern.java \
java/util/regex/PatternSyntaxException.java
@@ -2037,6 +2062,21 @@ gnu/java/locale/LocaleInformation_zh_HK.java \
gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
+gnu/java/nio/ByteBufferImpl.java \
+gnu/java/nio/CharBufferImpl.java \
+gnu/java/nio/DatagramChannelImpl.java \
+gnu/java/nio/DoubleBufferImpl.java \
+gnu/java/nio/FileChannelImpl.java \
+gnu/java/nio/FloatBufferImpl.java \
+gnu/java/nio/IntBufferImpl.java \
+gnu/java/nio/LongBufferImpl.java \
+gnu/java/nio/PipeImpl.java \
+gnu/java/nio/SelectionKeyImpl.java \
+gnu/java/nio/SelectorImpl.java \
+gnu/java/nio/SelectorProviderImpl.java \
+gnu/java/nio/ServerSocketChannelImpl.java \
+gnu/java/nio/ShortBufferImpl.java \
+gnu/java/nio/SocketChannelImpl.java \
gnu/java/nio/charset/ISO_8859_1.java \
gnu/java/nio/charset/Provider.java \
gnu/java/nio/charset/US_ASCII.java \
@@ -2068,6 +2108,11 @@ gnu/java/text/SentenceBreakIterator.java \
gnu/java/text/WordBreakIterator.java \
gnu/java/util/DoubleEnumeration.java \
gnu/java/util/EmptyEnumeration.java \
+gnu/java/util/prefs/MemoryBasedFactory.java \
+gnu/java/util/prefs/NodeReader.java \
+gnu/java/util/prefs/MemoryBasedPreferences.java \
+gnu/java/util/prefs/FileBasedFactory.java \
+gnu/java/util/prefs/NodeWriter.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
@@ -2139,20 +2184,27 @@ java/nio/BufferUnderflowException.java \
java/nio/ByteBuffer.java \
java/nio/ByteOrder.java \
java/nio/CharBuffer.java \
+java/nio/DoubleBuffer.java \
+java/nio/FloatBuffer.java \
+java/nio/IntBuffer.java \
java/nio/InvalidMarkException.java \
+java/nio/LongBuffer.java \
java/nio/MappedByteBuffer.java \
java/nio/ReadOnlyBufferException.java \
+java/nio/ShortBuffer.java \
java/nio/channels/AlreadyConnectedException.java \
java/nio/channels/AsynchronousCloseException.java \
java/nio/channels/ByteChannel.java \
java/nio/channels/CancelledKeyException.java \
java/nio/channels/Channel.java \
+java/nio/channels/Channels.java \
java/nio/channels/ClosedByInterruptException.java \
java/nio/channels/ClosedChannelException.java \
java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
java/nio/channels/IllegalBlockingModeException.java \
@@ -2431,6 +2483,16 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
+gnu/java/nio/natByteBufferImpl.cc \
+gnu/java/nio/natCharBufferImpl.cc \
+gnu/java/nio/natDoubleBufferImpl.cc \
+gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/nio/natFloatBufferImpl.cc \
+gnu/java/nio/natIntBufferImpl.cc \
+gnu/java/nio/natLongBufferImpl.cc \
+gnu/java/nio/natSelectorImpl.cc \
+gnu/java/nio/natShortBufferImpl.cc \
+gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 06c9a2977da..7b7b1b8cd87 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -664,6 +664,22 @@ java/awt/event/MouseWheelEvent.java \
java/awt/event/MouseWheelListener.java \
java/awt/event/WindowFocusListener.java \
java/awt/event/WindowStateListener.java \
+java/awt/font/FontRenderContext.java \
+java/awt/font/ShapeGraphicAttribute.java \
+java/awt/font/MultipleMaster.java \
+java/awt/font/TransformAttribute.java \
+java/awt/font/GlyphJustificationInfo.java \
+java/awt/font/LineBreakMeasurer.java \
+java/awt/font/TextMeasurer.java \
+java/awt/font/TextLayout.java \
+java/awt/font/LineMetrics.java \
+java/awt/font/TextAttribute.java \
+java/awt/font/GlyphMetrics.java \
+java/awt/font/OpenType.java \
+java/awt/font/GlyphVector.java \
+java/awt/font/GraphicAttribute.java \
+java/awt/font/ImageGraphicAttribute.java \
+java/awt/font/NumericShaper.java \
java/awt/geom/AffineTransform.java \
java/awt/geom/Dimension2D.java \
java/awt/geom/Ellipse2D.java \
@@ -1620,6 +1636,15 @@ java/util/TreeSet.java \
java/util/TooManyListenersException.java \
java/util/Vector.java \
java/util/WeakHashMap.java \
+java/util/prefs/NodeChangeListener.java \
+java/util/prefs/Preferences.java \
+java/util/prefs/PreferenceChangeListener.java \
+java/util/prefs/NodeChangeEvent.java \
+java/util/prefs/InvalidPreferencesFormatException.java \
+java/util/prefs/AbstractPreferences.java \
+java/util/prefs/BackingStoreException.java \
+java/util/prefs/PreferenceChangeEvent.java \
+java/util/prefs/PreferencesFactory.java \
java/util/regex/Matcher.java \
java/util/regex/Pattern.java \
java/util/regex/PatternSyntaxException.java
@@ -1797,6 +1822,21 @@ gnu/java/locale/LocaleInformation_zh_HK.java \
gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
+gnu/java/nio/ByteBufferImpl.java \
+gnu/java/nio/CharBufferImpl.java \
+gnu/java/nio/DatagramChannelImpl.java \
+gnu/java/nio/DoubleBufferImpl.java \
+gnu/java/nio/FileChannelImpl.java \
+gnu/java/nio/FloatBufferImpl.java \
+gnu/java/nio/IntBufferImpl.java \
+gnu/java/nio/LongBufferImpl.java \
+gnu/java/nio/PipeImpl.java \
+gnu/java/nio/SelectionKeyImpl.java \
+gnu/java/nio/SelectorImpl.java \
+gnu/java/nio/SelectorProviderImpl.java \
+gnu/java/nio/ServerSocketChannelImpl.java \
+gnu/java/nio/ShortBufferImpl.java \
+gnu/java/nio/SocketChannelImpl.java \
gnu/java/nio/charset/ISO_8859_1.java \
gnu/java/nio/charset/Provider.java \
gnu/java/nio/charset/US_ASCII.java \
@@ -1828,6 +1868,11 @@ gnu/java/text/SentenceBreakIterator.java \
gnu/java/text/WordBreakIterator.java \
gnu/java/util/DoubleEnumeration.java \
gnu/java/util/EmptyEnumeration.java \
+gnu/java/util/prefs/MemoryBasedFactory.java \
+gnu/java/util/prefs/NodeReader.java \
+gnu/java/util/prefs/MemoryBasedPreferences.java \
+gnu/java/util/prefs/FileBasedFactory.java \
+gnu/java/util/prefs/NodeWriter.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
@@ -1899,20 +1944,27 @@ java/nio/BufferUnderflowException.java \
java/nio/ByteBuffer.java \
java/nio/ByteOrder.java \
java/nio/CharBuffer.java \
+java/nio/DoubleBuffer.java \
+java/nio/FloatBuffer.java \
+java/nio/IntBuffer.java \
java/nio/InvalidMarkException.java \
+java/nio/LongBuffer.java \
java/nio/MappedByteBuffer.java \
java/nio/ReadOnlyBufferException.java \
+java/nio/ShortBuffer.java \
java/nio/channels/AlreadyConnectedException.java \
java/nio/channels/AsynchronousCloseException.java \
java/nio/channels/ByteChannel.java \
java/nio/channels/CancelledKeyException.java \
java/nio/channels/Channel.java \
+java/nio/channels/Channels.java \
java/nio/channels/ClosedByInterruptException.java \
java/nio/channels/ClosedChannelException.java \
java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
java/nio/channels/IllegalBlockingModeException.java \
@@ -2190,6 +2242,16 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
+gnu/java/nio/natByteBufferImpl.cc \
+gnu/java/nio/natCharBufferImpl.cc \
+gnu/java/nio/natDoubleBufferImpl.cc \
+gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/nio/natFloatBufferImpl.cc \
+gnu/java/nio/natIntBufferImpl.cc \
+gnu/java/nio/natLongBufferImpl.cc \
+gnu/java/nio/natSelectorImpl.cc \
+gnu/java/nio/natShortBufferImpl.cc \
+gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
@@ -2361,8 +2423,15 @@ 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 java/io/natFile.lo \
-java/io/natFileDescriptor.lo java/io/natObjectInputStream.lo \
+gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natByteBufferImpl.lo \
+gnu/java/nio/natCharBufferImpl.lo gnu/java/nio/natDoubleBufferImpl.lo \
+gnu/java/nio/natFileChannelImpl.lo \
+gnu/java/nio/natFloatBufferImpl.lo gnu/java/nio/natIntBufferImpl.lo \
+gnu/java/nio/natLongBufferImpl.lo \
+gnu/java/nio/natSelectorImpl.lo \
+gnu/java/nio/natShortBufferImpl.lo gnu/java/nio/natSocketChannelImpl.lo \
+java/io/natFile.lo java/io/natFileDescriptor.lo \
+java/io/natObjectInputStream.lo \
java/io/natObjectOutputStream.lo java/io/natVMObjectStreamClass.lo \
java/lang/natCharacter.lo java/lang/natClass.lo \
java/lang/natClassLoader.lo java/lang/natConcreteProcess.lo \
@@ -2820,7 +2889,19 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/locale/LocaleInformation_zh_HK.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/charset/ISO_8859_1.P \
+.deps/gnu/java/math/MPN.P .deps/gnu/java/nio/ByteBufferImpl.P \
+.deps/gnu/java/nio/CharBufferImpl.P \
+.deps/gnu/java/nio/DatagramChannelImpl.P \
+.deps/gnu/java/nio/DoubleBufferImpl.P \
+.deps/gnu/java/nio/FileChannelImpl.P \
+.deps/gnu/java/nio/FloatBufferImpl.P .deps/gnu/java/nio/IntBufferImpl.P \
+.deps/gnu/java/nio/LongBufferImpl.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/ShortBufferImpl.P \
+.deps/gnu/java/nio/SocketChannelImpl.P \
+.deps/gnu/java/nio/charset/ISO_8859_1.P \
.deps/gnu/java/nio/charset/Provider.P \
.deps/gnu/java/nio/charset/US_ASCII.P \
.deps/gnu/java/nio/charset/UTF_16.P \
@@ -2829,6 +2910,16 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.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/natByteBufferImpl.P \
+.deps/gnu/java/nio/natCharBufferImpl.P \
+.deps/gnu/java/nio/natDoubleBufferImpl.P \
+.deps/gnu/java/nio/natFileChannelImpl.P \
+.deps/gnu/java/nio/natFloatBufferImpl.P \
+.deps/gnu/java/nio/natIntBufferImpl.P \
+.deps/gnu/java/nio/natLongBufferImpl.P \
+.deps/gnu/java/nio/natSelectorImpl.P \
+.deps/gnu/java/nio/natShortBufferImpl.P \
+.deps/gnu/java/nio/natSocketChannelImpl.P \
.deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \
.deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \
.deps/gnu/java/rmi/dgc/DGCImpl.P .deps/gnu/java/rmi/dgc/DGCImpl_Skel.P \
@@ -2874,7 +2965,12 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/text/SentenceBreakIterator.P \
.deps/gnu/java/text/WordBreakIterator.P \
.deps/gnu/java/util/DoubleEnumeration.P \
-.deps/gnu/java/util/EmptyEnumeration.P .deps/interpret.P \
+.deps/gnu/java/util/EmptyEnumeration.P \
+.deps/gnu/java/util/prefs/FileBasedFactory.P \
+.deps/gnu/java/util/prefs/MemoryBasedFactory.P \
+.deps/gnu/java/util/prefs/MemoryBasedPreferences.P \
+.deps/gnu/java/util/prefs/NodeReader.P \
+.deps/gnu/java/util/prefs/NodeWriter.P .deps/interpret.P \
.deps/java/applet/Applet.P .deps/java/applet/AppletContext.P \
.deps/java/applet/AppletStub.P .deps/java/applet/AudioClip.P \
.deps/java/awt/AWTError.P .deps/java/awt/AWTEvent.P \
@@ -3002,10 +3098,21 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/event/WindowFocusListener.P \
.deps/java/awt/event/WindowListener.P \
.deps/java/awt/event/WindowStateListener.P \
-.deps/java/awt/font/TextHitInfo.P .deps/java/awt/geom/AffineTransform.P \
-.deps/java/awt/geom/Arc2D.P .deps/java/awt/geom/Area.P \
-.deps/java/awt/geom/CubicCurve2D.P .deps/java/awt/geom/Dimension2D.P \
-.deps/java/awt/geom/Ellipse2D.P \
+.deps/java/awt/font/FontRenderContext.P \
+.deps/java/awt/font/GlyphJustificationInfo.P \
+.deps/java/awt/font/GlyphMetrics.P .deps/java/awt/font/GlyphVector.P \
+.deps/java/awt/font/GraphicAttribute.P \
+.deps/java/awt/font/ImageGraphicAttribute.P \
+.deps/java/awt/font/LineBreakMeasurer.P \
+.deps/java/awt/font/LineMetrics.P .deps/java/awt/font/MultipleMaster.P \
+.deps/java/awt/font/NumericShaper.P .deps/java/awt/font/OpenType.P \
+.deps/java/awt/font/ShapeGraphicAttribute.P \
+.deps/java/awt/font/TextAttribute.P .deps/java/awt/font/TextHitInfo.P \
+.deps/java/awt/font/TextLayout.P .deps/java/awt/font/TextMeasurer.P \
+.deps/java/awt/font/TransformAttribute.P \
+.deps/java/awt/geom/AffineTransform.P .deps/java/awt/geom/Arc2D.P \
+.deps/java/awt/geom/Area.P .deps/java/awt/geom/CubicCurve2D.P \
+.deps/java/awt/geom/Dimension2D.P .deps/java/awt/geom/Ellipse2D.P \
.deps/java/awt/geom/FlatteningPathIterator.P \
.deps/java/awt/geom/GeneralPath.P \
.deps/java/awt/geom/IllegalPathStateException.P \
@@ -3298,19 +3405,22 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/BufferOverflowException.P \
.deps/java/nio/BufferUnderflowException.P .deps/java/nio/ByteBuffer.P \
.deps/java/nio/ByteOrder.P .deps/java/nio/CharBuffer.P \
-.deps/java/nio/InvalidMarkException.P .deps/java/nio/MappedByteBuffer.P \
-.deps/java/nio/ReadOnlyBufferException.P \
+.deps/java/nio/DoubleBuffer.P .deps/java/nio/FloatBuffer.P \
+.deps/java/nio/IntBuffer.P .deps/java/nio/InvalidMarkException.P \
+.deps/java/nio/LongBuffer.P .deps/java/nio/MappedByteBuffer.P \
+.deps/java/nio/ReadOnlyBufferException.P .deps/java/nio/ShortBuffer.P \
.deps/java/nio/channels/AlreadyConnectedException.P \
.deps/java/nio/channels/AsynchronousCloseException.P \
.deps/java/nio/channels/ByteChannel.P \
.deps/java/nio/channels/CancelledKeyException.P \
-.deps/java/nio/channels/Channel.P \
+.deps/java/nio/channels/Channel.P .deps/java/nio/channels/Channels.P \
.deps/java/nio/channels/ClosedByInterruptException.P \
.deps/java/nio/channels/ClosedChannelException.P \
.deps/java/nio/channels/ClosedSelectorException.P \
.deps/java/nio/channels/ConnectionPendingException.P \
.deps/java/nio/channels/DatagramChannel.P \
.deps/java/nio/channels/FileChannel.P \
+.deps/java/nio/channels/FileLock.P \
.deps/java/nio/channels/FileLockInterruptionException.P \
.deps/java/nio/channels/GatheringByteChannel.P \
.deps/java/nio/channels/IllegalBlockingModeException.P \
@@ -3564,6 +3674,15 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/util/jar/JarInputStream.P \
.deps/java/util/jar/JarOutputStream.P .deps/java/util/jar/Manifest.P \
.deps/java/util/natResourceBundle.P .deps/java/util/natTimeZone.P \
+.deps/java/util/prefs/AbstractPreferences.P \
+.deps/java/util/prefs/BackingStoreException.P \
+.deps/java/util/prefs/InvalidPreferencesFormatException.P \
+.deps/java/util/prefs/NodeChangeEvent.P \
+.deps/java/util/prefs/NodeChangeListener.P \
+.deps/java/util/prefs/PreferenceChangeEvent.P \
+.deps/java/util/prefs/PreferenceChangeListener.P \
+.deps/java/util/prefs/Preferences.P \
+.deps/java/util/prefs/PreferencesFactory.P \
.deps/java/util/regex/Matcher.P .deps/java/util/regex/Pattern.P \
.deps/java/util/regex/PatternSyntaxException.P \
.deps/java/util/zip/Adler32.P .deps/java/util/zip/CRC32.P \
diff --git a/libjava/configure b/libjava/configure
index 438c2abd3b0..567b70fc09e 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -2448,6 +2448,19 @@ case $host in
# Find out which ABI we are using.
echo '#line 2450 "configure"' > conftest.$ac_ext
if { (eval echo configure:2451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -2459,6 +2472,7 @@ case $host in
LD="${LD-ld} -64"
;;
esac
+ fi
fi
rm -rf conftest*
;;
@@ -2466,7 +2480,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2482,7 +2496,7 @@ ia64-*-hpux*)
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
@@ -2526,7 +2540,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2530: checking whether the C compiler needs -belf" >&5
+echo "configure:2544: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2539,14 +2553,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2543 "configure"
+#line 2557 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2576,7 +2590,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
esac
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:2580: checking how to run the C++ preprocessor" >&5
+echo "configure:2594: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2589,12 +2603,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 2593 "configure"
+#line 2607 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2612: \"$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
:
@@ -2830,7 +2844,7 @@ INTERPRETER="$libgcj_interpreter"
echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2834: checking for exception model to use" >&5
+echo "configure:2848: checking for exception model to use" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2845,7 +2859,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 2849 "configure"
+#line 2863 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2856,7 +2870,7 @@ void foo()
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-S
-if { (eval echo configure:2860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
enable_sjlj_exceptions=yes
elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
@@ -2966,7 +2980,7 @@ case "$TARGET_ECOS" in
PLATFORMH=win32.h
echo $ac_n "checking whether 'ld' is at least 2.13""... $ac_c" 1>&6
-echo "configure:2970: checking whether 'ld' is at least 2.13" >&5
+echo "configure:2984: checking whether 'ld' is at least 2.13" >&5
LD_PROG=`$CC --print-prog-name=ld`
LD_VERSION=`$LD_PROG --version`
LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
@@ -3010,7 +3024,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3014: checking how to run the C preprocessor" >&5
+echo "configure:3028: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -3025,13 +3039,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 3029 "configure"
+#line 3043 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3049: \"$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
:
@@ -3042,13 +3056,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 3046 "configure"
+#line 3060 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3066: \"$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
:
@@ -3059,13 +3073,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 3063 "configure"
+#line 3077 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3083: \"$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
:
@@ -3090,7 +3104,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 3094 "configure"
+#line 3108 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -3105,7 +3119,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3109 "configure"
+#line 3123 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -3120,7 +3134,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3124 "configure"
+#line 3138 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3135,7 +3149,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3139 "configure"
+#line 3153 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -3152,7 +3166,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3156 "configure"
+#line 3170 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3167,7 +3181,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3171 "configure"
+#line 3185 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3221,7 +3235,7 @@ ZLIBTESTSPEC=
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:3225: checking for X" >&5
+echo "configure:3239: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3283,12 +3297,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3287 "configure"
+#line 3301 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3306: \"$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*
@@ -3357,14 +3371,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3361 "configure"
+#line 3375 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -3470,17 +3484,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:3474: checking whether -R must be followed by a space" >&5
+echo "configure:3488: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 3477 "configure"
+#line 3491 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -3496,14 +3510,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 3500 "configure"
+#line 3514 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -3535,7 +3549,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:3539: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3553: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3543,7 +3557,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3547 "configure"
+#line 3561 "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
@@ -3554,7 +3568,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3572: \"$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
@@ -3576,7 +3590,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:3580: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3594: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3584,7 +3598,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3588 "configure"
+#line 3602 "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
@@ -3595,7 +3609,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3613: \"$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
@@ -3624,12 +3638,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3628: checking for gethostbyname" >&5
+echo "configure:3642: 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 3633 "configure"
+#line 3647 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -3652,7 +3666,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:3656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3670: \"$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
@@ -3673,7 +3687,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3677: checking for gethostbyname in -lnsl" >&5
+echo "configure:3691: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3681,7 +3695,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3685 "configure"
+#line 3699 "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
@@ -3692,7 +3706,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3710: \"$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
@@ -3722,12 +3736,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3726: checking for connect" >&5
+echo "configure:3740: 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 3731 "configure"
+#line 3745 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -3750,7 +3764,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3768: \"$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
@@ -3771,7 +3785,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3775: checking for connect in -lsocket" >&5
+echo "configure:3789: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3779,7 +3793,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3783 "configure"
+#line 3797 "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
@@ -3790,7 +3804,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:3794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3808: \"$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
@@ -3814,12 +3828,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:3818: checking for remove" >&5
+echo "configure:3832: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3823 "configure"
+#line 3837 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -3842,7 +3856,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:3846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -3863,7 +3877,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3867: checking for remove in -lposix" >&5
+echo "configure:3881: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3871,7 +3885,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3875 "configure"
+#line 3889 "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
@@ -3882,7 +3896,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3900: \"$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
@@ -3906,12 +3920,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3910: checking for shmat" >&5
+echo "configure:3924: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3915 "configure"
+#line 3929 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -3934,7 +3948,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:3938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -3955,7 +3969,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3959: checking for shmat in -lipc" >&5
+echo "configure:3973: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3963,7 +3977,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3967 "configure"
+#line 3981 "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
@@ -3974,7 +3988,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:3978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3992: \"$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
@@ -4007,7 +4021,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:4011: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4025: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4015,7 +4029,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4019 "configure"
+#line 4033 "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
@@ -4026,7 +4040,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4044: \"$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
@@ -4124,7 +4138,7 @@ fi
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:4128: checking for garbage collector to use" >&5
+echo "configure:4142: checking for garbage collector to use" >&5
# Check whether --enable-java-gc or --disable-java-gc was given.
if test "${enable_java_gc+set}" = set; then
enableval="$enable_java_gc"
@@ -4177,7 +4191,7 @@ esac
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:4181: checking for thread model used by GCC" >&5
+echo "configure:4195: checking for thread model used by GCC" >&5
THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
echo "$ac_t""$THREADS" 1>&6
@@ -4385,12 +4399,12 @@ else
for ac_func in strerror ioctl select fstat open fsync sleep opendir
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4389: checking for $ac_func" >&5
+echo "configure:4403: 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 4394 "configure"
+#line 4408 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4413,7 +4427,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4431: \"$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
@@ -4440,12 +4454,12 @@ done
for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4444: checking for $ac_func" >&5
+echo "configure:4458: 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 4449 "configure"
+#line 4463 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4468,7 +4482,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4486: \"$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
@@ -4495,12 +4509,12 @@ done
for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4499: checking for $ac_func" >&5
+echo "configure:4513: 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 4504 "configure"
+#line 4518 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4523,7 +4537,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4541: \"$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
@@ -4550,12 +4564,12 @@ done
for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4554: checking for $ac_func" >&5
+echo "configure:4568: 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 4559 "configure"
+#line 4573 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4578,7 +4592,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4596: \"$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
@@ -4605,12 +4619,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4609: checking for $ac_func" >&5
+echo "configure:4623: 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 4614 "configure"
+#line 4628 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4633,7 +4647,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4651: \"$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
@@ -4660,12 +4674,12 @@ done
for ac_func in inet_pton uname inet_ntoa
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4664: checking for $ac_func" >&5
+echo "configure:4678: 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 4669 "configure"
+#line 4683 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4688,7 +4702,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4706: \"$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
@@ -4715,12 +4729,12 @@ done
for ac_func in fork execvp pipe sigaction ftruncate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4719: checking for $ac_func" >&5
+echo "configure:4733: 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 4724 "configure"
+#line 4738 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4743,7 +4757,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4761: \"$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
@@ -4771,17 +4785,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4775: checking for $ac_hdr" >&5
+echo "configure:4789: 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 4780 "configure"
+#line 4794 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4799: \"$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*
@@ -4808,12 +4822,12 @@ fi
done
echo $ac_n "checking for backtrace""... $ac_c" 1>&6
-echo "configure:4812: checking for backtrace" >&5
+echo "configure:4826: checking for backtrace" >&5
if eval "test \"`echo '$''{'ac_cv_func_backtrace'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4817 "configure"
+#line 4831 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char backtrace(); below. */
@@ -4836,7 +4850,7 @@ backtrace();
; return 0; }
EOF
-if { (eval echo configure:4840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_backtrace=yes"
else
@@ -4883,7 +4897,7 @@ fi
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:4887: checking for dladdr in -ldl" >&5
+echo "configure:4901: checking for dladdr in -ldl" >&5
ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4891,7 +4905,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4895 "configure"
+#line 4909 "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
@@ -4902,7 +4916,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4920: \"$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
@@ -4932,7 +4946,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:4936: checking for $ac_file" >&5
+echo "configure:4950: checking for $ac_file" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4990,7 +5004,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:4994: checking for iconv" >&5
+echo "configure:5008: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4998,7 +5012,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 5002 "configure"
+#line 5016 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5008,7 +5022,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -5020,7 +5034,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 5024 "configure"
+#line 5038 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5030,7 +5044,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -5051,13 +5065,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:5055: checking for iconv declaration" >&5
+echo "configure:5069: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5061 "configure"
+#line 5075 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -5076,7 +5090,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -5105,19 +5119,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:5109: checking for LC_MESSAGES" >&5
+echo "configure:5123: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5114 "configure"
+#line 5128 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:5121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -5138,12 +5152,12 @@ EOF
fi
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5142: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5156: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5147 "configure"
+#line 5161 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -5151,7 +5165,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -5172,12 +5186,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5176: checking for tm_zone in struct tm" >&5
+echo "configure:5190: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5181 "configure"
+#line 5195 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -5185,7 +5199,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:5189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -5205,12 +5219,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5209: checking for tzname" >&5
+echo "configure:5223: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5214 "configure"
+#line 5228 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -5220,7 +5234,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:5224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -5245,12 +5259,12 @@ fi
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5249: checking for $ac_func" >&5
+echo "configure:5263: 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 5254 "configure"
+#line 5268 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5273,7 +5287,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5291: \"$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
@@ -5300,7 +5314,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5304 "configure"
+#line 5318 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5320,7 +5334,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:5324: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:5338: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5333,14 +5347,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 5337 "configure"
+#line 5351 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -5350,14 +5364,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 5354 "configure"
+#line 5368 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -5392,12 +5406,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:5396: checking for struct hostent_data" >&5
+echo "configure:5410: checking for struct hostent_data" >&5
if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5401 "configure"
+#line 5415 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -5408,7 +5422,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:5412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -5440,7 +5454,7 @@ done
# to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C
# linkage check is enough, yet C++ code requires proper prototypes.)
cat > conftest.$ac_ext <<EOF
-#line 5444 "configure"
+#line 5458 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5451,12 +5465,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
for ac_func in gethostbyaddr_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5455: checking for $ac_func" >&5
+echo "configure:5469: 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 5460 "configure"
+#line 5474 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5479,7 +5493,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5497: \"$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
@@ -5506,7 +5520,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5510 "configure"
+#line 5524 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5533,12 +5547,12 @@ rm -f conftest*
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5537: checking for $ac_func" >&5
+echo "configure:5551: 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 5542 "configure"
+#line 5556 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5561,7 +5575,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5579: \"$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
@@ -5585,7 +5599,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 5589 "configure"
+#line 5603 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5616,12 +5630,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:5620: checking for $ac_func" >&5
+echo "configure:5634: 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 5625 "configure"
+#line 5639 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5644,7 +5658,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5662: \"$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
@@ -5674,12 +5688,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5678: checking for $ac_func" >&5
+echo "configure:5692: 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 5683 "configure"
+#line 5697 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5702,7 +5716,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5720: \"$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
@@ -5724,7 +5738,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5728: checking for sched_yield in -lrt" >&5
+echo "configure:5742: 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
@@ -5732,7 +5746,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5736 "configure"
+#line 5750 "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
@@ -5743,7 +5757,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5761: \"$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
@@ -5769,7 +5783,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:5773: checking for sched_yield in -lposix4" >&5
+echo "configure:5787: 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
@@ -5777,7 +5791,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5781 "configure"
+#line 5795 "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
@@ -5788,7 +5802,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5806: \"$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
@@ -5824,7 +5838,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 5828 "configure"
+#line 5842 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5833,7 +5847,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -5845,7 +5859,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5849 "configure"
+#line 5863 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5854,7 +5868,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -5874,12 +5888,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:5878: checking for $ac_func" >&5
+echo "configure:5892: 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 5883 "configure"
+#line 5897 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5902,7 +5916,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5920: \"$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
@@ -5933,12 +5947,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5937: checking for $ac_func" >&5
+echo "configure:5951: 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 5942 "configure"
+#line 5956 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5961,7 +5975,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5979: \"$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
@@ -5991,12 +6005,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5995: checking for $ac_func" >&5
+echo "configure:6009: 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 6000 "configure"
+#line 6014 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6019,7 +6033,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6037: \"$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
@@ -6048,7 +6062,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6052: checking for dlopen in -ldl" >&5
+echo "configure:6066: 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
@@ -6056,7 +6070,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6060 "configure"
+#line 6074 "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
@@ -6067,7 +6081,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6085: \"$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
@@ -6112,7 +6126,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:6116: checking for socket libraries" >&5
+echo "configure:6130: 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
@@ -6120,12 +6134,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6124: checking for connect" >&5
+echo "configure:6138: 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 6129 "configure"
+#line 6143 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6148,7 +6162,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6166: \"$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
@@ -6171,7 +6185,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:6175: checking for main in -lsocket" >&5
+echo "configure:6189: 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
@@ -6179,14 +6193,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6183 "configure"
+#line 6197 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6204: \"$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
@@ -6213,12 +6227,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:6217: checking for accept" >&5
+echo "configure:6231: 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 6222 "configure"
+#line 6236 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -6241,7 +6255,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6259: \"$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
@@ -6268,12 +6282,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6272: checking for gethostbyname" >&5
+echo "configure:6286: 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 6277 "configure"
+#line 6291 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6296,7 +6310,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6314: \"$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
@@ -6314,7 +6328,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:6318: checking for main in -lnsl" >&5
+echo "configure:6332: 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
@@ -6322,14 +6336,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6326 "configure"
+#line 6340 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6347: \"$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
@@ -6361,7 +6375,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:6365: checking for deflate in -lz" >&5
+echo "configure:6379: 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
@@ -6369,7 +6383,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6373 "configure"
+#line 6387 "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
@@ -6380,7 +6394,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:6384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6398: \"$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
@@ -6455,7 +6469,7 @@ fi
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6459: checking for $ac_word" >&5
+echo "configure:6473: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6490,7 +6504,7 @@ fi
min_gtk_version=1.2.4
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:6508: checking for GTK - version >= $min_gtk_version" >&5
no_gtk=""
if test "$GTK_CONFIG" = "no" ; then
no_gtk=yes
@@ -6513,7 +6527,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 6517 "configure"
+#line 6531 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6591,7 +6605,7 @@ main ()
}
EOF
-if { (eval echo configure:6595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6625,7 +6639,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6629 "configure"
+#line 6643 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6635,7 +6649,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6653: \"$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"
@@ -6726,7 +6740,7 @@ fi
# Extract the first word of "glib-config", so it can be a program name with args.
set dummy glib-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6730: checking for $ac_word" >&5
+echo "configure:6744: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6761,7 +6775,7 @@ fi
min_glib_version=1.2.4
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
-echo "configure:6765: checking for GLIB - version >= $min_glib_version" >&5
+echo "configure:6779: checking for GLIB - version >= $min_glib_version" >&5
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
@@ -6784,7 +6798,7 @@ echo "configure:6765: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6788 "configure"
+#line 6802 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6860,7 +6874,7 @@ main ()
}
EOF
-if { (eval echo configure:6864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6894,7 +6908,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6898 "configure"
+#line 6912 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6904,7 +6918,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6922: \"$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"
@@ -6984,7 +6998,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:6988: checking for $ac_word" >&5
+echo "configure:7002: 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
@@ -7019,7 +7033,7 @@ fi
min_libart_version=2.1.0
echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6
-echo "configure:7023: checking for LIBART - version >= $min_libart_version" >&5
+echo "configure:7037: checking for LIBART - version >= $min_libart_version" >&5
no_libart=""
if test "$LIBART_CONFIG" = "no" ; then
no_libart=yes
@@ -7043,7 +7057,7 @@ echo "configure:7023: checking for LIBART - version >= $min_libart_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 7047 "configure"
+#line 7061 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7101,7 +7115,7 @@ int main ()
EOF
-if { (eval echo configure:7105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7135,7 +7149,7 @@ fi
CFLAGS="$CFLAGS $LIBART_CFLAGS"
LIBS="$LIBS $LIBART_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7139 "configure"
+#line 7153 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7145,7 +7159,7 @@ int main() {
return 0;
; return 0; }
EOF
-if { (eval echo configure:7149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7163: \"$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"
@@ -7184,7 +7198,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:7188: checking for main in -ldl" >&5
+echo "configure:7202: 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
@@ -7192,14 +7206,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7196 "configure"
+#line 7210 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7217: \"$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
@@ -7266,7 +7280,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:7270: checking for $ac_word" >&5
+echo "configure:7284: 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
@@ -7298,7 +7312,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:7302: checking for $ac_word" >&5
+echo "configure:7316: 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
@@ -7360,13 +7374,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:7364: checking size of void *" >&5
+echo "configure:7378: 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 7370 "configure"
+#line 7384 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -7376,7 +7390,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:7380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -7420,6 +7434,7 @@ fi
+
if test "$CANADIAN" = yes; then
CANADIAN_TRUE=
CANADIAN_FALSE='#'
@@ -7481,18 +7496,18 @@ EOF
echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:7485: checking for g++ -ffloat-store bug" >&5
+echo "configure:7500: checking for g++ -ffloat-store bug" >&5
save_CFLAGS="$CFLAGS"
CFLAGS="-x c++ -O2 -ffloat-store"
cat > conftest.$ac_ext <<EOF
-#line 7489 "configure"
+#line 7504 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:7496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@@ -7512,17 +7527,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:7516: checking for $ac_hdr" >&5
+echo "configure:7531: 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 7521 "configure"
+#line 7536 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7541: \"$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*
@@ -7552,17 +7567,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:7556: checking for $ac_hdr" >&5
+echo "configure:7571: 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 7561 "configure"
+#line 7576 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7581: \"$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*
@@ -7592,17 +7607,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:7596: checking for $ac_hdr" >&5
+echo "configure:7611: 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 7601 "configure"
+#line 7616 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7621: \"$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*
@@ -7638,12 +7653,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:7642: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:7657: 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 7647 "configure"
+#line 7662 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -7659,7 +7674,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:7663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -7681,12 +7696,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7685: checking for ANSI C header files" >&5
+echo "configure:7700: 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 7690 "configure"
+#line 7705 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -7694,7 +7709,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7713: \"$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*
@@ -7711,7 +7726,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 7715 "configure"
+#line 7730 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -7729,7 +7744,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 7733 "configure"
+#line 7748 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -7750,7 +7765,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 7754 "configure"
+#line 7769 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -7761,7 +7776,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:7765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7785,12 +7800,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:7789: checking for ssize_t" >&5
+echo "configure:7804: 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 7794 "configure"
+#line 7809 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7819,9 +7834,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:7823: checking for in_addr_t" >&5
+echo "configure:7838: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 7825 "configure"
+#line 7840 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7835,7 +7850,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:7839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -7851,16 +7866,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7855: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:7870: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7857 "configure"
+#line 7872 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:7864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -7876,16 +7891,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7880: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:7895: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7882 "configure"
+#line 7897 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:7889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -7901,16 +7916,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7905: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:7920: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7907 "configure"
+#line 7922 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:7914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -7926,9 +7941,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:7930: checking for socklen_t in sys/socket.h" >&5
+echo "configure:7945: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7932 "configure"
+#line 7947 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -7937,7 +7952,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -7953,16 +7968,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:7957: checking for tm_gmtoff in struct tm" >&5
+echo "configure:7972: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 7959 "configure"
+#line 7974 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:7966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -7975,16 +7990,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:7979: checking for global timezone variable" >&5
+echo "configure:7994: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 7981 "configure"
+#line 7996 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
void i(){long z2 = 2*timezone;}
; return 0; }
EOF
-if { (eval echo configure:7988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -7997,16 +8012,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:8001: checking for global _timezone variable" >&5
+echo "configure:8016: checking for global _timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8003 "configure"
+#line 8018 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = _timezone;
; return 0; }
EOF
-if { (eval echo configure:8010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_UNDERSCORE_TIMEZONE 1
@@ -8028,19 +8043,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:8032: checking for working alloca.h" >&5
+echo "configure:8047: 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 8037 "configure"
+#line 8052 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8059: \"$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
@@ -8061,12 +8076,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8065: checking for alloca" >&5
+echo "configure:8080: 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 8070 "configure"
+#line 8085 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -8094,7 +8109,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8113: \"$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
@@ -8126,12 +8141,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8130: checking whether alloca needs Cray hooks" >&5
+echo "configure:8145: 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 8135 "configure"
+#line 8150 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -8156,12 +8171,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:8160: checking for $ac_func" >&5
+echo "configure:8175: 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 8165 "configure"
+#line 8180 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8184,7 +8199,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8203: \"$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
@@ -8211,7 +8226,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8215: checking stack direction for C alloca" >&5
+echo "configure:8230: 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
@@ -8219,7 +8234,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8223 "configure"
+#line 8238 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -8238,7 +8253,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8257: \"$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
@@ -8265,7 +8280,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:8269: checking for $ac_word" >&5
+echo "configure:8284: 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
@@ -8611,6 +8626,7 @@ s%@ZINCS@%$ZINCS%g
s%@DIVIDESPEC@%$DIVIDESPEC%g
s%@CHECKREFSPEC@%$CHECKREFSPEC%g
s%@EXCEPTIONSPEC@%$EXCEPTIONSPEC%g
+s%@IEEESPEC@%$IEEESPEC%g
s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g
s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g
s%@NULL_TARGET_TRUE@%$NULL_TARGET_TRUE%g
@@ -8893,6 +8909,7 @@ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
libgcj_basedir=${libgcj_basedir}
CC="${CC}"
CXX="${CXX}"
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
EOF
cat >> $CONFIG_STATUS <<\EOF
diff --git a/libjava/configure.host b/libjava/configure.host
index 6ff71509e88..2fca3e1cc1d 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -110,6 +110,7 @@ case "${host}" in
libgcj_flags="${libgcj_flags} -mieee"
libgcj_interpreter=yes
enable_hash_synchronization_default=yes
+ IEEESPEC=-mieee
;;
powerpc64*-*)
# libffi not ported.
diff --git a/libjava/configure.in b/libjava/configure.in
index d75c32103b5..037451dcee8 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -855,6 +855,7 @@ AC_SUBST(ZINCS)
AC_SUBST(DIVIDESPEC)
AC_SUBST(CHECKREFSPEC)
AC_SUBST(EXCEPTIONSPEC)
+AC_SUBST(IEEESPEC)
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
@@ -1085,4 +1086,5 @@ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
libgcj_basedir=${libgcj_basedir}
CC="${CC}"
CXX="${CXX}"
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
)
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index 5af41bfc9cb..e5daa9dec6b 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -21,6 +21,8 @@ import java.awt.FontMetrics;
import java.awt.Paint;
import java.awt.RenderingHints;
import java.awt.Stroke;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
import java.awt.image.ImageObserver;
import java.awt.image.BufferedImage;
@@ -516,4 +518,14 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
{
throw new UnsupportedOperationException("not implemented yet");
}
+
+ public FontRenderContext getFontRenderContext ()
+ {
+ throw new UnsupportedOperationException("not implemented yet");
+ }
+
+ public void drawGlyphVector (GlyphVector g, float x, float y)
+ {
+ throw new UnsupportedOperationException("not implemented yet");
+ }
}
diff --git a/libjava/gnu/awt/xlib/XToolkit.java b/libjava/gnu/awt/xlib/XToolkit.java
index c71b39d0f80..df3a2b6b595 100644
--- a/libjava/gnu/awt/xlib/XToolkit.java
+++ b/libjava/gnu/awt/xlib/XToolkit.java
@@ -183,7 +183,7 @@ public class XToolkit extends Toolkit
public FontMetrics getFontMetrics(Font font)
{
- return defaultConfig.getXFontMetrics(font);
+ return getDefaultXGraphicsConfiguration().getXFontMetrics(font);
}
public void sync()
diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java
index 1d729d252ac..4089411e84b 100644
--- a/libjava/gnu/gcj/runtime/NameFinder.java
+++ b/libjava/gnu/gcj/runtime/NameFinder.java
@@ -371,7 +371,7 @@ public class NameFinder
int line = -1;
if (fileName != null)
{
- int colon = file.indexOf(':');
+ int colon = file.lastIndexOf(':');
if (colon > 0)
{
fileName = file.substring(0, colon);
diff --git a/libjava/gnu/gcj/runtime/natStackTrace.cc b/libjava/gnu/gcj/runtime/natStackTrace.cc
index 937f8dd3470..d39cd00dbab 100644
--- a/libjava/gnu/gcj/runtime/natStackTrace.cc
+++ b/libjava/gnu/gcj/runtime/natStackTrace.cc
@@ -1,6 +1,6 @@
// natStackTrace.cc - native helper methods for Throwable
-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc
This file is part of libgcj.
@@ -16,6 +16,7 @@ details. */
*/
#include <config.h>
+#include <platform.h>
#include <string.h>
@@ -31,8 +32,6 @@ details. */
#include <java/util/IdentityHashMap.h>
#include <java/lang/ArrayIndexOutOfBoundsException.h>
-#include "platform.h"
-
#include <sys/types.h>
#include <stdlib.h>
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
index 3e3d04bbb70..24ea252d4dc 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -40,6 +40,7 @@ package gnu.java.awt.peer.gtk;
import java.awt.*;
import java.awt.image.*;
+import java.text.AttributedCharacterIterator;
public class GdkGraphics extends Graphics
{
@@ -211,6 +212,11 @@ public class GdkGraphics extends Graphics
((GtkFontPeer)font.getPeer ()).getXLFD (), font.getSize ());
}
+ public void drawString (AttributedCharacterIterator ci, int x, int y)
+ {
+ throw new Error ("not implemented");
+ }
+
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
index 94603c0d3c9..a609f7ad818 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -47,6 +47,8 @@ public class GtkButtonPeer extends GtkComponentPeer
{
native void create ();
+ native void gtkSetFont(String xlfd, int size);
+
public GtkButtonPeer (Button b)
{
super (b);
@@ -86,4 +88,9 @@ public class GtkButtonPeer extends GtkComponentPeer
args.add ("label", ((Button)component).getLabel ());
}
+
+ public void setFont (Font f)
+ {
+ gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index 6e3b25290c8..b3a4525314e 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -88,6 +88,8 @@ public class GtkComponentPeer extends GtkGenericPeer
awtComponent.setBackground (getBackground ());
// if (c.getFont () == null)
// c.setFont (cp.getFont ());
+ if (awtComponent.getFont() != null)
+ setFont(awtComponent.getFont());
if (! (awtComponent instanceof Window))
{
@@ -273,6 +275,9 @@ public class GtkComponentPeer extends GtkGenericPeer
public void setFont (Font f)
{
+ // FIXME: This should really affect the widget tree below me.
+ // Currently this is only handled if the call is made directly on
+ // a text widget, which implements setFont() itself.
}
public void setForeground (Color c)
@@ -352,7 +357,8 @@ public class GtkComponentPeer extends GtkGenericPeer
p = component.getPeer ();
} while (p instanceof java.awt.peer.LightweightPeer);
- args.add ("parent", p);
+ if (p != null)
+ args.add ("parent", p);
}
native void set (String name, String value);
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
index 47a46e81865..d3130a905e9 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
@@ -57,14 +57,34 @@ public class GtkFontPeer implements FontPeer
}
}
- final private String Xname;
+ final private String Xname; // uses %d for font size.
public GtkFontPeer (String name, int style)
{
if (bundle != null)
Xname = bundle.getString (name.toLowerCase () + "." + style);
else
- Xname = "-*-*-medium-r-normal-*-12-*-*-*-c-*-*-*";
+ {
+ String weight;
+ String slant;
+ String spacing;
+
+ if (style == Font.ITALIC || (style == (Font.BOLD+Font.ITALIC)))
+ slant = "i";
+ else
+ slant = "r";
+ if (style == Font.BOLD || (style == (Font.BOLD+Font.ITALIC)))
+ weight = "bold";
+ else
+ weight = "medium";
+ if (name.equals("Serif") || name.equals("SansSerif")
+ || name.equals("Helvetica") || name.equals("Times"))
+ spacing = "p";
+ else
+ spacing = "c";
+
+ Xname = "-*-*-" + weight + "-" + slant + "-normal-*-%d-*-*-*-" + spacing + "-*-*-*";
+ }
}
public String getXLFD ()
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
index 7a648b913ad..ad83008cb8a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
@@ -45,6 +45,8 @@ public class GtkTextAreaPeer extends GtkTextComponentPeer
{
native void create (int scrollbarVisibility);
+ native void gtkSetFont(String xlfd, int size);
+
void create ()
{
create (((TextArea)awtComponent).getScrollbarVisibility ());
@@ -99,4 +101,9 @@ public class GtkTextAreaPeer extends GtkTextComponentPeer
{
insert (str, pos);
}
+
+ public void setFont (Font f)
+ {
+ gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
index 4dc23f8ba55..628cdd627ae 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
@@ -51,6 +51,8 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
native void gtkEntryGetSize (int cols, int dims[]);
+ native void gtkSetFont(String xlfd, int size);
+
public GtkTextFieldPeer (TextField tf)
{
super (tf);
@@ -95,4 +97,9 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
{
setEchoChar (c);
}
+
+ public void setFont (Font f)
+ {
+ gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ }
}
diff --git a/libjava/gnu/java/nio/ByteBufferImpl.java b/libjava/gnu/java/nio/ByteBufferImpl.java
index 54fba2492e1..149dc1c9683 100644
--- a/libjava/gnu/java/nio/ByteBufferImpl.java
+++ b/libjava/gnu/java/nio/ByteBufferImpl.java
@@ -43,37 +43,35 @@ import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
+import java.nio.ReadOnlyBufferException;
import java.nio.ShortBuffer;
+/**
+ * This is a Heap memory implementation
+ */
public final class ByteBufferImpl extends ByteBuffer
{
- private byte[] backing_buffer;
- private int array_offset;
- private boolean ro;
-
+ private boolean readOnly;
+
public ByteBufferImpl (int cap, int off, int lim)
{
- this.cap = cap;
- limit (lim);
- position (off);
- this.backing_buffer = new byte[cap];
+ super (cap, lim, off, 0);
+ this.backing_buffer = new byte [cap];
+ readOnly = false;
}
- public ByteBufferImpl (byte[] array, int off, int lim)
+ public ByteBufferImpl (byte[] array, int offset, int length)
{
- this.cap = array.length;
- limit (lim);
- position (off);
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
+ readOnly = false;
}
public ByteBufferImpl (ByteBufferImpl copy)
{
- this.cap = copy.capacity ();
- limit (copy.limit ());
- position (copy.position ());
- ro = copy.ro;
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
+ readOnly = copy.isReadOnly ();
}
void inc_pos (int toAdd)
@@ -89,52 +87,140 @@ public final class ByteBufferImpl extends ByteBuffer
private static native byte[] nio_cast(float[]copy);
private static native byte[] nio_cast(double[]copy);
+ ByteBufferImpl (byte[] copy)
+ {
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
- ByteBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(ByteBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/1); return res; }
+ private static native byte nio_get_Byte (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Byte (ByteBufferImpl b, int index, int limit, byte value);
+
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 1);
+ return res;
+ }
- ByteBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Char(ByteBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/1); return res; }
+ ByteBufferImpl (char[] copy)
+ {
+ super (copy.length * 2, copy.length * 2, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
- ByteBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Short(ByteBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/1); return res; }
+ private static native char nio_get_Char (ByteBufferImpl b, int index, int limit);
- ByteBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Int(ByteBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/1); return res; }
+ private static native void nio_put_Char (ByteBufferImpl b, int index, int limit, char value);
- ByteBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Long(ByteBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/1); return res; }
+ public CharBuffer asCharBuffer ()
+ {
+ CharBufferImpl res = new CharBufferImpl (backing_buffer);
+ res.limit ((limit () * 2) / 1);
+ return res;
+ }
- ByteBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Float(ByteBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/1); return res; }
+ ByteBufferImpl (short[] copy)
+ {
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
+
+ private static native short nio_get_Short (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Short (ByteBufferImpl b, int index, int limit, short value);
+
+ public ShortBuffer asShortBuffer ()
+ {
+ ShortBufferImpl res = new ShortBufferImpl (backing_buffer);
+ res.limit ((limit () * 2) / 1);
+ return res;
+ }
- ByteBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(ByteBufferImpl b, int index, int limit);
- private static native void nio_put_Double(ByteBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/1); return res; }
+ ByteBufferImpl (int[] copy)
+ {
+ super (copy.length * 4, copy.length * 4, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast(copy) : null;
+ readOnly = false;
+ }
+
+ private static native int nio_get_Int (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Int (ByteBufferImpl b, int index, int limit, int value);
+
+ public IntBuffer asIntBuffer ()
+ {
+ IntBufferImpl res = new IntBufferImpl (backing_buffer);
+ res.limit ((limit() * 4) / 1);
+ return res;
+ }
+
+ ByteBufferImpl (long[] copy)
+ {
+ super (copy.length * 8, copy.length * 8, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
+
+ private static native long nio_get_Long (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Long (ByteBufferImpl b, int index, int limit, long value);
+
+ public LongBuffer asLongBuffer ()
+ {
+ LongBufferImpl res = new LongBufferImpl (backing_buffer);
+ res.limit ((limit() * 8) / 1);
+ return res;
+ }
+
+ ByteBufferImpl (float[] copy)
+ {
+ super (copy.length * 4, copy.length * 4, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
+
+ private static native float nio_get_Float (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Float (ByteBufferImpl b, int index, int limit, float value);
+
+ public FloatBuffer asFloatBuffer ()
+ {
+ FloatBufferImpl res = new FloatBufferImpl (backing_buffer);
+ res.limit ((limit() * 4) / 1);
+ return res;
+ }
+
+ ByteBufferImpl (double[] copy)
+ {
+ super (copy.length * 8, copy.length * 8, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
+
+ private static native double nio_get_Double (ByteBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Double (ByteBufferImpl b, int index, int limit, double value);
+
+ public DoubleBuffer asDoubleBuffer ()
+ {
+ DoubleBufferImpl res = new DoubleBufferImpl (backing_buffer);
+ res.limit ((limit () * 8) / 1);
+ return res;
+ }
public boolean isReadOnly()
{
- return ro;
+ return readOnly;
}
public ByteBuffer slice()
{
- ByteBufferImpl A = new ByteBufferImpl(this);
- A.array_offset = position();
- return A;
+ return new ByteBufferImpl(this);
}
public ByteBuffer duplicate()
@@ -145,7 +231,7 @@ public final class ByteBufferImpl extends ByteBuffer
public ByteBuffer asReadOnlyBuffer()
{
ByteBufferImpl a = new ByteBufferImpl(this);
- a.ro = true;
+ a.readOnly = true;
return a;
}
@@ -156,7 +242,7 @@ public final class ByteBufferImpl extends ByteBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public byte get()
@@ -168,6 +254,9 @@ public final class ByteBufferImpl extends ByteBuffer
final public ByteBuffer put(byte b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -180,14 +269,201 @@ public final class ByteBufferImpl extends ByteBuffer
final public ByteBuffer put(int index, byte b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public ByteBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public ByteBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public ByteBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public ByteBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public ByteBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public ByteBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public ByteBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public ByteBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public ByteBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public ByteBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public ByteBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public ByteBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+ final public char getChar ()
+ {
+ char a = nio_get_Char (this, position (), limit ());
+ inc_pos (2);
+ return a;
+ }
+
+ final public ByteBuffer putChar (char value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Char (this, position (), limit (), value);
+ inc_pos (2);
+ return this;
+ }
+
+ final public char getChar (int index)
+ {
+ char a = nio_get_Char (this, index, limit ());
+ return a;
+ }
+
+ final public ByteBuffer putChar (int index, char value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Char (this, index, limit (), value);
+ return this;
+ }
+
+ final public short getShort ()
+ {
+ short a = nio_get_Short (this, position (), limit ());
+ inc_pos (2);
+ return a;
+ }
+
+ final public ByteBuffer putShort (short value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Short (this, position (), limit(), value);
+ inc_pos (2);
+ return this;
+ }
+
+ final public short getShort (int index)
+ {
+ short a = nio_get_Short (this, index, limit ());
+ return a;
+ }
+
+ final public ByteBuffer putShort (int index, short value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Short (this, index, limit (), value);
+ return this;
+ }
+
+ final public int getInt ()
+ {
+ int a = nio_get_Int (this, position (), limit ());
+ inc_pos (4);
+ return a;
+ }
+
+ final public ByteBuffer putInt (int value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Int (this, position (), limit , value);
+ inc_pos (4);
+ return this;
+ }
+
+ final public int getInt (int index)
+ {
+ int a = nio_get_Int (this, index, limit ());
+ return a;
+ }
+
+ final public ByteBuffer putInt (int index, int value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Int(this, index, limit (), value);
+ return this;
+ }
+
+ final public long getLong ()
+ {
+ long a = nio_get_Long (this, position (), limit ());
+ inc_pos (8);
+ return a;
+ }
+
+ final public ByteBuffer putLong (long value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Long (this, position (), limit (), value);
+ inc_pos (8);
+ return this;
+ }
+
+ final public long getLong (int index)
+ {
+ long a = nio_get_Long (this, index, limit ());
+ return a;
+ }
+
+ final public ByteBuffer putLong (int index, long value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Long (this, index, limit (), value);
+ return this;
+ }
+
+ final public float getFloat ()
+ {
+ float a = nio_get_Float (this, position (), limit ());
+ inc_pos (4);
+ return a;
+ }
+
+ final public ByteBuffer putFloat (float value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Float (this, position (), limit (), value);
+ inc_pos (4);
+ return this;
+ }
+
+ final public float getFloat (int index)
+ {
+ float a = nio_get_Float (this, index, limit ());
+ return a;
+ }
+
+ final public ByteBuffer putFloat (int index, float value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Float (this, index, limit(), value);
+ return this;
+ }
+
+ final public double getDouble ()
+ {
+ double a = nio_get_Double (this, position (), limit ());
+ inc_pos (8);
+ return a;
+ }
+
+ final public ByteBuffer putDouble (double value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Double (this, position(), limit (), value);
+ inc_pos (8);
+ return this;
+ }
+
+ final public double getDouble (int index)
+ {
+ return nio_get_Double (this, index, limit ());
+ }
+
+ final public ByteBuffer putDouble (int index, double value)
+ {
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
+ nio_put_Double (this, index, limit (), value);
+ return this;
+ }
}
diff --git a/libjava/gnu/java/nio/CharBufferImpl.java b/libjava/gnu/java/nio/CharBufferImpl.java
index 399dd6096b8..5126e28f096 100644
--- a/libjava/gnu/java/nio/CharBufferImpl.java
+++ b/libjava/gnu/java/nio/CharBufferImpl.java
@@ -40,101 +40,65 @@ package gnu.java.nio;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class CharBufferImpl extends CharBuffer
{
- private boolean ro;
+ private boolean readOnly;
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
-
public CharBufferImpl(int cap, int off, int lim)
{
- this.backing_buffer = new char[cap];
- this.cap = cap;
- this.limit(lim);
- this.position(off);
+ super (cap, lim, off, 0);
+ this.backing_buffer = new char [cap];
+ readOnly = false;
}
- public CharBufferImpl(char[] array, int off, int lim)
+ public CharBufferImpl(char[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public CharBufferImpl (CharBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit (copy.limit());
- position (copy.position ());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos (int a)
+ private static native char[] nio_cast (byte[] copy);
+
+ CharBufferImpl (byte[] copy)
{
- position (position () + a);
+ super (copy.length / 2, copy.length / 2, 0, 0);
+ this.backing_buffer = (copy != null ? nio_cast (copy) : null);
+ readOnly = false;
}
- CharBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(CharBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/2); return res; }
-
- CharBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Char(CharBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }
-
- CharBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Short(CharBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }
-
- CharBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Int(CharBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }
-
- CharBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Long(CharBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }
+ private static native byte nio_get_Byte (CharBufferImpl b, int index, int limit);
- CharBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Float(CharBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }
+ private static native void nio_put_Byte (CharBufferImpl b, int index, int limit, byte value);
- CharBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(CharBufferImpl b, int index, int limit);
- private static native void nio_put_Double(CharBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }
-
- private static native char[] nio_cast(byte[]copy);
- private static native char[] nio_cast(char[]copy);
- private static native char[] nio_cast(short[]copy);
- private static native char[] nio_cast(long[]copy);
- private static native char[] nio_cast(int[]copy);
- private static native char[] nio_cast(float[]copy);
- private static native char[] nio_cast(double[]copy);
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 2);
+ return res;
+ }
public boolean isReadOnly()
{
- return ro;
+ return readOnly;
}
public CharBuffer slice()
{
- CharBufferImpl buffer = new CharBufferImpl (this);
- buffer.array_offset = position ();
- return buffer;
+ return new CharBufferImpl (this);
}
public CharBuffer duplicate()
@@ -144,9 +108,9 @@ public final class CharBufferImpl extends CharBuffer
public CharBuffer asReadOnlyBuffer()
{
- CharBufferImpl a = new CharBufferImpl(this);
- a.ro = true;
- return a;
+ CharBufferImpl result = new CharBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public CharBuffer compact()
@@ -156,7 +120,7 @@ public final class CharBufferImpl extends CharBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public CharSequence subSequence (int start, int end)
@@ -172,6 +136,9 @@ public final class CharBufferImpl extends CharBuffer
position () + end);
}
+ /**
+ * Relative get method. Reads the next character from the buffer.
+ */
final public char get()
{
char e = backing_buffer[position()];
@@ -179,27 +146,54 @@ public final class CharBufferImpl extends CharBuffer
return e;
}
+ /**
+ * Relative put method. Writes <code>value</code> to the next position
+ * in the buffer.
+ *
+ * @exception ReadOnlyBufferException If this buffer is read-only.
+ */
final public CharBuffer put(char b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
}
-
- final public char getChar() { return get(); } final public CharBuffer putChar(char value) { return put(value); } final public char getChar(int index) { return get(index); } final public CharBuffer putChar(int index, char value) { return put(index, value); };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public CharBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public CharBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public CharBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public CharBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public CharBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public CharBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public CharBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public CharBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public CharBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public CharBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+ /**
+ * Absolute get method. Reads the character at position <code>index</code>.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit.
+ */
final public char get(int index)
{
+ if (index < 0
+ || index >= limit ())
+ throw new IndexOutOfBoundsException ();
+
return backing_buffer[index];
}
+ /**
+ * Absolute put method. Writes <code>value</value> to position
+ * <code>index</code> in the buffer.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
+ */
final public CharBuffer put(int index, char b)
{
+ if (index < 0
+ || index >= limit ())
+ throw new IndexOutOfBoundsException ();
+
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
@@ -207,6 +201,6 @@ public final class CharBufferImpl extends CharBuffer
public final ByteOrder order()
{
- return endian;
+ return ByteOrder.BIG_ENDIAN;
}
}
diff --git a/libjava/gnu/java/nio/DoubleBufferImpl.java b/libjava/gnu/java/nio/DoubleBufferImpl.java
index de0e6717fd0..f4dffc2d8f4 100644
--- a/libjava/gnu/java/nio/DoubleBufferImpl.java
+++ b/libjava/gnu/java/nio/DoubleBufferImpl.java
@@ -38,100 +38,66 @@ exception statement from your version. */
package gnu.java.nio;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
+import java.nio.ByteOrder;
import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class DoubleBufferImpl extends DoubleBuffer
{
- private int array_offset;
- private boolean ro;
+ private boolean readOnly;
public DoubleBufferImpl(int cap, int off, int lim)
{
+ super (cap, lim, off, 0);
this.backing_buffer = new double[cap];
- this.cap = cap;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
- public DoubleBufferImpl(double[] array, int off, int lim)
+ public DoubleBufferImpl(double[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public DoubleBufferImpl(DoubleBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit(copy.limit());
- position(copy.position());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos(int a)
+ DoubleBufferImpl (byte[] copy)
{
- position(position() + a);
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
}
-
- DoubleBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(DoubleBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/8); return res; }
-
- DoubleBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Char(DoubleBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
-
- DoubleBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Short(DoubleBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
- DoubleBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Int(DoubleBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
+ private static native byte nio_get_Byte (DoubleBufferImpl b, int index, int limit);
- DoubleBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Long(DoubleBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
+ private static native void nio_put_Byte (DoubleBufferImpl b, int index, int limit, byte value);
- DoubleBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Float(DoubleBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
-
- DoubleBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(DoubleBufferImpl b, int index, int limit);
- private static native void nio_put_Double(DoubleBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 8);
+ return res;
+ }
- private static native double[] nio_cast(byte[]copy);
- private static native double[] nio_cast(char[]copy);
- private static native double[] nio_cast(short[]copy);
- private static native double[] nio_cast(long[]copy);
- private static native double[] nio_cast(int[]copy);
- private static native double[] nio_cast(float[]copy);
- private static native double[] nio_cast(double[]copy);
+ private static native double[] nio_cast (byte[] copy);
- public boolean isReadOnly()
+ public boolean isReadOnly ()
{
- return ro;
+ return readOnly;
}
- public DoubleBuffer slice()
+ public DoubleBuffer slice ()
{
- DoubleBufferImpl A = new DoubleBufferImpl(this);
- A.array_offset = position();
- return A;
+ return new DoubleBufferImpl (this);
}
public DoubleBuffer duplicate()
@@ -141,9 +107,9 @@ public final class DoubleBufferImpl extends DoubleBuffer
public DoubleBuffer asReadOnlyBuffer()
{
- DoubleBufferImpl a = new DoubleBufferImpl(this);
- a.ro = true;
- return a;
+ DoubleBufferImpl result = new DoubleBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public DoubleBuffer compact()
@@ -153,7 +119,7 @@ public final class DoubleBufferImpl extends DoubleBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public double get()
@@ -165,6 +131,9 @@ public final class DoubleBufferImpl extends DoubleBuffer
final public DoubleBuffer put(double b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -177,14 +146,15 @@ public final class DoubleBufferImpl extends DoubleBuffer
final public DoubleBuffer put(int index, double b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
-
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public DoubleBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public DoubleBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public DoubleBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public DoubleBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public DoubleBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public DoubleBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public DoubleBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public DoubleBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public DoubleBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public DoubleBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { return get(); } final public DoubleBuffer putDouble(double value) { return put(value); } final public double getDouble(int index) { return get(index); } final public DoubleBuffer putDouble(int index, double value) { return put(index, value); };
+
+ final public ByteOrder order ()
+ {
+ return ByteOrder.BIG_ENDIAN;
+ }
}
diff --git a/libjava/gnu/java/nio/FileChannelImpl.java b/libjava/gnu/java/nio/FileChannelImpl.java
index 26b48e5e51c..31779bbc64e 100644
--- a/libjava/gnu/java/nio/FileChannelImpl.java
+++ b/libjava/gnu/java/nio/FileChannelImpl.java
@@ -44,7 +44,13 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
+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;
/**
* This file is not user visible !
@@ -66,11 +72,7 @@ public class FileChannelImpl extends FileChannel
* This method came from java.io.RandomAccessFile
* It is private there so we will repeat it here.
*/
-// private native long lengthInternal (int native_fd) throws IOException;
- private long lengthInternal (int native_fd) throws IOException
- {
- return 0;
- };
+ private native long lengthInternal (int native_fd) throws IOException;
public FileChannelImpl (int fd, Object obj)
{
@@ -80,39 +82,42 @@ public class FileChannelImpl extends FileChannel
public long size () throws IOException
{
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
return lengthInternal (fd);
}
- protected void implCloseChannel() throws IOException
+ protected void implCloseChannel() throws IOException
{
if (address != 0)
- {
+ {
nio_unmmap_file (fd, address, (int) length);
- }
+ address = 0;
+ }
// FIXME
fd = 0;
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
{
- int w = 0;
int s = (int)size();
if (buf == null)
@@ -128,9 +133,18 @@ public class FileChannelImpl extends FileChannel
return s;
}
- public long read (ByteBuffer[] dsts) throws IOException
+ public int read (ByteBuffer dst, long position)
+ throws IOException
{
- return read (dsts, 0, dsts.length);
+ if (position < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: check for NonReadableChannelException
+
+ throw new Error ("Not implemented");
}
public long read (ByteBuffer[] dsts, int offset, int length)
@@ -164,6 +178,20 @@ public class FileChannelImpl extends FileChannel
return w;
}
+ public int write (ByteBuffer src, long position)
+ throws IOException
+ {
+ if (position < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: check for NonWritableChannelException
+
+ throw new Error ("Not implemented");
+ }
+
public long write(ByteBuffer[] srcs, int offset, int length)
throws IOException
{
@@ -173,13 +201,22 @@ public class FileChannelImpl extends FileChannel
{
res += write (srcs[i]);
}
- return res;
- }
+
+ return res;
+ }
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 ();
+
// int cmode = mode.m;
// address = nio_mmap_file (fd, position, size, cmode);
// length = size;
@@ -208,27 +245,113 @@ public class FileChannelImpl extends FileChannel
/**
* msync with the disk
*/
- public void force (boolean metaData)
+ public void force (boolean metaData) throws IOException
{
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: What to do with metaData ?
+
nio_msync (fd, address, length);
}
-// static native long nio_mmap_file (int fd, long pos, int size, int mode);
+ public long transferTo (long position, long count, WritableByteChannel target)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: check for NonReadableChannelException
+ // FIXME: check for NonWritableChannelException
+
+ throw new Error ("Not implemented");
+ }
+
+ public long transferFrom (ReadableByteChannel src, long position, long count)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ();
-// static native void nio_unmmap_file (int fd, long address, int size);
+ if (!isOpen ())
+ throw new ClosedChannelException ();
-// static native void nio_msync (int fd, long address, int length);
+ // FIXME: check for NonReadableChannelException
+ // FIXME: check for NonWritableChannelException
+
+ throw new Error ("Not implemented");
+ }
- static long nio_mmap_file (int fd, long pos, int size, int mode)
+ public FileLock lock (long position, long size, boolean shared)
+ throws IOException
{
- return 0;
+ if (position < 0
+ || size < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: check for NonReadableChannelException
+ // FIXME: check for 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 ();
- static void nio_unmmap_file (int fd, long address, int size)
+ throw new Error ("Not implemented");
+ }
+
+ public long position ()
+ throws IOException
+ {
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ throw new Error ("not implemented");
+ }
+
+ public FileChannel position (long newPosition)
+ throws IOException
{
- };
+ if (newPosition < 0)
+ throw new IllegalArgumentException ();
- static void nio_msync (int fd, long address, int length)
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ throw new Error ("not implemented");
+ }
+
+ public FileChannel truncate (long size)
+ throws IOException
{
- };
+ if (size < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: check for NonWritableChannelException
+
+ throw new Error ("not implemented");
+ }
+
+ private static native long nio_mmap_file (int fd, long pos, int size, int mode);
+ private static native void nio_unmmap_file (int fd, long address, int size);
+ private static native void nio_msync (int fd, long address, int length);
}
diff --git a/libjava/gnu/java/nio/FloatBufferImpl.java b/libjava/gnu/java/nio/FloatBufferImpl.java
index bab47425f1d..6c77103bb2f 100644
--- a/libjava/gnu/java/nio/FloatBufferImpl.java
+++ b/libjava/gnu/java/nio/FloatBufferImpl.java
@@ -38,49 +38,49 @@ exception statement from your version. */
package gnu.java.nio;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
+import java.nio.ByteOrder;
import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class FloatBufferImpl extends FloatBuffer
{
- private int array_offset;
- private boolean ro;
+ private boolean readOnly;
public FloatBufferImpl(int cap, int off, int lim)
{
- this.backing_buffer = new float[cap];
- this.cap = cap;
- this.limit(lim);
- this.position(off);
+ super (cap, lim, off, 0);
+ this.backing_buffer = new float [cap];
+ readOnly = false;
}
- public FloatBufferImpl(float[] array, int off, int lim)
+ public FloatBufferImpl(float[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public FloatBufferImpl(FloatBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit(copy.limit());
- position(copy.position());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos(int a)
+ private static native float[] nio_cast (byte[] copy);
+
+ FloatBufferImpl (byte[] copy)
{
- position(position() + a);
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
}
-
- FloatBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast (copy) : null; }
+
private static native byte nio_get_Byte (FloatBufferImpl b, int index, int limit);
+
private static native void nio_put_Byte (FloatBufferImpl b, int index, int limit, byte value);
public ByteBuffer asByteBuffer()
@@ -90,54 +90,14 @@ public final class FloatBufferImpl extends FloatBuffer
return res;
}
- FloatBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Char(FloatBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
-
- FloatBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Short(FloatBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
-
- FloatBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Int(FloatBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
-
- FloatBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Long(FloatBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
-
- FloatBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Float(FloatBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
-
- FloatBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(FloatBufferImpl b, int index, int limit);
- private static native void nio_put_Double(FloatBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
-
- private static native float[] nio_cast(byte[]copy);
- private static native float[] nio_cast(char[]copy);
- private static native float[] nio_cast(short[]copy);
- private static native float[] nio_cast(long[]copy);
- private static native float[] nio_cast(int[]copy);
- private static native float[] nio_cast(float[]copy);
- private static native float[] nio_cast(double[]copy);
-
- public boolean isReadOnly()
+ public boolean isReadOnly ()
{
- return ro;
+ return readOnly;
}
public FloatBuffer slice()
{
- FloatBufferImpl A = new FloatBufferImpl(this);
- A.array_offset = position();
- return A;
+ return new FloatBufferImpl (this);
}
public FloatBuffer duplicate()
@@ -147,9 +107,9 @@ public final class FloatBufferImpl extends FloatBuffer
public FloatBuffer asReadOnlyBuffer()
{
- FloatBufferImpl a = new FloatBufferImpl(this);
- a.ro = true;
- return a;
+ FloatBufferImpl result = new FloatBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public FloatBuffer compact()
@@ -159,7 +119,7 @@ public final class FloatBufferImpl extends FloatBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public float get()
@@ -171,6 +131,9 @@ public final class FloatBufferImpl extends FloatBuffer
final public FloatBuffer put(float b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -183,14 +146,15 @@ public final class FloatBufferImpl extends FloatBuffer
final public FloatBuffer put(int index, float b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public FloatBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public FloatBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public FloatBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public FloatBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public FloatBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public FloatBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public FloatBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public FloatBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { return get(); } final public FloatBuffer putFloat(float value) { return put(value); } final public float getFloat(int index) { return get(index); } final public FloatBuffer putFloat(int index, float value) { return put(index, value); };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public FloatBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public FloatBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+ final public ByteOrder order ()
+ {
+ return ByteOrder.BIG_ENDIAN;
+ }
}
diff --git a/libjava/gnu/java/nio/IntBufferImpl.java b/libjava/gnu/java/nio/IntBufferImpl.java
index cccc418487c..d9f80636aa6 100644
--- a/libjava/gnu/java/nio/IntBufferImpl.java
+++ b/libjava/gnu/java/nio/IntBufferImpl.java
@@ -38,100 +38,66 @@ exception statement from your version. */
package gnu.java.nio;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
+import java.nio.ByteOrder;
import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class IntBufferImpl extends IntBuffer
{
- private int array_offset;
- private boolean ro;
+ private boolean readOnly;
public IntBufferImpl(int cap, int off, int lim)
{
+ super (cap, lim, off, 0);
this.backing_buffer = new int[cap];
- this.cap = cap;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
- public IntBufferImpl(int[] array, int off, int lim)
+ public IntBufferImpl(int[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public IntBufferImpl(IntBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit(copy.limit());
- position(copy.position());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos(int a)
+ private static native int[] nio_cast (byte[] copy);
+
+ IntBufferImpl (byte[] copy)
{
- position(position() + a);
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
}
- IntBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(IntBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/4); return res; }
-
- IntBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Char(IntBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
-
- IntBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Short(IntBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
-
- IntBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Int(IntBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
-
- IntBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Long(IntBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
-
- IntBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Float(IntBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
+ private static native byte nio_get_Byte (IntBufferImpl b, int index, int limit);
- IntBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(IntBufferImpl b, int index, int limit);
- private static native void nio_put_Double(IntBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
+ private static native void nio_put_Byte (IntBufferImpl b, int index, int limit, byte value);
- private static native int[] nio_cast(byte[]copy);
- private static native int[] nio_cast(char[]copy);
- private static native int[] nio_cast(short[]copy);
- private static native int[] nio_cast(long[]copy);
- private static native int[] nio_cast(int[]copy);
- private static native int[] nio_cast(float[]copy);
- private static native int[] nio_cast(double[]copy);
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 4);
+ return res;
+ }
public boolean isReadOnly()
{
- return ro;
+ return readOnly;
}
public IntBuffer slice()
{
- IntBufferImpl A = new IntBufferImpl(this);
- A.array_offset = position();
- return A;
+ return new IntBufferImpl (this);
}
public IntBuffer duplicate()
@@ -141,9 +107,9 @@ public final class IntBufferImpl extends IntBuffer
public IntBuffer asReadOnlyBuffer()
{
- IntBufferImpl a = new IntBufferImpl(this);
- a.ro = true;
- return a;
+ IntBufferImpl result = new IntBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public IntBuffer compact()
@@ -153,7 +119,7 @@ public final class IntBufferImpl extends IntBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public int get()
@@ -165,6 +131,9 @@ public final class IntBufferImpl extends IntBuffer
final public IntBuffer put(int b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -177,14 +146,15 @@ public final class IntBufferImpl extends IntBuffer
final public IntBuffer put(int index, int b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
-
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public IntBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public IntBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public IntBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public IntBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { return get(); } final public IntBuffer putInt(int value) { return put(value); } final public int getInt(int index) { return get(index); } final public IntBuffer putInt(int index, int value) { return put(index, value); };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public IntBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public IntBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public IntBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public IntBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public IntBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public IntBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+
+ final public ByteOrder order ()
+ {
+ return ByteOrder.BIG_ENDIAN;
+ }
}
diff --git a/libjava/gnu/java/nio/LongBufferImpl.java b/libjava/gnu/java/nio/LongBufferImpl.java
index 8f29b06939f..e17f4870b09 100644
--- a/libjava/gnu/java/nio/LongBufferImpl.java
+++ b/libjava/gnu/java/nio/LongBufferImpl.java
@@ -38,100 +38,66 @@ exception statement from your version. */
package gnu.java.nio;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
+import java.nio.ByteOrder;
import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class LongBufferImpl extends LongBuffer
{
- private int array_offset;
- private boolean ro;
+ private boolean readOnly;
public LongBufferImpl(int cap, int off, int lim)
{
+ super (cap, lim, off, 0);
this.backing_buffer = new long[cap];
- this.cap = cap ;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
- public LongBufferImpl(long[] array, int off, int lim)
+ public LongBufferImpl(long[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public LongBufferImpl(LongBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit(copy.limit());
- position(copy.position());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos(int a)
+ private static native long[] nio_cast (byte[] copy);
+
+ LongBufferImpl (byte[] copy)
{
- position(position() + a);
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
}
- LongBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(LongBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/8); return res; }
-
- LongBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Char(LongBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
-
- LongBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Short(LongBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
-
- LongBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Int(LongBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
-
- LongBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Long(LongBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
+ private static native byte nio_get_Byte (LongBufferImpl b, int index, int limit);
- LongBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Float(LongBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
+ private static native void nio_put_Byte (LongBufferImpl b, int index, int limit, byte value);
- LongBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(LongBufferImpl b, int index, int limit);
- private static native void nio_put_Double(LongBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
-
- private static native long[] nio_cast(byte[]copy);
- private static native long[] nio_cast(char[]copy);
- private static native long[] nio_cast(short[]copy);
- private static native long[] nio_cast(long[]copy);
- private static native long[] nio_cast(int[]copy);
- private static native long[] nio_cast(float[]copy);
- private static native long[] nio_cast(double[]copy);
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 8);
+ return res;
+ }
public boolean isReadOnly()
{
- return ro;
+ return readOnly;
}
public LongBuffer slice()
{
- LongBufferImpl A = new LongBufferImpl(this);
- A.array_offset = position();
- return A;
+ return new LongBufferImpl (this);
}
public LongBuffer duplicate()
@@ -141,9 +107,9 @@ public final class LongBufferImpl extends LongBuffer
public LongBuffer asReadOnlyBuffer()
{
- LongBufferImpl a = new LongBufferImpl(this);
- a.ro = true;
- return a;
+ LongBufferImpl result = new LongBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public LongBuffer compact()
@@ -153,7 +119,7 @@ public final class LongBufferImpl extends LongBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public long get()
@@ -165,6 +131,9 @@ public final class LongBufferImpl extends LongBuffer
final public LongBuffer put(long b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -177,14 +146,15 @@ public final class LongBufferImpl extends LongBuffer
final public LongBuffer put(int index, long b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public LongBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public LongBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public LongBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public LongBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public LongBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public LongBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { return get(); } final public LongBuffer putLong(long value) { return put(value); } final public long getLong(int index) { return get(index); } final public LongBuffer putLong(int index, long value) { return put(index, value); };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public LongBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public LongBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public LongBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public LongBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+ final public ByteOrder order ()
+ {
+ return ByteOrder.BIG_ENDIAN;
+ }
}
diff --git a/libjava/gnu/java/nio/SelectorProviderImpl.java b/libjava/gnu/java/nio/SelectorProviderImpl.java
index 3fedfc73546..d58e10a010e 100644
--- a/libjava/gnu/java/nio/SelectorProviderImpl.java
+++ b/libjava/gnu/java/nio/SelectorProviderImpl.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe;
import java.nio.channels.ServerSocketChannel;
@@ -51,26 +52,31 @@ public class SelectorProviderImpl extends SelectorProvider
}
public DatagramChannel openDatagramChannel ()
+ throws IOException
{
return new DatagramChannelImpl (this);
}
public Pipe openPipe ()
+ throws IOException
{
return new PipeImpl ();
}
public AbstractSelector openSelector ()
+ throws IOException
{
return new SelectorImpl (this);
}
public ServerSocketChannel openServerSocketChannel ()
+ throws IOException
{
return new ServerSocketChannelImpl (this);
}
public SocketChannel openSocketChannel ()
+ throws IOException
{
return new SocketChannelImpl (this);
}
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index 4a51f2a4b61..039b50308d6 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -54,10 +54,8 @@ class ServerSocketChannelImpl extends ServerSocketChannel
boolean connected = false;
// InetSocketAddress sa;
- private static native int SocketAccept (ServerSocketChannelImpl server,
- SocketChannelImpl s);
-
protected ServerSocketChannelImpl (SelectorProvider provider)
+ throws IOException
{
super (provider);
fd = SocketChannelImpl.SocketCreate ();
@@ -86,14 +84,14 @@ class ServerSocketChannelImpl extends ServerSocketChannel
}
}
- protected void implCloseSelectableChannel ()
+ protected void implCloseSelectableChannel () throws IOException
{
connected = false;
SocketChannelImpl.SocketClose (fd);
fd = SocketChannelImpl.SocketCreate ();
}
- protected void implConfigureBlocking (boolean block)
+ protected void implConfigureBlocking (boolean block) throws IOException
{
blocking = block;
}
@@ -102,7 +100,7 @@ class ServerSocketChannelImpl extends ServerSocketChannel
{
SocketChannelImpl result = new SocketChannelImpl (provider ());
result.sa = new InetSocketAddress (0);
- int res = SocketAccept (this,result);
+ //int res = SocketAccept (this,result);
return result;
}
diff --git a/libjava/gnu/java/nio/ShortBufferImpl.java b/libjava/gnu/java/nio/ShortBufferImpl.java
index bccb2d0f65a..e4c9a060539 100644
--- a/libjava/gnu/java/nio/ShortBufferImpl.java
+++ b/libjava/gnu/java/nio/ShortBufferImpl.java
@@ -38,100 +38,66 @@ exception statement from your version. */
package gnu.java.nio;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
+import java.nio.ByteOrder;
import java.nio.ShortBuffer;
+import java.nio.ReadOnlyBufferException;
+/**
+ * This is a Heap memory implementation
+ */
public final class ShortBufferImpl extends ShortBuffer
{
- private int array_offset;
- private boolean ro;
+ private boolean readOnly;
public ShortBufferImpl(int cap, int off, int lim)
{
- this.backing_buffer = new short[cap];
- this.cap = cap ;
- this.limit(lim);
- this.position(off);
+ super (cap, lim, off, 0);
+ this.backing_buffer = new short [cap];
+ readOnly = false;
}
- public ShortBufferImpl(short[] array, int off, int lim)
+ public ShortBufferImpl(short[] array, int offset, int length)
{
+ super (array.length, length, offset, 0);
this.backing_buffer = array;
- this.cap = array.length;
- this.limit(lim);
- this.position(off);
+ readOnly = false;
}
public ShortBufferImpl(ShortBufferImpl copy)
{
+ super (copy.capacity (), copy.limit (), copy.position (), 0);
backing_buffer = copy.backing_buffer;
- ro = copy.ro;
- limit(copy.limit());
- position(copy.position());
+ readOnly = copy.isReadOnly ();
}
- void inc_pos(int a)
+ private static native short[] nio_cast (byte[] copy);
+
+ ShortBufferImpl (byte[] copy)
{
- position(position() + a);
+ super (copy.length, copy.length, 0, 0);
+ this.backing_buffer = copy != null ? nio_cast (copy) : null;
+ readOnly = false;
+ }
+
+ private static native byte nio_get_Byte (ShortBufferImpl b, int index, int limit);
+
+ private static native void nio_put_Byte (ShortBufferImpl b, int index, int limit, byte value);
+
+ public ByteBuffer asByteBuffer ()
+ {
+ ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
+ res.limit ((limit () * 1) / 2);
+ return res;
}
-
- ShortBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native byte nio_get_Byte(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Byte(ShortBufferImpl b, int index, int limit, byte value);
- public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/2); return res; }
-
- ShortBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native char nio_get_Char(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Char(ShortBufferImpl b, int index, int limit, char value);
- public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }
-
- ShortBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native short nio_get_Short(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Short(ShortBufferImpl b, int index, int limit, short value);
- public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }
-
- ShortBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native int nio_get_Int(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Int(ShortBufferImpl b, int index, int limit, int value);
- public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }
-
- ShortBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native long nio_get_Long(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Long(ShortBufferImpl b, int index, int limit, long value);
- public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }
-
- ShortBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native float nio_get_Float(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Float(ShortBufferImpl b, int index, int limit, float value);
- public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }
-
- ShortBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; }
- private static native double nio_get_Double(ShortBufferImpl b, int index, int limit);
- private static native void nio_put_Double(ShortBufferImpl b, int index, int limit, double value);
- public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }
-
- private static native short[] nio_cast(byte[]copy);
- private static native short[] nio_cast(char[]copy);
- private static native short[] nio_cast(short[]copy);
- private static native short[] nio_cast(long[]copy);
- private static native short[] nio_cast(int[]copy);
- private static native short[] nio_cast(float[]copy);
- private static native short[] nio_cast(double[]copy);
public boolean isReadOnly()
{
- return ro;
+ return readOnly;
}
public ShortBuffer slice()
{
- ShortBufferImpl a = new ShortBufferImpl(this);
- a.array_offset = position();
- return a;
+ return new ShortBufferImpl (this);
}
public ShortBuffer duplicate()
@@ -141,9 +107,9 @@ public final class ShortBufferImpl extends ShortBuffer
public ShortBuffer asReadOnlyBuffer()
{
- ShortBufferImpl a = new ShortBufferImpl(this);
- a.ro = true;
- return a;
+ ShortBufferImpl result = new ShortBufferImpl (this);
+ result.readOnly = true;
+ return result;
}
public ShortBuffer compact()
@@ -153,7 +119,7 @@ public final class ShortBufferImpl extends ShortBuffer
public boolean isDirect()
{
- return backing_buffer != null;
+ return false;
}
final public short get()
@@ -165,6 +131,9 @@ public final class ShortBufferImpl extends ShortBuffer
final public ShortBuffer put(short b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[position()] = b;
position(position()+1);
return this;
@@ -177,14 +146,15 @@ public final class ShortBufferImpl extends ShortBuffer
final public ShortBuffer put(int index, short b)
{
+ if (readOnly)
+ throw new ReadOnlyBufferException ();
+
backing_buffer[index] = b;
return this;
}
-
- final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public ShortBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public ShortBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
- final public short getShort() { return get(); } final public ShortBuffer putShort(short value) { return put(value); } final public short getShort(int index) { return get(index); } final public ShortBuffer putShort(int index, short value) { return put(index, value); };
- final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public ShortBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public ShortBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
- final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public ShortBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public ShortBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
- final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public ShortBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public ShortBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
- final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public ShortBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public ShortBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
+
+ final public ByteOrder order ()
+ {
+ return ByteOrder.BIG_ENDIAN;
+ }
}
diff --git a/libjava/gnu/java/nio/natByteBufferImpl.cc b/libjava/gnu/java/nio/natByteBufferImpl.cc
index b98b694e87b..2bb1e41a622 100644
--- a/libjava/gnu/java/nio/natByteBufferImpl.cc
+++ b/libjava/gnu/java/nio/natByteBufferImpl.cc
@@ -1,3 +1,13 @@
+// natByteBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
diff --git a/libjava/gnu/java/nio/natCharBufferImpl.cc b/libjava/gnu/java/nio/natCharBufferImpl.cc
index 2d01a679bfa..9fb54e14561 100644
--- a/libjava/gnu/java/nio/natCharBufferImpl.cc
+++ b/libjava/gnu/java/nio/natCharBufferImpl.cc
@@ -1,3 +1,13 @@
+// natCharBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::CharBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jchar>*
-gnu::java::nio::CharBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::CharBufferImpl::nio_put_Byte(gnu::java::nio::CharBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::CharBufferImpl::nio_put_Char(gnu::java::nio::CharBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::CharBufferImpl::nio_put_Short(gnu::java::nio::CharBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::CharBufferImpl::nio_put_Int(gnu::java::nio::CharBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::CharBufferImpl::nio_put_Long(gnu::java::nio::CharBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::CharBufferImpl::nio_put_Float(gnu::java::nio::CharBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::CharBufferImpl::nio_put_Double(gnu::java::nio::CharBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::CharBufferImpl::nio_get_Byte(gnu::java::nio::CharBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::CharBufferImpl::nio_get_Char(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::CharBufferImpl::nio_get_Short(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::CharBufferImpl::nio_get_Int(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::CharBufferImpl::nio_get_Long(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::CharBufferImpl::nio_get_Float(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::CharBufferImpl::nio_get_Double(gnu::java::nio::CharBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natDoubleBufferImpl.cc b/libjava/gnu/java/nio/natDoubleBufferImpl.cc
index 53bf73db5a6..6c66a337417 100644
--- a/libjava/gnu/java/nio/natDoubleBufferImpl.cc
+++ b/libjava/gnu/java/nio/natDoubleBufferImpl.cc
@@ -1,3 +1,13 @@
+// natDoubleBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jdouble>*
-gnu::java::nio::DoubleBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::DoubleBufferImpl::nio_put_Byte(gnu::java::nio::DoubleBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Char(gnu::java::nio::DoubleBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Short(gnu::java::nio::DoubleBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Int(gnu::java::nio::DoubleBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Long(gnu::java::nio::DoubleBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Float(gnu::java::nio::DoubleBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::DoubleBufferImpl::nio_put_Double(gnu::java::nio::DoubleBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::DoubleBufferImpl::nio_get_Byte(gnu::java::nio::DoubleBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::DoubleBufferImpl::nio_get_Char(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::DoubleBufferImpl::nio_get_Short(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::DoubleBufferImpl::nio_get_Int(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::DoubleBufferImpl::nio_get_Long(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::DoubleBufferImpl::nio_get_Float(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::DoubleBufferImpl::nio_get_Double(gnu::java::nio::DoubleBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natFloatBufferImpl.cc b/libjava/gnu/java/nio/natFloatBufferImpl.cc
index 2462be539f9..9785454634c 100644
--- a/libjava/gnu/java/nio/natFloatBufferImpl.cc
+++ b/libjava/gnu/java/nio/natFloatBufferImpl.cc
@@ -1,3 +1,13 @@
+// natFloatBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jfloat>*
-gnu::java::nio::FloatBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::FloatBufferImpl::nio_put_Byte(gnu::java::nio::FloatBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Char(gnu::java::nio::FloatBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Short(gnu::java::nio::FloatBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Int(gnu::java::nio::FloatBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Long(gnu::java::nio::FloatBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Float(gnu::java::nio::FloatBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::FloatBufferImpl::nio_put_Double(gnu::java::nio::FloatBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::FloatBufferImpl::nio_get_Byte(gnu::java::nio::FloatBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::FloatBufferImpl::nio_get_Char(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::FloatBufferImpl::nio_get_Short(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::FloatBufferImpl::nio_get_Int(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::FloatBufferImpl::nio_get_Long(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::FloatBufferImpl::nio_get_Float(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::FloatBufferImpl::nio_get_Double(gnu::java::nio::FloatBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natIntBufferImpl.cc b/libjava/gnu/java/nio/natIntBufferImpl.cc
index 6a14653917e..eff70f838bb 100644
--- a/libjava/gnu/java/nio/natIntBufferImpl.cc
+++ b/libjava/gnu/java/nio/natIntBufferImpl.cc
@@ -1,3 +1,13 @@
+// natIntBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::IntBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jint>*
-gnu::java::nio::IntBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::IntBufferImpl::nio_put_Byte(gnu::java::nio::IntBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::IntBufferImpl::nio_put_Char(gnu::java::nio::IntBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::IntBufferImpl::nio_put_Short(gnu::java::nio::IntBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::IntBufferImpl::nio_put_Int(gnu::java::nio::IntBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::IntBufferImpl::nio_put_Long(gnu::java::nio::IntBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::IntBufferImpl::nio_put_Float(gnu::java::nio::IntBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::IntBufferImpl::nio_put_Double(gnu::java::nio::IntBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::IntBufferImpl::nio_get_Byte(gnu::java::nio::IntBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::IntBufferImpl::nio_get_Char(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::IntBufferImpl::nio_get_Short(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::IntBufferImpl::nio_get_Int(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::IntBufferImpl::nio_get_Long(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::IntBufferImpl::nio_get_Float(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::IntBufferImpl::nio_get_Double(gnu::java::nio::IntBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natLongBufferImpl.cc b/libjava/gnu/java/nio/natLongBufferImpl.cc
index ea21f475c61..a84248136e5 100644
--- a/libjava/gnu/java/nio/natLongBufferImpl.cc
+++ b/libjava/gnu/java/nio/natLongBufferImpl.cc
@@ -1,3 +1,13 @@
+// natLongBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::LongBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jlong>*
-gnu::java::nio::LongBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::LongBufferImpl::nio_put_Byte(gnu::java::nio::LongBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::LongBufferImpl::nio_put_Char(gnu::java::nio::LongBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::LongBufferImpl::nio_put_Short(gnu::java::nio::LongBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::LongBufferImpl::nio_put_Int(gnu::java::nio::LongBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::LongBufferImpl::nio_put_Long(gnu::java::nio::LongBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::LongBufferImpl::nio_put_Float(gnu::java::nio::LongBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::LongBufferImpl::nio_put_Double(gnu::java::nio::LongBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::LongBufferImpl::nio_get_Byte(gnu::java::nio::LongBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::LongBufferImpl::nio_get_Char(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::LongBufferImpl::nio_get_Short(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::LongBufferImpl::nio_get_Int(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::LongBufferImpl::nio_get_Long(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::LongBufferImpl::nio_get_Float(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::LongBufferImpl::nio_get_Double(gnu::java::nio::LongBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natServerSocketChannelImpl.cc b/libjava/gnu/java/nio/natServerSocketChannelImpl.cc
deleted file mode 100644
index 1f7d7fc6890..00000000000
--- a/libjava/gnu/java/nio/natServerSocketChannelImpl.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// natSelectorImpl.cc
-
-/* Copyright (C) 2002 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 <platform.h>
-
-#include <errno.h>
-#include <netinet/in.h>
-
-#include <gcj/cni.h>
-#include <gnu/java/nio/ServerSocketChannelImpl.h>
-#include <gnu/java/nio/SocketChannelImpl.h>
-#include <java/io/IOException.h>
-#include <java/net/InetSocketAddress.h>
-#include <java/net/SocketException.h>
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-jint
-gnu::java::nio::ServerSocketChannelImpl::SocketAccept (
- ServerSocketChannelImpl* socket,
- SocketChannelImpl* s)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- socklen_t addrlen = sizeof(struct sockaddr);
-/*
- jbyteArray haddress = socket->sa->getAddress ()->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons ( socket->sa->getPort ());
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (socket->sa->getPort ());
- }
-#endif
- else
- throw new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
-*/
-
- int sock = _Jv_accept (socket->fd, ptr, &addrlen);
-
- // FIXME: write address/port in ptr into java variables
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- s->fd = sock;
- return sock;
-}
diff --git a/libjava/gnu/java/nio/natShortBufferImpl.cc b/libjava/gnu/java/nio/natShortBufferImpl.cc
index bfcfe28a6e2..188bff9575e 100644
--- a/libjava/gnu/java/nio/natShortBufferImpl.cc
+++ b/libjava/gnu/java/nio/natShortBufferImpl.cc
@@ -1,3 +1,13 @@
+// natShortBufferImpl.cc
+
+/* Copyright (C) 2002, 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 <gcj/cni.h>
@@ -11,115 +21,13 @@ gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jbyte>*)
return NULL;
}
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jshort>*)
-{
- return NULL;
-}
-
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jint>*)
-{
- return NULL;
-}
-
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jlong>*)
-{
- return NULL;
-}
-
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jchar>*)
-{
- return NULL;
-}
-
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jfloat>*)
-{
- return NULL;
-}
-
-JArray<jshort>*
-gnu::java::nio::ShortBufferImpl::nio_cast(JArray<jdouble>*)
-{
- return NULL;
-}
-
void
gnu::java::nio::ShortBufferImpl::nio_put_Byte(gnu::java::nio::ShortBufferImpl*, jint, jint, jbyte)
{
}
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Char(gnu::java::nio::ShortBufferImpl*, jint, jint, jchar)
-{
-}
-
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Short(gnu::java::nio::ShortBufferImpl*, jint, jint, jshort)
-{
-}
-
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Int(gnu::java::nio::ShortBufferImpl*, jint, jint, jint)
-{
-}
-
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Long(gnu::java::nio::ShortBufferImpl*, jint, jint, jlong)
-{
-}
-
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Float(gnu::java::nio::ShortBufferImpl*, jint, jint, jfloat)
-{
-}
-
-void
-gnu::java::nio::ShortBufferImpl::nio_put_Double(gnu::java::nio::ShortBufferImpl*, jint, jint, jdouble)
-{
-}
-
jbyte
gnu::java::nio::ShortBufferImpl::nio_get_Byte(gnu::java::nio::ShortBufferImpl*, jint, jint)
{
return 0;
}
-
-jchar
-gnu::java::nio::ShortBufferImpl::nio_get_Char(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return ' ';
-}
-
-jshort
-gnu::java::nio::ShortBufferImpl::nio_get_Short(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jint
-gnu::java::nio::ShortBufferImpl::nio_get_Int(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jlong
-gnu::java::nio::ShortBufferImpl::nio_get_Long(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return 0;
-}
-
-jfloat
-gnu::java::nio::ShortBufferImpl::nio_get_Float(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return 0.0;
-}
-
-jdouble
-gnu::java::nio::ShortBufferImpl::nio_get_Double(gnu::java::nio::ShortBufferImpl*, jint, jint)
-{
- return 0.0;
-}
diff --git a/libjava/gnu/java/nio/natSocketChannelImpl.cc b/libjava/gnu/java/nio/natSocketChannelImpl.cc
index 4e6c6da3782..480cc94e35a 100644
--- a/libjava/gnu/java/nio/natSocketChannelImpl.cc
+++ b/libjava/gnu/java/nio/natSocketChannelImpl.cc
@@ -1,6 +1,6 @@
-// natSelectorImpl.cc
+// natSocketChannelImpl.cc
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -19,6 +19,62 @@ details. */
#include <java/net/InetAddress.h>
#include <java/net/SocketException.h>
+
+#ifdef DISABLE_JAVA_NET
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketCreate ()
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketCreate not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketConnect (jint,
+ ::java::net::InetAddress *,
+ jint)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketBind (jint, ::java::net::InetAddress *,
+ jint)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketListen (jint, jint)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketList not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketAvailable (jint)
+{
+ throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketClose (jint)
+{
+ throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketClose: not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketRead (jint, jbyteArray, jint, jint)
+{
+ throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketRead: not implemented"));
+}
+
+jint
+gnu::java::nio::SocketChannelImpl::SocketWrite (jint, jbyteArray, jint, jint)
+{
+ throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketWrite: not implemented"));
+}
+
+#else // DISABLE_JAVA_NET
+
jint
gnu::java::nio::SocketChannelImpl::SocketCreate ()
{
@@ -38,15 +94,7 @@ gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd,
::java::net::InetAddress *addr,
jint port)
{
- int result = _Jv_connect_address (fd, addr, port, addr, port);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
}
jint
@@ -54,15 +102,7 @@ gnu::java::nio::SocketChannelImpl::SocketBind (jint fd,
::java::net::InetAddress *addr,
jint port)
{
- int result = _Jv_bind_address (fd, addr, port);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
+ throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
}
jint
@@ -128,3 +168,5 @@ gnu::java::nio::SocketChannelImpl::SocketWrite (jint fd, jbyteArray data,
return result;
}
+
+#endif // DISABLE_JAVA_NET
diff --git a/libjava/gnu/java/security/provider/SHA1PRNG.java b/libjava/gnu/java/security/provider/SHA1PRNG.java
index 669b1b55b75..97a8b9e3433 100644
--- a/libjava/gnu/java/security/provider/SHA1PRNG.java
+++ b/libjava/gnu/java/security/provider/SHA1PRNG.java
@@ -1,5 +1,5 @@
/* SHA1PRNG.java --- Secure Random SPI SHA1PRNG
- Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,27 +51,22 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable
byte data[];
int seedpos;
int datapos;
+ private boolean seeded = false; // set to true when we seed this
public SHA1PRNG()
{
try {
digest = MessageDigest.getInstance("SHA");
} catch ( NoSuchAlgorithmException nsae) {
- System.out.println("Failed to find SHA Message Digest: " + nsae);
- nsae.printStackTrace();
+// System.out.println("Failed to find SHA Message Digest: " + nsae);
+// nsae.printStackTrace();
+ throw new InternalError ("no SHA implementation found");
}
seed = new byte[20];
seedpos = 0;
data = new byte[40];
- datapos = 0;
-
- new Random().nextBytes(seed);
-
- byte digestdata[];
- digestdata = digest.digest( data );
- System.arraycopy( digestdata, 0, data, 0, 20);
-
+ datapos = 20; // try to force hashing a first block
}
public void engineSetSeed(byte[] seed)
@@ -84,6 +79,7 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable
public void engineNextBytes(byte[] bytes)
{
+ ensureIsSeeded ();
int loc = 0;
while (loc < bytes.length)
{
@@ -113,4 +109,18 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable
engineNextBytes( tmp );
return tmp;
}
+
+ private void ensureIsSeeded()
+ {
+ if (!seeded)
+ {
+ new Random(0L).nextBytes(seed);
+
+ byte[] digestdata = digest.digest(data);
+ System.arraycopy(digestdata, 0, data, 0, 20);
+
+ seeded = true;
+ }
+ }
+
}
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index 0e1220a10b3..0aadd47d3b3 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -60,6 +60,8 @@ _Jv_platform_close_on_exec (jint fd)
::fcntl (fd, F_SETFD, FD_CLOEXEC);
}
+#undef fcntl
+
#ifdef JV_HASH_SYNCHRONIZATION
inline void
_Jv_platform_usleep (unsigned long usecs)
@@ -80,18 +82,24 @@ _Jv_socket (int domain, int type, int protocol)
return ::socket (domain, type, protocol);
}
+#undef socket
+
inline int
_Jv_connect (jint fd, sockaddr *ptr, int len)
{
return ::connect (fd, ptr, len);
}
+#undef connect
+
inline int
_Jv_close (jint fd)
{
return ::close (fd);
}
+#undef close
+
// Avoid macro definitions of bind from system headers, e.g. on
// Solaris 7 with _XOPEN_SOURCE. FIXME
inline int
@@ -100,6 +108,8 @@ _Jv_bind (int fd, struct sockaddr *addr, int addrlen)
return ::bind (fd, addr, addrlen);
}
+#undef bind
+
// Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET
inline int
_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
@@ -107,24 +117,32 @@ _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
return ::accept (fd, addr, addrlen);
}
+#undef accept
+
inline int
_Jv_listen (int fd, int backlog)
{
return ::listen (fd, backlog);
}
+#undef listen
+
inline int
_Jv_write(int s, void *buf, int len)
{
return ::write (s, buf, len);
}
+#undef write
+
inline int
_Jv_read(int s, void *buf, int len)
{
return ::read (s, buf, len);
}
+#undef read
+
#endif /* DISABLE_JAVA_NET */
#endif /* __JV_POSIX_H__ */
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 1d06df0663c..4330c79d397 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -1,6 +1,6 @@
// win32.h -- Helper functions for Microsoft-flavored OSs.
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -14,9 +14,7 @@ details. */
#include <windows.h>
#undef STRICT
-#undef __INSIDE_CYGWIN__
-#include <winsock.h>
-#define IP_TOS 3
+#include <ws2tcpip.h>
#include <gcj/cni.h>
#include <java/util/Properties.h>
@@ -74,7 +72,7 @@ _Jv_socket (int domain, int type, int protocol)
inline int
_Jv_connect (jint fd, sockaddr *ptr, int len)
{
- return ::connect (fd, ptr, len);
+ return ::connect (fd, ptr, len);
}
inline int
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
index 88218397c3c..4f41568218a 100644
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ b/libjava/java/awt/CheckboxMenuItem.java
@@ -43,6 +43,7 @@ import java.awt.peer.MenuItemPeer;
import java.awt.peer.MenuComponentPeer;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.util.EventListener;
/**
* This class implements a menu item that has a checkbox on it indicating
@@ -51,8 +52,7 @@ import java.awt.event.ItemListener;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@redhat.com>
*/
-public class CheckboxMenuItem extends MenuItem implements ItemSelectable,
- java.io.Serializable
+public class CheckboxMenuItem extends MenuItem implements ItemSelectable
{
/*
@@ -296,5 +296,29 @@ paramString()
+ "," + super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>CheckboxMenuItem</code>. FooListeners are registered using
+ * the addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns an aray of all item listeners currently registered to this
+ * <code>CheckBoxMenuItem</code>.
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class CheckboxMenuItem
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
index 4c7b505535c..cb8bb036491 100644
--- a/libjava/java/awt/Choice.java
+++ b/libjava/java/awt/Choice.java
@@ -44,6 +44,7 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.Serializable;
import java.util.Vector;
+import java.util.EventListener;
/**
* This class implements a drop down choice list.
@@ -474,4 +475,31 @@ paramString()
return ("selectedIndex=" + selectedIndex + "," + super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this Choice. FooListeners are registered using the addFooListener
+ * method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ *
+ * @since 1.3
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all registered item listeners.
+ *
+ * @since 1.4
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class Choice
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index d61db055f56..88f91810dc0 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -844,9 +844,10 @@ public abstract class Component
// Inspection by subclassing shows that Sun's implementation calls
// show(boolean) which then calls show() or hide(). It is the show()
// method that is overriden in subclasses like Window.
- if (peer != null)
- peer.setVisible(b);
- this.visible = b;
+ if (b)
+ show();
+ else
+ hide();
}
/**
@@ -856,7 +857,9 @@ public abstract class Component
*/
public void show()
{
- setVisible(true);
+ if (peer != null)
+ peer.setVisible(true);
+ this.visible = true;
}
/**
@@ -877,7 +880,9 @@ public abstract class Component
*/
public void hide()
{
- setVisible(false);
+ if (peer != null)
+ peer.setVisible(false);
+ this.visible = false;
}
/**
@@ -1448,8 +1453,10 @@ public abstract class Component
public Dimension getPreferredSize()
{
if (prefSize == null)
- prefSize = (peer != null ? peer.getPreferredSize()
- : new Dimension(width, height));
+ if (peer == null)
+ return new Dimension(width, height);
+ else
+ prefSize = peer.getPreferredSize();
return prefSize;
}
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index 9494d8c56ac..91804d7f8c9 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -728,6 +728,9 @@ public class Container extends Component
* upon this Container. FooListeners are registered using the addFooListener
* method.
*
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements @see java.util.EventListener.
+ *
* @since 1.3
*/
public EventListener[] getListeners(Class listenerType)
@@ -994,15 +997,48 @@ public class Container extends Component
}
}
- public void setFocusTraversalKeys(int id, Set keys)
+ /**
+ * Sets the focus traversal keys for a given traversal operation for this
+ * Container.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS,
+ * or if keystrokes contains null, or if any Object in keystrokes is not an
+ * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, or if any
+ * keystroke already maps to another focus traversal operation for this
+ * Container.
+ *
+ * @since 1.4
+ */
+ public void setFocusTraversalKeys(int id, Set keystrokes)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
throw new IllegalArgumentException ();
+
+ if (keystrokes == null)
+ throw new IllegalArgumentException ();
+
+ throw new Error ("not implemented");
}
+ /**
+ * Returns the Set of focus traversal keys for a given traversal operation for
+ * this Container.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
+ *
+ * @since 1.4
+ */
public Set getFocusTraversalKeys(int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
@@ -1014,6 +1050,20 @@ public class Container extends Component
return null;
}
+ /**
+ * Returns whether the Set of focus traversal keys for the given focus
+ * traversal operation has been explicitly defined for this Container.
+ * If this method returns false, this Container is inheriting the Set from
+ * an ancestor, or from the current KeyboardFocusManager.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
+ *
+ * @since 1.4
+ */
public boolean areFocusTraversalKeysSet(int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
@@ -1060,8 +1110,16 @@ public class Container extends Component
public void transferFocusDownCycle()
{
}
-
- public void applyComponentOrientation(ComponentOrientation o)
+
+ /**
+ * Sets the ComponentOrientation property of this container and all components
+ * contained within it.
+ *
+ * @exception NullPointerException If orientation is null
+ *
+ * @since 1.4
+ */
+ public void applyComponentOrientation (ComponentOrientation orientation)
{
if (orientation == null)
throw new NullPointerException ();
diff --git a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
index e3cf31cb111..71267a579f0 100644
--- a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
+++ b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
@@ -48,8 +48,11 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
{
static final long serialVersionUID = 486933713763926351L;
- private boolean downCycle = true;
+ private boolean implicitDownCycleTraversal = true;
+ /**
+ * Creates the <code>ContainerOrderFocusTraversalPolicy</code> object.
+ */
public ContainerOrderFocusTraversalPolicy()
{
throw new Error("not implemented");
@@ -82,17 +85,19 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
public void setImplicitDownCycleTraversal(boolean value)
{
- downCycle = value;
+ boolean implicitDownCycleTraversal = value;
}
public boolean getImplicitDownCycleTraversal()
{
- return downCycle;
+ return implicitDownCycleTraversal;
}
protected boolean accept(Component current)
{
- return current.visible && current.isDisplayable() && current.enabled
- && current.focusable;
+ return (current.visible
+ && current.isDisplayable()
+ && current.enabled
+ && current.focusable);
}
} // class ContainerOrderFocusTraversalPolicy
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index 471826c4b1b..9aa2ea6f346 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -49,7 +49,7 @@ import java.awt.peer.ComponentPeer;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@redhat.com>
*/
-public class Dialog extends Window implements java.io.Serializable
+public class Dialog extends Window
{
/*
@@ -92,6 +92,10 @@ private String title;
* parent, that is not resizable and not modal, and which has no title.
*
* @param parent The parent frame of this dialog box.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent)
@@ -108,6 +112,10 @@ Dialog(Frame parent)
* @param parent The parent frame of this dialog box.
* @param modal <true> if this dialog box is modal, <code>false</code>
* otherwise.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent, boolean modal)
@@ -124,6 +132,10 @@ Dialog(Frame parent, boolean modal)
*
* @param parent The parent frame of this dialog box.
* @param title The title string for this dialog box.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent, String title)
@@ -160,12 +172,30 @@ Dialog (Dialog owner)
this (owner, "", false);
}
+/**
+ * Initializes a new instance of <code>Dialog</code> with the specified,
+ * parent and title, that is not resizable.
+ *
+ * @exception IllegalArgumentException If parent is null. This exception is
+ * always thrown when GraphicsEnvironment.isHeadless() returns true.
+ *
+ * @since 1.2
+ */
public
Dialog (Dialog owner, String title)
{
this (owner, title, false);
}
+/**
+ * Initializes a new instance of <code>Dialog</code> with the specified,
+ * parent, title and modality, that is not resizable.
+ *
+ * @exception IllegalArgumentException If parent is null. This exception is
+ * always thrown when GraphicsEnvironment.isHeadless() returns true.
+ *
+ * @since 1.2
+ */
public
Dialog (Dialog owner, String title, boolean modal)
{
diff --git a/libjava/java/awt/FlowLayout.java b/libjava/java/awt/FlowLayout.java
index 1f9465e4bf9..795dfd8e61f 100644
--- a/libjava/java/awt/FlowLayout.java
+++ b/libjava/java/awt/FlowLayout.java
@@ -171,13 +171,13 @@ public class FlowLayout implements LayoutManager, Serializable
int new_h = 0;
int j;
boolean found_one = false;
- for (j = i; j < num && ! found_one; ++j)
+ for (j = i; j < num; ++j)
{
// Skip invisible items.
- if (! comps[i].visible)
+ if (! comps[j].visible)
continue;
- Dimension c = comps[i].getPreferredSize ();
+ Dimension c = comps[j].getPreferredSize ();
int next_w = new_w + hgap + c.width;
if (next_w <= d.width || ! found_one)
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index 730a7003e59..3723a4528ed 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt;
import java.awt.peer.FontPeer;
+import java.io.Serializable;
import java.util.StringTokenizer;
/**
@@ -47,7 +48,7 @@ import java.util.StringTokenizer;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy <warrenl@cygnus.com>
*/
-public class Font implements java.io.Serializable
+public class Font implements Serializable
{
/*
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
index a25af9c5546..8c08a2e9b7b 100644
--- a/libjava/java/awt/Frame.java
+++ b/libjava/java/awt/Frame.java
@@ -42,7 +42,6 @@ import java.awt.peer.FramePeer;
import java.awt.peer.WindowPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;
@@ -52,7 +51,7 @@ import java.util.Vector;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Frame extends Window implements MenuContainer, Serializable
+public class Frame extends Window implements MenuContainer
{
/*
diff --git a/libjava/java/awt/Graphics.java b/libjava/java/awt/Graphics.java
index 1080119c39f..1b4581b64f0 100644
--- a/libjava/java/awt/Graphics.java
+++ b/libjava/java/awt/Graphics.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt;
import java.awt.image.ImageObserver;
+import java.text.AttributedCharacterIterator;
/**
* This is the abstract superclass of classes for drawing to graphics
@@ -595,6 +596,8 @@ fillPolygon(Polygon polygon)
public abstract void
drawString(String string, int x, int y);
+public abstract void drawString (AttributedCharacterIterator ci, int x, int y);
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/Graphics2D.java b/libjava/java/awt/Graphics2D.java
index ed80936bfcb..b35f08aa821 100644
--- a/libjava/java/awt/Graphics2D.java
+++ b/libjava/java/awt/Graphics2D.java
@@ -36,6 +36,8 @@ exception statement from your version. */
package java.awt;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
@@ -151,5 +153,7 @@ public abstract class Graphics2D extends Graphics
public abstract void clip(Shape s);
- // public abstract FontRenderContext getFontRenderContext();
+ public abstract FontRenderContext getFontRenderContext ();
+
+ public abstract void drawGlyphVector (GlyphVector g, float x, float y);
}
diff --git a/libjava/java/awt/GridBagConstraints.java b/libjava/java/awt/GridBagConstraints.java
index 57356ad8ef7..651cfdc1999 100644
--- a/libjava/java/awt/GridBagConstraints.java
+++ b/libjava/java/awt/GridBagConstraints.java
@@ -80,6 +80,52 @@ public class GridBagConstraints implements Cloneable, Serializable
/** Occupy all remaining cells. */
public static final int REMAINDER = 0;
+ /**
+ * Position to where the first text line would end. Equals to NORTHEAST for
+ * horizontal left-to-right orientations.
+ */
+ public static final int FIRST_LINE_END = 24;
+
+ /**
+ * Position to where the first text line would start. Equals to NORTHWEST for
+ * horizontal left-to-right orientations.
+ */
+ public static final int FIRST_LINE_START = 23;
+
+ /**
+ * Position to where the last text line would end. Equals to SOUTHEAST for
+ * horizontal left-to-right orientations.
+ */
+ public static final int LAST_LINE_END = 26;
+
+ /**
+ * Position to where the last text line would start. Equals to SOUTHWEST for
+ * horizontal left-to-right orientations.
+ */
+ public static final int LAST_LINE_START = 25;
+
+ /**
+ * Position to where a text line would end. Equals to EAST for
+ * left-to-right orientations.
+ */
+ public static final int LINE_END = 22;
+
+ /**
+ * Position to where a text line would start. Equals to WEST for
+ * left-to-right orientations.
+ */
+ public static final int LINE_START = 21;
+
+ /**
+ * Position to where a page ends. Equals SOUTH for horizontal orientations.
+ */
+ public static final int PAGE_END = 20;
+
+ /**
+ * Position to where a page starts. Equals NORTH for horizontal orientations.
+ */
+ public static final int PAGE_START = 19;
+
public int anchor;
public int fill;
public int gridheight;
diff --git a/libjava/java/awt/KeyboardFocusManager.java b/libjava/java/awt/KeyboardFocusManager.java
index 2680894b8df..867316ba843 100644
--- a/libjava/java/awt/KeyboardFocusManager.java
+++ b/libjava/java/awt/KeyboardFocusManager.java
@@ -386,7 +386,7 @@ public abstract class KeyboardFocusManager
return focusCycleRoot;
}
- protected void setGlobalCurrentFocusCycleRoot(Container cycleRoot)
+ public void setGlobalCurrentFocusCycleRoot(Container cycleRoot)
{
firePropertyChange("currentFocusCycleRoot", focusCycleRoot, cycleRoot);
focusCycleRoot = cycleRoot;
diff --git a/libjava/java/awt/Label.java b/libjava/java/awt/Label.java
index 4f248c30bb9..47f6733da16 100644
--- a/libjava/java/awt/Label.java
+++ b/libjava/java/awt/Label.java
@@ -40,7 +40,6 @@ package java.awt;
import java.awt.peer.LabelPeer;
import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
import javax.accessibility.Accessible;
/**
@@ -50,7 +49,7 @@ import javax.accessibility.Accessible;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@cygnus.com>
*/
-public class Label extends Component implements Serializable, Accessible
+public class Label extends Component implements Accessible
{
/*
@@ -225,7 +224,7 @@ setText(String text)
/*************************************************************************/
/**
- * Notifies this lable that it has been added to a container, causing
+ * Notifies this label that it has been added to a container, causing
* the peer to be created. This method is called internally by the AWT
* system.
*/
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
index 561a30d4dab..9e59041f781 100644
--- a/libjava/java/awt/List.java
+++ b/libjava/java/awt/List.java
@@ -45,6 +45,7 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.peer.ListPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
import java.util.Vector;
import javax.accessibility.Accessible;
@@ -54,7 +55,7 @@ import javax.accessibility.Accessible;
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class List extends Component
- implements ItemSelectable, Serializable, Accessible
+ implements ItemSelectable, Accessible
{
/*
@@ -1030,4 +1031,38 @@ paramString()
return "multiple=" + multipleMode + ",rows=" + rows + super.paramString();
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>List</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ActionListener.class)
+ return AWTEventMulticaster.getListeners (action_listeners, listenerType);
+
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all action listeners registered to this object.
+ */
+ public ActionListener[] getActionListeners ()
+ {
+ return (ActionListener[]) getListeners (ActionListener.class);
+ }
+
+ /**
+ * Returns all action listeners registered to this object.
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class List
diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java
index 326101b76e5..2ca9467e2b1 100644
--- a/libjava/java/awt/Menu.java
+++ b/libjava/java/awt/Menu.java
@@ -175,6 +175,18 @@ getItemCount()
{
return(items.size());
}
+
+/**
+ * Returns the number of items in this menu.
+ *
+ * @return The number of items in this menu.
+ *
+ * @deprecated As of JDK 1.1, replaced by getItemCount().
+ */
+public int countItems ()
+{
+ return getItemCount ();
+}
/*************************************************************************/
diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java
index 548aa77937a..09c25c9d1af 100644
--- a/libjava/java/awt/MenuComponent.java
+++ b/libjava/java/awt/MenuComponent.java
@@ -95,7 +95,7 @@ private static transient Toolkit toolkit = Toolkit.getDefaultToolkit();
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/
-protected
+public
MenuComponent()
{
if (GraphicsEnvironment.isHeadless())
diff --git a/libjava/java/awt/PopupMenu.java b/libjava/java/awt/PopupMenu.java
index d0f1980472b..75e565d3e9b 100644
--- a/libjava/java/awt/PopupMenu.java
+++ b/libjava/java/awt/PopupMenu.java
@@ -47,7 +47,7 @@ import java.awt.peer.MenuComponentPeer;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class PopupMenu extends Menu implements java.io.Serializable
+public class PopupMenu extends Menu
{
/*
diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java
index 045600cddf2..9b8b82a9a95 100644
--- a/libjava/java/awt/ScrollPane.java
+++ b/libjava/java/awt/ScrollPane.java
@@ -41,7 +41,6 @@ package java.awt;
import java.awt.peer.ScrollPanePeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
import javax.accessibility.Accessible;
/**
@@ -50,7 +49,7 @@ import javax.accessibility.Accessible;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class ScrollPane extends Container implements Accessible, Serializable
+public class ScrollPane extends Container implements Accessible
{
/*
diff --git a/libjava/java/awt/ScrollPaneAdjustable.java b/libjava/java/awt/ScrollPaneAdjustable.java
index 62cfefc1f9a..152f4d6e554 100644
--- a/libjava/java/awt/ScrollPaneAdjustable.java
+++ b/libjava/java/awt/ScrollPaneAdjustable.java
@@ -39,34 +39,28 @@ exception statement from your version. */
package java.awt;
/**
- * Need this class since the serialization spec for ScrollPane
- * uses it.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
+ * Need this class since the serialization spec for ScrollPane
+ * uses it.
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ */
class ScrollPaneAdjustable extends Scrollbar
{
+ public ScrollPaneAdjustable (int orientation)
+ {
+ super (orientation);
+ }
-public
-ScrollPaneAdjustable(int orientation)
-{
- super(orientation);
-}
-
-public void
-setMaximum(int maximum)
-{
-}
+ public void setMaximum (int maximum)
+ {
+ }
-public void
-setMinimum(int minimum)
-{
-}
-
-public void
-setVisibleAmount(int visibleAmount)
-{
-}
+ public void setMinimum (int minimum)
+ {
+ }
+ public void setVisibleAmount (int visibleAmount)
+ {
+ }
} // class ScrollPaneAdjustable
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
index 4bdc3166ad9..b9a81a53b0f 100644
--- a/libjava/java/awt/Scrollbar.java
+++ b/libjava/java/awt/Scrollbar.java
@@ -42,7 +42,7 @@ import java.awt.peer.ScrollbarPeer;
import java.awt.peer.ComponentPeer;
import java.awt.event.AdjustmentListener;
import java.awt.event.AdjustmentEvent;
-import java.io.Serializable;
+import java.util.EventListener;
import javax.accessibility.Accessible;
/**
@@ -52,8 +52,7 @@ import javax.accessibility.Accessible;
* @author Tom Tromey <tromey@cygnus.com>
*/
public class Scrollbar extends Component implements Accessible,
- Adjustable,
- Serializable
+ Adjustable
{
// FIXME: Serialization readObject/writeObject
@@ -391,8 +390,8 @@ setValues(int value, int visibleAmount, int minimum, int maximum)
if (value > maximum)
value = maximum;
- if (visibleAmount > value)
- visibleAmount = value;
+ if (visibleAmount > maximum - minimum)
+ visibleAmount = maximum - minimum;
this.value = value;
this.visibleAmount = visibleAmount;
@@ -665,6 +664,7 @@ processEvent(AWTEvent event)
protected void
processAdjustmentEvent(AdjustmentEvent event)
{
+ value = event.getValue();
if (adjustment_listeners != null)
adjustment_listeners.adjustmentValueChanged(event);
}
@@ -701,5 +701,29 @@ paramString()
+ super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>Scrollbar</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == AdjustmentListener.class)
+ return AWTEventMulticaster.getListeners (adjustment_listeners,
+ listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns an array of all registered adjustment listeners.
+ */
+ public AdjustmentListener[] getAdjustmentListeners ()
+ {
+ return (AdjustmentListener[]) getListeners (AdjustmentListener.class);
+ }
} // class Scrollbar
diff --git a/libjava/java/awt/TextArea.java b/libjava/java/awt/TextArea.java
index f164add49a1..ec87f87d491 100644
--- a/libjava/java/awt/TextArea.java
+++ b/libjava/java/awt/TextArea.java
@@ -370,7 +370,11 @@ getPreferredSize(int rows, int columns)
{
TextAreaPeer tap = (TextAreaPeer)getPeer();
if (tap == null)
- return(null); // FIXME: What do we do if there is no peer?
+ {
+ // Sun's JDK just seems to return Dimension(0,0) in this case.
+ // we do the same.
+ return new Dimension(0, 0);
+ }
return(tap.getPreferredSize(rows, columns));
}
@@ -404,7 +408,7 @@ preferredSize()
* <code>getPreferredSize(int)</code>.
*/
public Dimension
-preferredSize(int columns)
+preferredSize(int rows, int columns)
{
return(getPreferredSize(rows, columns));
}
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
index 6dc904cc8b1..cbe7dc9169d 100644
--- a/libjava/java/awt/TextComponent.java
+++ b/libjava/java/awt/TextComponent.java
@@ -42,6 +42,7 @@ import java.awt.event.TextEvent;
import java.awt.event.TextListener;
import java.awt.peer.TextComponentPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
/**
* This class provides common functionality for widgets than
@@ -442,5 +443,28 @@ paramString()
return(getClass().getName() + "(text=" + getText() + ")");
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>TextComponent</code>. FooListeners are registered using
+ * the addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == TextListener.class)
+ return AWTEventMulticaster.getListeners (textListener, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all text listeners registered to this object.
+ */
+ public TextListener[] getTextListeners ()
+ {
+ return (TextListener[]) getListeners (TextListener.class);
+ }
} // class TextComponent
diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java
index 0106d77e3ad..13275e3104a 100644
--- a/libjava/java/awt/TextField.java
+++ b/libjava/java/awt/TextField.java
@@ -43,13 +43,14 @@ import java.awt.event.ActionListener;
import java.awt.peer.TextFieldPeer;
import java.awt.peer.TextComponentPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
/**
* This class implements a single line text entry field widget
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class TextField extends TextComponent implements java.io.Serializable
+public class TextField extends TextComponent
{
/*
@@ -344,8 +345,9 @@ getPreferredSize(int columns)
{
TextFieldPeer tfp = (TextFieldPeer)getPeer();
if (tfp == null)
- return(null); // FIXME: What do we do if there is no peer?
-
+ {
+ return new Dimension(0, 0);
+ }
return(tfp.getPreferredSize(columns));
}
@@ -489,4 +491,32 @@ paramString()
getEchoChar());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>TextField</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ *
+ * @since 1.3
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ActionListener.class)
+ return AWTEventMulticaster.getListeners (action_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Return all ActionListeners register to this <code>TextField</code> object
+ * as an array.
+ *
+ * @since 1.4
+ */
+ public ActionListener[] getActionListeners ()
+ {
+ return (ActionListener[]) getListeners (ActionListener.class);
+ }
} // class TextField
diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java
index 225ef5b0edb..7fc3ac0e164 100644
--- a/libjava/java/awt/Toolkit.java
+++ b/libjava/java/awt/Toolkit.java
@@ -134,6 +134,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>TextField</code>.
*
* @param target The <code>TextField</code> to create the peer for.
+ *
* @return The peer for the specified <code>TextField</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -144,6 +145,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Label</code>.
*
* @param target The <code>Label</code> to create the peer for.
+ *
* @return The peer for the specified <code>Label</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -154,6 +156,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>List</code>.
*
* @param target The <code>List</code> to create the peer for.
+ *
* @return The peer for the specified <code>List</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -164,6 +167,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Checkbox</code>.
*
* @param target The <code>Checkbox</code> to create the peer for.
+ *
* @return The peer for the specified <code>Checkbox</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -174,6 +178,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Scrollbar</code>.
*
* @param target The <code>Scrollbar</code> to create the peer for.
+ *
* @return The peer for the specified <code>Scrollbar</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -184,6 +189,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>ScrollPane</code>.
*
* @param target The <code>ScrollPane</code> to create the peer for.
+ *
* @return The peer for the specified <code>ScrollPane</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -194,6 +200,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>TextArea</code>.
*
* @param target The <code>TextArea</code> to create the peer for.
+ *
* @return The peer for the specified <code>TextArea</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -204,6 +211,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Choice</code>.
*
* @param target The <code>Choice</code> to create the peer for.
+ *
* @return The peer for the specified <code>Choice</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -214,6 +222,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Frame</code>.
*
* @param target The <code>Frame</code> to create the peer for.
+ *
* @return The peer for the specified <code>Frame</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -224,6 +233,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Canvas</code>.
*
* @param target The <code>Canvas</code> to create the peer for.
+ *
* @return The peer for the specified <code>Canvas</code> object.
*/
protected abstract CanvasPeer createCanvas(Canvas target);
@@ -232,6 +242,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Panel</code>.
*
* @param target The <code>Panel</code> to create the peer for.
+ *
* @return The peer for the specified <code>Panel</code> object.
*/
protected abstract PanelPeer createPanel(Panel target);
@@ -240,6 +251,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Window</code>.
*
* @param target The <code>Window</code> to create the peer for.
+ *
* @return The peer for the specified <code>Window</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -250,6 +262,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Dialog</code>.
*
* @param target The dialog to create the peer for
+ *
* @return The peer for the specified font name.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -260,6 +273,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>MenuBar</code>.
*
* @param target The <code>MenuBar</code> to create the peer for.
+ *
* @return The peer for the specified <code>MenuBar</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -270,6 +284,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Menu</code>.
*
* @param target The <code>Menu</code> to create the peer for.
+ *
* @return The peer for the specified <code>Menu</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -280,6 +295,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>PopupMenu</code>.
*
* @param target The <code>PopupMenu</code> to create the peer for.
+ *
* @return The peer for the specified <code>PopupMenu</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -290,6 +306,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>MenuItem</code>.
*
* @param target The <code>MenuItem</code> to create the peer for.
+ *
* @return The peer for the specified <code>MenuItem</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -300,6 +317,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>FileDialog</code>.
*
* @param target The <code>FileDialog</code> to create the peer for.
+ *
* @return The peer for the specified <code>FileDialog</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -310,6 +328,7 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>CheckboxMenuItem</code>.
*
* @param target The <code>CheckboxMenuItem</code> to create the peer for.
+ *
* @return The peer for the specified <code>CheckboxMenuItem</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
@@ -326,6 +345,7 @@ public abstract class Toolkit
* XXX: FIXME
*
* @param target The <code>Component</code> to create the peer for.
+ *
* @return The peer for the specified <code>Component</code> object.
*/
protected LightweightPeer createComponent(Component target)
@@ -338,7 +358,10 @@ public abstract class Toolkit
*
* @param name The font to create the peer for.
* @param style The font style to create the peer for.
+ *
* @return The peer for the specified font name.
+ *
+ * @deprecated
*/
protected abstract FontPeer getFontPeer(String name, int style);
@@ -416,6 +439,8 @@ public abstract class Toolkit
* Returns the color model of the screen.
*
* @return The color model of the screen.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/
public abstract ColorModel getColorModel();
@@ -430,6 +455,7 @@ public abstract class Toolkit
* Return the font metrics for the specified font
*
* @param name The name of the font to return metrics for.
+ *
* @return The requested font metrics.
*/
public abstract FontMetrics getFontMetrics(Font name);
@@ -647,6 +673,7 @@ public abstract class Toolkit
* component.
*
* @param component The component to fetch the native container for.
+ *
* @return The native container object for this component.
*/
protected static Container getNativeContainer(Component component)
@@ -700,7 +727,7 @@ public abstract class Toolkit
* default value if the property does not exist.
*
* @param key The name of the property to retrieve.
- * @param defThe default value of the property.
+ * @param def The default value of the property.
*/
public static String getProperty(String key, String def)
{
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index dbfe92c71b8..805152e5405 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -39,7 +39,9 @@ exception statement from your version. */
package java.awt;
import java.awt.event.WindowEvent;
+import java.awt.event.WindowFocusListener;
import java.awt.event.WindowListener;
+import java.awt.event.WindowStateListener;
import java.awt.peer.WindowPeer;
import java.awt.peer.ComponentPeer;
import java.util.EventListener;
@@ -61,6 +63,8 @@ public class Window extends Container
private int windowSerializedDataVersion = 0; // FIXME
private transient WindowListener windowListener;
+ private transient WindowFocusListener windowFocusListener;
+ private transient WindowStateListener windowStateListener;
private transient GraphicsConfiguration graphicsConfiguration;
/**
@@ -381,6 +385,68 @@ public class Window extends Container
}
/**
+ * Returns an array of all the window focus listeners registered on this
+ * window.
+ *
+ * @since 1.4
+ */
+ public synchronized WindowFocusListener[] getWindowFocusListeners()
+ {
+ return (WindowFocusListener[])
+ AWTEventMulticaster.getListeners(windowFocusListener,
+ WindowFocusListener.class);
+ }
+
+ /**
+ * Returns an array of all the window state listeners registered on this
+ * window.
+ *
+ * @since 1.4
+ */
+ public synchronized WindowStateListener[] getWindowStateListeners()
+ {
+ return (WindowStateListener[])
+ AWTEventMulticaster.getListeners(windowStateListener,
+ WindowStateListener.class);
+ }
+
+ /**
+ * Adds the specified listener to this window.
+ */
+ public void addWindowFocusListener (WindowFocusListener wfl)
+ {
+ AWTEventMulticaster.add (windowFocusListener, wfl);
+ }
+
+ /**
+ * Adds the specified listener to this window.
+ *
+ * @since 1.4
+ */
+ public void addWindowStateListener (WindowStateListener wsl)
+ {
+ AWTEventMulticaster.add (windowStateListener, wsl);
+ }
+
+ /**
+ * Removes the specified listener from this window.
+ */
+ public void removeWindowFocusListener (WindowFocusListener wfl)
+ {
+ AWTEventMulticaster.remove (windowFocusListener, wfl);
+ }
+
+ /**
+ * Removes the specified listener from this window.
+ *
+ * @since 1.4
+ */
+ public void removeWindowStateListener (WindowStateListener wsl)
+ {
+ AWTEventMulticaster.remove (windowStateListener, wsl);
+ }
+
+ /**
* Returns an array of all the objects currently registered as FooListeners
* upon this Window. FooListeners are registered using the addFooListener
* method.
diff --git a/libjava/java/awt/color/ICC_ColorSpace.java b/libjava/java/awt/color/ICC_ColorSpace.java
index 2b7016742c9..2ed247f52b0 100644
--- a/libjava/java/awt/color/ICC_ColorSpace.java
+++ b/libjava/java/awt/color/ICC_ColorSpace.java
@@ -143,6 +143,13 @@ public class ICC_ColorSpace extends ColorSpace
throw new UnsupportedOperationException();
}
+ /**
+ * Transforms a color value assumed to be in the CS_CIEXYZ conversion color
+ * space into this ColorSpace.
+ *
+ * @exception ArrayIndexOutOfBoundsException If array length is not at
+ * least 3.
+ */
public float[] fromCIEXYZ(float[] colorvalue)
{
// FIXME: Not implemented
@@ -150,6 +157,12 @@ public class ICC_ColorSpace extends ColorSpace
}
/**
+ * Returns the minimum normalized color component value for the specified
+ * component.
+ *
+ * @exception IllegalArgumentException If component is less than 0 or greater
+ * than numComponents - 1.
+ *
* @since 1.4
*/
public float getMinValue(int idx)
@@ -162,6 +175,12 @@ public class ICC_ColorSpace extends ColorSpace
}
/**
+ * Returns the maximum normalized color component value for the specified
+ * component.
+ *
+ * @exception IllegalArgumentException If component is less than 0 or greater
+ * than numComponents - 1.
+ *
* @since 1.4
*/
public float getMaxValue(int idx)
diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java
index e1500a7926c..7239adde772 100644
--- a/libjava/java/awt/datatransfer/DataFlavor.java
+++ b/libjava/java/awt/datatransfer/DataFlavor.java
@@ -47,6 +47,8 @@ import java.io.ObjectInput;
import java.io.Reader;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
/**
* This class represents a particular data format used for transferring
@@ -508,7 +510,7 @@ setHumanPresentableName(String humanPresentableName)
*
* @exception NullPointerException If mimeType is null.
*/
-public final boolean
+public boolean
isMimeTypeEqual(String mimeType)
{
// FIXME: Need to handle default attributes and parameters
@@ -660,8 +662,7 @@ isFlavorJavaFileListType()
* the Cloneable interface. Subclasses that override the clone method can also
* throw this exception to indicate that an instance cannot be cloned.
*/
-public Object
-clone()
+public Object clone () throws CloneNotSupportedException
{
try
{
@@ -975,10 +976,8 @@ selectBestTextFlavor(DataFlavor[] availableFlavors)
* @exception UnsupportedEncodingException if the "charset" isn't supported
* on this platform.
*/
-public Reader
-getReaderForText(Transferable transferable) throws UnsupportedFlavorException,
- IOException,
- UnsupportedEncodingException
+public Reader getReaderForText(Transferable transferable)
+ throws UnsupportedFlavorException, IOException
{
if (!transferable.isDataFlavorSupported(this))
throw new UnsupportedFlavorException(this);
@@ -1002,5 +1001,38 @@ getReaderForText(Transferable transferable) throws UnsupportedFlavorException,
throw new UnsupportedFlavorException(this);
}
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.nio.ByteBuffer or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassByteBuffer ()
+ {
+ return ByteBuffer.class.isAssignableFrom (representationClass);
+ }
+
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.nio.CharBuffer or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassCharBuffer ()
+ {
+ return CharBuffer.class.isAssignableFrom (representationClass);
+ }
+
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.io.Reader or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassReader ()
+ {
+ return Reader.class.isAssignableFrom (representationClass);
+ }
+
} // class DataFlavor
diff --git a/libjava/java/awt/dnd/DragSourceContext.java b/libjava/java/awt/dnd/DragSourceContext.java
index ca26b941b3e..45191d24365 100644
--- a/libjava/java/awt/dnd/DragSourceContext.java
+++ b/libjava/java/awt/dnd/DragSourceContext.java
@@ -92,7 +92,13 @@ public class DragSourceContext
return null;
}
- public void addDragSourceListener(DragSourceListener l)
+ /**
+ * Adds a <code>DragSourceListener</code>.
+ *
+ * @exception TooManyListenersException If a <code>DragSourceListener</code>
+ * has already been added.
+ */
+ public void addDragSourceListener (DragSourceListener dsl)
throws TooManyListenersException
{
}
diff --git a/libjava/java/awt/dnd/DragSourceDragEvent.java b/libjava/java/awt/dnd/DragSourceDragEvent.java
index 0a1d759e986..6417492f89e 100644
--- a/libjava/java/awt/dnd/DragSourceDragEvent.java
+++ b/libjava/java/awt/dnd/DragSourceDragEvent.java
@@ -41,10 +41,16 @@ package java.awt.dnd;
import gnu.java.awt.EventModifier;
/**
- * STUBBED
+ * @author Michael Koch
+ * @since 1.2
*/
public class DragSourceDragEvent extends DragSourceEvent
{
+ /**
+ * Compatible with JDK 1.2+
+ */
+ private static final long serialVersionUID = 481346297933902471L;
+
private final int dropAction;
private final int targetActions;
private final int gestureModifiers;
@@ -89,7 +95,8 @@ public class DragSourceDragEvent extends DragSourceEvent
public int getDropAction()
{
- return dropAction & targetActions
- & ((DragSourceContext) source).getSourceActions();
+ return (dropAction
+ & targetActions
+ & ((DragSourceContext) source).getSourceActions());
}
} // class DragSourceDragEvent
diff --git a/libjava/java/awt/dnd/DragSourceDropEvent.java b/libjava/java/awt/dnd/DragSourceDropEvent.java
index 4b70d1bf0b0..a645814f160 100644
--- a/libjava/java/awt/dnd/DragSourceDropEvent.java
+++ b/libjava/java/awt/dnd/DragSourceDropEvent.java
@@ -46,30 +46,35 @@ package java.awt.dnd;
*/
public class DragSourceDropEvent extends DragSourceEvent
{
+ /**
+ * Compatible with JDK 1.2+
+ */
+ private static final long serialVersionUID = -5571321229470821891L;
+
private final int dropAction;
- private final boolean success;
+ private final boolean dropSuccess;
public DragSourceDropEvent (DragSourceContext context)
{
super (context);
this.dropAction = 0;
- this.success = false;
+ this.dropSuccess = false;
}
public DragSourceDropEvent (DragSourceContext context, int dropAction,
- boolean success)
+ boolean dropSuccess)
{
super (context);
this.dropAction = dropAction;
- this.success = success;
+ this.dropSuccess = dropSuccess;
}
public DragSourceDropEvent (DragSourceContext context, int dropAction,
- boolean success, int x, int y)
+ boolean dropSuccess, int x, int y)
{
super (context, x, y);
this.dropAction = dropAction;
- this.success = success;
+ this.dropSuccess = dropSuccess;
}
public int getDropAction()
@@ -79,6 +84,6 @@ public class DragSourceDropEvent extends DragSourceEvent
public boolean getDropSuccess()
{
- return success;
+ return dropSuccess;
}
} // class DragSourceDropEvent
diff --git a/libjava/java/awt/dnd/DragSourceEvent.java b/libjava/java/awt/dnd/DragSourceEvent.java
index 9d5b00bf9eb..60f6eb2f295 100644
--- a/libjava/java/awt/dnd/DragSourceEvent.java
+++ b/libjava/java/awt/dnd/DragSourceEvent.java
@@ -41,8 +41,16 @@ package java.awt.dnd;
import java.awt.Point;
import java.util.EventObject;
+/**
+ * @since 1.2
+ */
public class DragSourceEvent extends EventObject
{
+ /**
+ * Compatible with JDK 1.2+
+ */
+ private static final long serialVersionUID = -763287114604032641L;
+
private final boolean locationSpecified;
private final int x;
private final int y;
diff --git a/libjava/java/awt/dnd/DropTarget.java b/libjava/java/awt/dnd/DropTarget.java
index 53c09178d32..09c642cf54f 100644
--- a/libjava/java/awt/dnd/DropTarget.java
+++ b/libjava/java/awt/dnd/DropTarget.java
@@ -50,6 +50,11 @@ import java.util.TooManyListenersException;
public class DropTarget
implements DropTargetListener, EventListener, Serializable
{
+ /**
+ * Compatible with JDK 1.2+
+ */
+ private static final long serialVersionUID = -6283860791671019047L;
+
protected static class DropTargetAutoScroller
implements ActionListener
{
@@ -74,64 +79,85 @@ public class DropTarget
private boolean isActive = false;
/**
- * FIXME
+ * Creates a <code>DropTarget</code> object.
*
- * @exception HeadlessException FIXME
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public DropTarget ()
{
+ this (null, 0, null, true, null);
}
/**
- * FIXME
+ * Creates a <code>DropTarget</code> object.
*
- * @exception HeadlessException FIXME
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public DropTarget (Component c, DropTargetListener dtl)
{
+ this (c, 0, dtl, true, null);
}
/**
- * FIXME
+ * Creates a <code>DropTarget</code> object.
*
- * @exception HeadlessException FIXME
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public DropTarget (Component c, int i, DropTargetListener dtl)
{
+ this (c, i, dtl, true, null);
}
/**
- * FIXME
+ * Creates a <code>DropTarget</code> object.
*
- * @exception HeadlessException FIXME
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public DropTarget (Component c, int i, DropTargetListener dtl, boolean b)
{
+ this (c, i, dtl, b, null);
}
/**
- * FIXME
+ * Creates a <code>DropTarget</code> object.
*
- * @exception HeadlessException FIXME
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public DropTarget (Component c, int i, DropTargetListener dtl, boolean b,
- FlavorMap fm)
+ FlavorMap fm)
{
}
+ /**
+ * Sets the component associated with this drop target object.
+ */
public void setComponent (Component c)
{
}
+ /**
+ * Returns the component associated with this drop target object.
+ */
public Component getComponent ()
{
return null;
}
+ /**
+ * Sets the default actions.
+ */
public void setDefaultActions (int ops)
{
}
+ /**
+ * Returns the default actions.
+ */
public int getDefaultActions ()
{
return 0;
@@ -148,7 +174,10 @@ public class DropTarget
}
/**
- * @exception TooManyListenersException FIXME
+ * Adds a new <code>DropTargetListener</code>.
+ *
+ * @exception TooManyListenersException If there is already a
+ * <code>DropTargetListener</code>.
*/
public void addDropTargetListener (DropTargetListener dtl)
throws TooManyListenersException
diff --git a/libjava/java/awt/dnd/DropTargetContext.java b/libjava/java/awt/dnd/DropTargetContext.java
index 86adaade95e..eca2f6e3763 100644
--- a/libjava/java/awt/dnd/DropTargetContext.java
+++ b/libjava/java/awt/dnd/DropTargetContext.java
@@ -46,6 +46,10 @@ import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.util.List;
+/**
+ * @author Michael Koch <konqueror@gmx.de>
+ * @since 1.2
+ */
public class DropTargetContext implements Serializable
{
static final long serialVersionUID = -634158968993743371L;
@@ -55,6 +59,12 @@ public class DropTargetContext implements Serializable
protected boolean isLocal;
protected Transferable transferable;
+ TransferableProxy (Transferable t, boolean local)
+ {
+ this.transferable = t;
+ this.isLocal = local;
+ }
+
public DataFlavor[] getTransferDataFlavors ()
{
// FIXME: implement this
@@ -110,9 +120,9 @@ public class DropTargetContext implements Serializable
}
/**
- * FIXME
+ * Signals that the drop is completed.
*
- * @exception InvalidDnDOperationException FIXME
+ * @exception InvalidDnDOperationException If a drop is not outstanding.
*/
public void dropComplete (boolean success)
{
@@ -158,9 +168,9 @@ public class DropTargetContext implements Serializable
}
/**
- * FIXME
+ * Return the <code>Transferable</code> operandof this operation.
*
- * @exception InvalidDnDOperationException FIXME
+ * @exception InvalidDnDOperationException If a drag is not outstanding.
*/
protected Transferable getTransferable() throws InvalidDnDOperationException
{
@@ -170,7 +180,6 @@ public class DropTargetContext implements Serializable
protected Transferable createTransferableProxy(Transferable t, boolean local)
{
- // FIXME: implement this
- return null;
+ return new TransferableProxy (t, local);
}
} // class DropTargetContext
diff --git a/libjava/java/awt/dnd/DropTargetDragEvent.java b/libjava/java/awt/dnd/DropTargetDragEvent.java
index a22ddc8e32a..e95b2d1ae87 100644
--- a/libjava/java/awt/dnd/DropTargetDragEvent.java
+++ b/libjava/java/awt/dnd/DropTargetDragEvent.java
@@ -41,21 +41,56 @@ import java.util.List;
import java.awt.Point;
import java.awt.datatransfer.DataFlavor;
+/**
+ * @since 1.2
+ */
public class DropTargetDragEvent extends DropTargetEvent
{
+ /**
+ * Compatible with 1.2+
+ */
+ private static final long serialVersionUID = -8422265619058953682L;
+
private final int dropAction;
private final int srcActions;
private final Point location;
/**
- * FIXME
+ * Initializes a <code>DropTargetDragEvent</code>.
*
- * @exception NullPointerException FIXME
+ * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
+ * srcActions is not a bitwise mask of DnDConstants, or dtc is null.
+ * @exception NullPointerException If location is null.
*/
public DropTargetDragEvent (DropTargetContext context, Point location,
int dropAction, int srcActions)
{
super (context);
+
+ if (location == null)
+ throw new NullPointerException ();
+
+ if (context == null)
+ throw new IllegalArgumentException ();
+
+ if (dropAction != DnDConstants.ACTION_NONE
+ && dropAction != DnDConstants.ACTION_COPY
+ && dropAction != DnDConstants.ACTION_MOVE
+ && dropAction != DnDConstants.ACTION_COPY_OR_MOVE
+ && dropAction != DnDConstants.ACTION_LINK
+ && dropAction != DnDConstants.ACTION_REFERENCE)
+ throw new IllegalArgumentException ();
+
+ int srcActionsMask = DnDConstants.ACTION_NONE
+ | DnDConstants.ACTION_COPY
+ | DnDConstants.ACTION_MOVE
+ | DnDConstants.ACTION_COPY_OR_MOVE
+ | DnDConstants.ACTION_LINK
+ | DnDConstants.ACTION_REFERENCE;
+
+ if (~(srcActions ^ srcActionsMask) != 0)
+ throw new IllegalArgumentException ();
+
this.dropAction = dropAction;
this.srcActions = srcActions;
this.location = location;
@@ -63,19 +98,17 @@ public class DropTargetDragEvent extends DropTargetEvent
public void acceptDrag (int dragOperation)
{
- // FIXME: implement this
+ context.acceptDrag (dragOperation);
}
public DataFlavor[] getCurrentDataFlavors ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavors ();
}
public List getCurrentDataFlavorsAsList ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavorsAsList ();
}
public int getDropAction()
@@ -96,12 +129,11 @@ public class DropTargetDragEvent extends DropTargetEvent
public boolean isDataFlavorSupported (DataFlavor df)
{
- // FIXME: implement this
- return true;
+ return context.isDataFlavorSupported (df);
}
public void rejectDrag ()
{
- // FIXME: implement this
+ context.rejectDrag ();
}
} // class DropTargetDragEvent
diff --git a/libjava/java/awt/dnd/DropTargetDropEvent.java b/libjava/java/awt/dnd/DropTargetDropEvent.java
index 9a14f226302..bb57f23b08f 100644
--- a/libjava/java/awt/dnd/DropTargetDropEvent.java
+++ b/libjava/java/awt/dnd/DropTargetDropEvent.java
@@ -42,31 +42,75 @@ import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.util.List;
+/**
+ * @since 1.2
+ */
public class DropTargetDropEvent extends DropTargetEvent
{
+ /**
+ * Compatible with JDK 1.2+
+ */
+ private static final long serialVersionUID = -1721911170440459322L;
+
private final int dropAction;
- private final int srcActions;
+ private final int actions;
private final Point location;
- private final boolean isLocal;
+ private final boolean isLocalTx;
+ /**
+ * Initializes a <code>DropTargetDropEvent</code>. By default this constructor
+ * assumes that the target is not int same JVM.
+ *
+ * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
+ * actions is not a bitwise mask of DnDConstants, or dtc is null.
+ * @exception NullPointerException If location is null.
+ */
public DropTargetDropEvent (DropTargetContext dtc, Point location,
- int dropAction, int srcActions)
+ int dropAction, int actions)
{
- super (dtc);
- this.dropAction = dropAction;
- this.srcActions = srcActions;
- this.location = location;
- this.isLocal = false;
+ this (dtc, location, dropAction, actions, false);
}
+ /**
+ * Initializes a <code>DropTargetDropEvent</code>.
+ *
+ * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
+ * actions is not a bitwise mask of DnDConstants, or dtc is null.
+ * @exception NullPointerException If location is null.
+ */
public DropTargetDropEvent (DropTargetContext dtc, Point location,
- int dropAction, int srcActions, boolean isLocal)
+ int dropAction, int actions, boolean isLocalTx)
{
super (dtc);
+
+ if (location == null)
+ throw new NullPointerException ();
+
+ if (dtc == null)
+ throw new IllegalArgumentException ();
+
+ if (dropAction != DnDConstants.ACTION_NONE
+ && dropAction != DnDConstants.ACTION_COPY
+ && dropAction != DnDConstants.ACTION_MOVE
+ && dropAction != DnDConstants.ACTION_COPY_OR_MOVE
+ && dropAction != DnDConstants.ACTION_LINK
+ && dropAction != DnDConstants.ACTION_REFERENCE)
+ throw new IllegalArgumentException ();
+
+ int actionsMask = DnDConstants.ACTION_NONE
+ | DnDConstants.ACTION_COPY
+ | DnDConstants.ACTION_MOVE
+ | DnDConstants.ACTION_COPY_OR_MOVE
+ | DnDConstants.ACTION_LINK
+ | DnDConstants.ACTION_REFERENCE;
+
+ if (~(actions ^ actionsMask) != 0)
+ throw new IllegalArgumentException ();
+
this.dropAction = dropAction;
- this.srcActions = srcActions;
+ this.actions = actions;
this.location = location;
- this.isLocal = isLocal;
+ this.isLocalTx = isLocalTx;
}
public Point getLocation ()
@@ -76,48 +120,42 @@ public class DropTargetDropEvent extends DropTargetEvent
public DataFlavor[] getCurrentDataFlavors ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavors ();
}
public List getCurrentDataFlavorsAsList ()
{
- // FIXME: implement this
- return null;
+ return context.getCurrentDataFlavorsAsList ();
}
public boolean isDataFlavorSupported (DataFlavor flavor)
{
- // FIXME: implement this
- return false;
+ return context.isDataFlavorSupported (flavor);
}
public int getSourceActions ()
{
- // FIXME: implement this
- return 0;
+ return actions;
}
public int getDropAction ()
{
- // FIXME: implement this
- return 0;
+ return dropAction;
}
public Transferable getTransferable ()
{
- // FIXME: implement this
- return null;
+ return context.getTransferable ();
}
public void acceptDrop (int dropAction)
{
- // FIXME: implement this
+ context.acceptDrop (dropAction);
}
public void rejectDrop ()
{
- // FIXME: implement this
+ context.rejectDrop ();
}
public void dropComplete (boolean success)
@@ -127,6 +165,6 @@ public class DropTargetDropEvent extends DropTargetEvent
public boolean isLocalTransfer()
{
- return isLocal;
+ return isLocalTx;
}
} // class DropTargetDropEvent
diff --git a/libjava/java/awt/dnd/DropTargetListener.java b/libjava/java/awt/dnd/DropTargetListener.java
index 861aa89140e..8025ff23920 100644
--- a/libjava/java/awt/dnd/DropTargetListener.java
+++ b/libjava/java/awt/dnd/DropTargetListener.java
@@ -81,7 +81,7 @@ public interface DropTargetListener extends EventListener
void dragExit (DropTargetEvent e);
/**
- * FIXME
+ * Called when the drag operation has terminated with a drop.
*
* @param e the drag source drag event
*/
diff --git a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java b/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
index 1ef2e6cb483..d01032433c0 100644
--- a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
+++ b/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
@@ -45,27 +45,38 @@ import java.awt.event.MouseMotionListener;
/**
* @author Michael Koch <konqueror@gmx.de>
*/
-
public abstract class MouseDragGestureRecognizer
extends DragGestureRecognizer
implements MouseListener, MouseMotionListener
{
+ /**
+ * Creates a <code>MouseDragGestureRecognizer</code> object.
+ */
protected MouseDragGestureRecognizer (DragSource ds, Component c, int act,
DragGestureListener dgl)
{
super (ds, c, act, dgl);
}
+ /**
+ * Creates a <code>MouseDragGestureRecognizer</code> object.
+ */
protected MouseDragGestureRecognizer (DragSource ds, Component c, int act)
{
super (ds, c, act);
}
+ /**
+ * Creates a <code>MouseDragGestureRecognizer</code> object.
+ */
protected MouseDragGestureRecognizer (DragSource ds, Component c)
{
super (ds, c);
}
+ /**
+ * Creates a <code>MouseDragGestureRecognizer</code> object.
+ */
protected MouseDragGestureRecognizer (DragSource ds)
{
super (ds);
diff --git a/libjava/java/awt/image/ColorModel.java b/libjava/java/awt/image/ColorModel.java
index fab51667edb..f798ee2c861 100644
--- a/libjava/java/awt/image/ColorModel.java
+++ b/libjava/java/awt/image/ColorModel.java
@@ -142,7 +142,7 @@ public abstract class ColorModel implements Transparency
bits_sum |= bits [i];
}
- if ((bits.length < cspace.numComponents)
+ if ((bits.length < cspace.getNumComponents())
|| (bits_sum < 1))
throw new IllegalArgumentException ();
diff --git a/libjava/java/awt/image/ImageFilter.java b/libjava/java/awt/image/ImageFilter.java
index 86bc0210a4b..f58e5381df6 100644
--- a/libjava/java/awt/image/ImageFilter.java
+++ b/libjava/java/awt/image/ImageFilter.java
@@ -108,15 +108,9 @@ public class ImageFilter implements ImageConsumer, Cloneable
throw new IllegalArgumentException("null argument for ImageFilter.getFilterInstance(ImageConsumer)");
consumer = ic;
- try {
- ImageFilter f = (ImageFilter)clone();
- consumer = null;
- return f;
- } catch ( CloneNotSupportedException cnse ) {
- cnse.printStackTrace();
- consumer = null;
- return null;
- }
+ ImageFilter f = (ImageFilter)clone();
+ consumer = null;
+ return f;
}
/**
diff --git a/libjava/java/awt/print/Paper.java b/libjava/java/awt/print/Paper.java
index cba4aec23d1..e4e8587277b 100644
--- a/libjava/java/awt/print/Paper.java
+++ b/libjava/java/awt/print/Paper.java
@@ -43,7 +43,7 @@ package java.awt.print;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Paper
+public class Paper implements Cloneable
{
/*
diff --git a/libjava/java/awt/print/PrinterJob.java b/libjava/java/awt/print/PrinterJob.java
index b9e558caa26..ccaf5dcb782 100644
--- a/libjava/java/awt/print/PrinterJob.java
+++ b/libjava/java/awt/print/PrinterJob.java
@@ -118,8 +118,7 @@ getJobName();
*
* @param job_name The name of the print job.
*/
-public abstract String
-setJobName(String job_name);
+public abstract void setJobName (String job_name);
/*************************************************************************/
@@ -195,8 +194,7 @@ pageDialog(PageFormat page_format);
/**
* Prints the pages.
*/
-public abstract void
-print();
+public abstract void print () throws PrinterException;
/**
* Displays a dialog box to the user which allows the print job
diff --git a/libjava/java/io/BufferedOutputStream.java b/libjava/java/io/BufferedOutputStream.java
index 2cbdd4a1687..e324cbcf938 100644
--- a/libjava/java/io/BufferedOutputStream.java
+++ b/libjava/java/io/BufferedOutputStream.java
@@ -1,5 +1,5 @@
/* BufferedOutputStream.java -- Buffer output into large blocks before writing
- Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -189,11 +189,11 @@ finalize() throws IOException
public synchronized void
write(int b) throws IOException
{
- buf[count] = (byte)(b & 0xFF);
-
- ++count;
if (count == buf.length)
flush();
+
+ buf[count] = (byte)(b & 0xFF);
+ ++count;
}
/*************************************************************************/
diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java
index fff979c97ac..80272d01a22 100644
--- a/libjava/java/io/InputStreamReader.java
+++ b/libjava/java/io/InputStreamReader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -70,7 +70,10 @@ public class InputStreamReader extends Reader
}
}
- public String getEncoding() { return converter.getName(); }
+ public String getEncoding()
+ {
+ return in != null ? converter.getName() : null;
+ }
public boolean ready() throws IOException
{
diff --git a/libjava/java/io/OutputStreamWriter.java b/libjava/java/io/OutputStreamWriter.java
index 527ff75c66b..d49e104773a 100644
--- a/libjava/java/io/OutputStreamWriter.java
+++ b/libjava/java/io/OutputStreamWriter.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.
@@ -28,7 +28,10 @@ public class OutputStreamWriter extends Writer
private char[] work;
private int wcount;
- public String getEncoding() { return converter.getName(); }
+ public String getEncoding()
+ {
+ return out != null ? converter.getName() : null;
+ }
private OutputStreamWriter(OutputStream out, UnicodeToBytes encoder)
{
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 4b157f7042c..87f94e81222 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -1,6 +1,7 @@
// natFileDescriptorWin32.cc - Native part of FileDescriptor class.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
This file is part of libgcj.
@@ -288,7 +289,13 @@ java::io::FileDescriptor::read(void)
DWORD read;
if (! ReadFile ((HANDLE)fd, &buf, 1, &read, NULL))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ {
+ if (GetLastError () == ERROR_BROKEN_PIPE)
+ return -1;
+ else
+ throw new IOException (JvNewStringLatin1 (winerr ()));
+ }
+
if (! read)
return -1;
else
@@ -313,9 +320,15 @@ java::io::FileDescriptor::read(jbyteArray buffer, jint offset, jint count)
DWORD read;
if (! ReadFile((HANDLE)fd, bytes, count, &read, NULL))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ {
+ if (GetLastError () == ERROR_BROKEN_PIPE)
+ return -1;
+ else
+ throw new IOException (JvNewStringLatin1 (winerr ()));
+ }
if (read == 0) return -1;
+
return (jint)read;
}
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index cc1cc40f2a4..44f5b5ab529 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -1,6 +1,6 @@
// Class.java - Representation of a Java class.
-/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -346,7 +346,7 @@ public final class Class implements Serializable
private native void initializeClass ();
// finalization
- protected native void finalize ();
+ protected native void finalize () throws Throwable;
/**
* Strip the last portion of the name (after the last dot).
diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java
index ab584250749..2e7c031b16c 100644
--- a/libjava/java/lang/System.java
+++ b/libjava/java/lang/System.java
@@ -1,5 +1,5 @@
/* System.java -- useful methods to interface with the system
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -104,8 +104,10 @@ public final class System
* {@link #setProperties(Properties)}, but will never be null, because
* setProperties(null) sucks in the default properties.
*/
+ // Note that we use clone here and not new. Some programs assume
+ // that the system properties do not have a parent.
private static Properties properties
- = new Properties(Runtime.defaultProperties);
+ = (Properties) Runtime.defaultProperties.clone();
/**
* The standard InputStream. This is assigned at startup and starts its
@@ -369,7 +371,11 @@ public final class System
if (sm != null)
sm.checkPropertiesAccess();
if (properties == null)
- properties = new Properties(Runtime.defaultProperties);
+ {
+ // Note that we use clone here and not new. Some programs
+ // assume that the system properties do not have a parent.
+ properties = (Properties) Runtime.defaultProperties.clone();
+ }
System.properties = properties;
}
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java
index 18af8292126..33b0f450fa5 100644
--- a/libjava/java/lang/Thread.java
+++ b/libjava/java/lang/Thread.java
@@ -1,6 +1,6 @@
// Thread.java - Thread 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.
@@ -12,30 +12,84 @@ package java.lang;
import gnu.gcj.RawData;
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date August 24, 1998
- */
-
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete to version 1.3, with caveats. We do not
+ * Status: Believed complete to version 1.4, with caveats. We do not
* implement the deprecated (and dangerous) stop, suspend, and resume
* methods. Security implementation is not complete.
*/
+/**
+ * Thread represents a single thread of execution in the VM. When an
+ * application VM starts up, it creates a non-daemon Thread which calls the
+ * main() method of a particular class. There may be other Threads running,
+ * such as the garbage collection thread.
+ *
+ * <p>Threads have names to identify them. These names are not necessarily
+ * unique. Every Thread has a priority, as well, which tells the VM which
+ * Threads should get more running time. New threads inherit the priority
+ * and daemon status of the parent thread, by default.
+ *
+ * <p>There are two methods of creating a Thread: you may subclass Thread and
+ * implement the <code>run()</code> method, at which point you may start the
+ * Thread by calling its <code>start()</code> method, or you may implement
+ * <code>Runnable</code> in the class you want to use and then call new
+ * <code>Thread(your_obj).start()</code>.
+ *
+ * <p>The virtual machine runs until all non-daemon threads have died (either
+ * by returning from the run() method as invoked by start(), or by throwing
+ * an uncaught exception); or until <code>System.exit</code> is called with
+ * adequate permissions.
+ *
+ * <p>It is unclear at what point a Thread should be added to a ThreadGroup,
+ * and at what point it should be removed. Should it be inserted when it
+ * starts, or when it is created? Should it be removed when it is suspended
+ * or interrupted? The only thing that is clear is that the Thread should be
+ * removed when it is stopped.
+ *
+ * @author Tom Tromey
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Runnable
+ * @see Runtime#exit(int)
+ * @see #run()
+ * @see #start()
+ * @see ThreadLocal
+ * @since 1.0
+ * @status updated to 1.4
+ */
public class Thread implements Runnable
{
+ /** The maximum priority for a Thread. */
public final static int MAX_PRIORITY = 10;
+
+ /** The minimum priority for a Thread. */
public final static int MIN_PRIORITY = 1;
+
+ /** The priority a Thread gets by default. */
public final static int NORM_PRIORITY = 5;
+ /**
+ * Get the number of active threads in the current Thread's ThreadGroup.
+ * This implementation calls
+ * <code>currentThread().getThreadGroup().activeCount()</code>.
+ *
+ * @return the number of active threads in the current ThreadGroup
+ * @see ThreadGroup#activeCount()
+ */
public static int activeCount ()
{
return currentThread().getThreadGroup().activeCount();
}
+ /**
+ * Check whether the current Thread is allowed to modify this Thread. This
+ * passes the check on to <code>SecurityManager.checkAccess(this)</code>.
+ *
+ * @throws SecurityException if the current Thread cannot modify this Thread
+ * @see SecurityManager#checkAccess(Thread)
+ */
public final void checkAccess ()
{
SecurityManager s = System.getSecurityManager();
@@ -43,78 +97,218 @@ public class Thread implements Runnable
s.checkAccess(this);
}
+ /**
+ * Count the number of stack frames in this Thread. The Thread in question
+ * must be suspended when this occurs.
+ *
+ * @return the number of stack frames in this Thread
+ * @throws IllegalThreadStateException if this Thread is not suspended
+ * @deprecated pointless, since suspend is deprecated
+ */
public native int countStackFrames ();
+
+ /**
+ * Get the currently executing Thread.
+ *
+ * @return the currently executing Thread
+ */
public static native Thread currentThread ();
+
+ /**
+ * Originally intended to destroy this thread, this method was never
+ * implemented by Sun, and is hence a no-op.
+ */
public native void destroy ();
+ /**
+ * Print a stack trace of the current thread to stderr using the same
+ * format as Throwable's printStackTrace() method.
+ *
+ * @see Throwable#printStackTrace()
+ */
public static void dumpStack ()
{
(new Exception ("Stack trace")).printStackTrace ();
}
+ /**
+ * Copy every active thread in the current Thread's ThreadGroup into the
+ * array. Extra threads are silently ignored. This implementation calls
+ * <code>getThreadGroup().enumerate(array)</code>, which may have a
+ * security check, <code>checkAccess(group)</code>.
+ *
+ * @param array the array to place the Threads into
+ * @return the number of Threads placed into the array
+ * @throws NullPointerException if array is null
+ * @throws SecurityException if you cannot access the ThreadGroup
+ * @see ThreadGroup#enumerate(Thread[])
+ * @see #activeCount()
+ * @see SecurityManager#checkAccess(ThreadGroup)
+ */
public static int enumerate (Thread[] threads)
{
return currentThread().group.enumerate(threads);
}
-
+
+ /**
+ * Get this Thread's name.
+ *
+ * @return this Thread's name
+ */
public final String getName ()
{
return name;
}
+ /**
+ * Get this Thread's priority.
+ *
+ * @return the Thread's priority
+ */
public final int getPriority ()
{
return priority;
}
+ /**
+ * Get the ThreadGroup this Thread belongs to. If the thread has died, this
+ * returns null.
+ *
+ * @return this Thread's ThreadGroup
+ */
public final ThreadGroup getThreadGroup ()
{
return group;
}
+ /**
+ * Interrupt this Thread. First, there is a security check,
+ * <code>checkAccess</code>. Then, depending on the current state of the
+ * thread, various actions take place:
+ *
+ * <p>If the thread is waiting because of {@link #wait()},
+ * {@link #sleep(long)}, or {@link #join()}, its <i>interrupt status</i>
+ * will be cleared, and an InterruptedException will be thrown. Notice that
+ * this case is only possible if an external thread called interrupt().
+ *
+ * <p>If the thread is blocked in an interruptible I/O operation, in
+ * {@link java.nio.channels.InterruptibleChannel}, the <i>interrupt
+ * status</i> will be set, and ClosedByInterruptException will be thrown.
+ *
+ * <p>If the thread is blocked on a {@link java.nio.channels.Selector}, the
+ * <i>interrupt status</i> will be set, and the selection will return, with
+ * a possible non-zero value, as though by the wakeup() method.
+ *
+ * <p>Otherwise, the interrupt status will be set.
+ *
+ * @throws SecurityException if you cannot modify this Thread
+ */
public native void interrupt ();
+ /**
+ * Determine whether the current Thread has been interrupted, and clear
+ * the <i>interrupted status</i> in the process.
+ *
+ * @return whether the current Thread has been interrupted
+ * @see #isInterrupted()
+ */
public static boolean interrupted ()
{
return currentThread().isInterrupted (true);
}
- // Check the threads interrupted status. Note that this does not clear the
- // thread's interrupted status (per JDK 1.2 online API documentation).
+ /**
+ * Determine whether the given Thread has been interrupted, but leave
+ * the <i>interrupted status</i> alone in the process.
+ *
+ * @return whether the current Thread has been interrupted
+ * @see #interrupted()
+ */
public boolean isInterrupted ()
{
return interrupt_flag;
}
+ /**
+ * Determine whether this Thread is alive. A thread which is alive has
+ * started and not yet died.
+ *
+ * @return whether this Thread is alive
+ */
public final boolean isAlive ()
{
return alive_flag;
}
+ /**
+ * Tell whether this is a daemon Thread or not.
+ *
+ * @return whether this is a daemon Thread or not
+ * @see #setDaemon(boolean)
+ */
public final boolean isDaemon ()
{
return daemon_flag;
}
+ /**
+ * Wait forever for the Thread in question to die.
+ *
+ * @throws InterruptedException if the Thread is interrupted; it's
+ * <i>interrupted status</i> will be cleared
+ */
public final void join () throws InterruptedException
{
join (0, 0);
}
+ /**
+ * Wait the specified amount of time for the Thread in question to die.
+ *
+ * @param ms the number of milliseconds to wait, or 0 for forever
+ * @throws InterruptedException if the Thread is interrupted; it's
+ * <i>interrupted status</i> will be cleared
+ */
public final void join (long timeout) throws InterruptedException
{
join (timeout, 0);
}
+ /**
+ * Wait the specified amount of time for the Thread in question to die.
+ *
+ * <p>Note that 1,000,000 nanoseconds == 1 millisecond, but most VMs do
+ * not offer that fine a grain of timing resolution. Besides, there is
+ * no guarantee that this thread can start up immediately when time expires,
+ * because some other thread may be active. So don't expect real-time
+ * performance.
+ *
+ * @param ms the number of milliseconds to wait, or 0 for forever
+ * @param ns the number of extra nanoseconds to sleep (0-999999)
+ * @throws InterruptedException if the Thread is interrupted; it's
+ * <i>interrupted status</i> will be cleared
+ * @throws IllegalArgumentException if ns is invalid
+ * @XXX A ThreadListener would be nice, to make this efficient.
+ */
public final native void join (long timeout, int nanos)
throws InterruptedException;
+ /**
+ * Resume a suspended thread.
+ *
+ * @see #resume()
+ */
public final native void resume ();
private final native void finish_ ();
- // Check the thread's interrupted status. If clear_flag is true, the
- // thread's interrupted status is also cleared.
+ /**
+ * Determine whether the given Thread has been interrupted, but leave
+ * the <i>interrupted status</i> alone in the process.
+ *
+ * @return whether the current Thread has been interrupted
+ * @see #interrupted()
+ */
private boolean isInterrupted (boolean clear_flag)
{
boolean r = interrupt_flag;
@@ -128,12 +322,31 @@ public class Thread implements Runnable
return r;
}
+ /**
+ * The method of Thread that will be run if there is no Runnable object
+ * associated with the Thread. Thread's implementation does nothing at all.
+ *
+ * @see #start()
+ * @see #Thread(ThreadGroup, Runnable, String)
+ */
public void run ()
{
if (runnable != null)
runnable.run();
}
+ /**
+ * Set the daemon status of this Thread. If this is a daemon Thread, then
+ * the VM may exit even if it is still running. This may only be called
+ * before the Thread starts running. There may be a security check,
+ * <code>checkAccess</code>.
+ *
+ * @param daemon whether this should be a daemon thread or not
+ * @throws SecurityException if you cannot modify this Thread
+ * @throws IllegalThreadStateException if the Thread is active
+ * @see #isDaemon()
+ * @see #checkAccess()
+ */
public final void setDaemon (boolean status)
{
checkAccess ();
@@ -142,6 +355,20 @@ public class Thread implements Runnable
daemon_flag = status;
}
+ /**
+ * Returns the context classloader of this Thread. The context
+ * classloader can be used by code that want to load classes depending
+ * on the current thread. Normally classes are loaded depending on
+ * the classloader of the current class. There may be a security check
+ * for <code>RuntimePermission("getClassLoader")</code> if the caller's
+ * class loader is not null or an ancestor of this thread's context class
+ * loader.
+ *
+ * @return the context class loader
+ * @throws SecurityException when permission is denied
+ * @see setContextClassLoader(ClassLoader)
+ * @since 1.2
+ */
public synchronized ClassLoader getContextClassLoader()
{
if (context_class_loader == null)
@@ -168,6 +395,20 @@ public class Thread implements Runnable
return context_class_loader;
}
+ /**
+ * Returns the context classloader of this Thread. The context
+ * classloader can be used by code that want to load classes depending
+ * on the current thread. Normally classes are loaded depending on
+ * the classloader of the current class. There may be a security check
+ * for <code>RuntimePermission("getClassLoader")</code> if the caller's
+ * class loader is not null or an ancestor of this thread's context class
+ * loader.
+ *
+ * @return the context class loader
+ * @throws SecurityException when permission is denied
+ * @see setContextClassLoader(ClassLoader)
+ * @since 1.2
+ */
public synchronized void setContextClassLoader(ClassLoader cl)
{
SecurityManager s = System.getSecurityManager ();
@@ -176,6 +417,14 @@ public class Thread implements Runnable
context_class_loader = cl;
}
+ /**
+ * Set this Thread's name. There may be a security check,
+ * <code>checkAccess</code>.
+ *
+ * @param name the new name for this Thread
+ * @throws NullPointerException if name is null
+ * @throws SecurityException if you cannot modify this Thread
+ */
public final void setName (String n)
{
checkAccess ();
@@ -186,17 +435,98 @@ public class Thread implements Runnable
name = n;
}
+ /**
+ * Set this Thread's priority. There may be a security check,
+ * <code>checkAccess</code>, then the priority is set to the smaller of
+ * priority and the ThreadGroup maximum priority.
+ *
+ * @param priority the new priority for this Thread
+ * @throws IllegalArgumentException if priority exceeds MIN_PRIORITY or
+ * MAX_PRIORITY
+ * @throws SecurityException if you cannot modify this Thread
+ * @see #getPriority()
+ * @see #checkAccess()
+ * @see ThreadGroup#getMaxPriority()
+ * @see #MIN_PRIORITY
+ * @see #MAX_PRIORITY
+ */
public final native void setPriority (int newPriority);
+ /**
+ * Suspend the current Thread's execution for the specified amount of
+ * time. The Thread will not lose any locks it has during this time. There
+ * are no guarantees which thread will be next to run, but most VMs will
+ * choose the highest priority thread that has been waiting longest.
+ *
+ * @param ms the number of milliseconds to sleep, or 0 for forever
+ * @throws InterruptedException if the Thread is interrupted; it's
+ * <i>interrupted status</i> will be cleared
+ * @see #notify()
+ * @see #wait(long)
+ */
public static void sleep (long timeout) throws InterruptedException
{
sleep (timeout, 0);
}
+ /**
+ * Suspend the current Thread's execution for the specified amount of
+ * time. The Thread will not lose any locks it has during this time. There
+ * are no guarantees which thread will be next to run, but most VMs will
+ * choose the highest priority thread that has been waiting longest.
+ *
+ * <p>Note that 1,000,000 nanoseconds == 1 millisecond, but most VMs do
+ * not offer that fine a grain of timing resolution. Besides, there is
+ * no guarantee that this thread can start up immediately when time expires,
+ * because some other thread may be active. So don't expect real-time
+ * performance.
+ *
+ * @param ms the number of milliseconds to sleep, or 0 for forever
+ * @param ns the number of extra nanoseconds to sleep (0-999999)
+ * @throws InterruptedException if the Thread is interrupted; it's
+ * <i>interrupted status</i> will be cleared
+ * @throws IllegalArgumentException if ns is invalid
+ * @see #notify()
+ * @see #wait(long, int)
+ */
public static native void sleep (long timeout, int nanos)
throws InterruptedException;
+
+ /**
+ * Start this Thread, calling the run() method of the Runnable this Thread
+ * was created with, or else the run() method of the Thread itself. This
+ * is the only way to start a new thread; calling run by yourself will just
+ * stay in the same thread. The virtual machine will remove the thread from
+ * its thread group when the run() method completes.
+ *
+ * @throws IllegalThreadStateException if the thread has already started
+ * @see #run()
+ */
public native void start ();
+ /**
+ * Cause this Thread to stop abnormally because of the throw of a ThreadDeath
+ * error. If you stop a Thread that has not yet started, it will stop
+ * immediately when it is actually started.
+ *
+ * <p>This is inherently unsafe, as it can interrupt synchronized blocks and
+ * leave data in bad states. Hence, there is a security check:
+ * <code>checkAccess(this)</code>, plus another one if the current thread
+ * is not this: <code>RuntimePermission("stopThread")</code>. If you must
+ * catch a ThreadDeath, be sure to rethrow it after you have cleaned up.
+ * ThreadDeath is the only exception which does not print a stack trace when
+ * the thread dies.
+ *
+ * @throws SecurityException if you cannot stop the Thread
+ * @see #interrupt()
+ * @see #checkAccess()
+ * @see #start()
+ * @see ThreadDeath
+ * @see ThreadGroup#uncaughtException(Thread, Throwable)
+ * @see SecurityManager#checkAccess(Thread)
+ * @see SecurityManager#checkPermission(Permission)
+ * @deprecated unsafe operation, try not to use
+ */
public final void stop ()
{
// Argument doesn't matter, because this is no longer
@@ -204,13 +534,82 @@ public class Thread implements Runnable
stop (null);
}
+ /**
+ * Cause this Thread to stop abnormally and throw the specified exception.
+ * If you stop a Thread that has not yet started, it will stop immediately
+ * when it is actually started. <b>WARNING</b>This bypasses Java security,
+ * and can throw a checked exception which the call stack is unprepared to
+ * handle. Do not abuse this power.
+ *
+ * <p>This is inherently unsafe, as it can interrupt synchronized blocks and
+ * leave data in bad states. Hence, there is a security check:
+ * <code>checkAccess(this)</code>, plus another one if the current thread
+ * is not this: <code>RuntimePermission("stopThread")</code>. If you must
+ * catch a ThreadDeath, be sure to rethrow it after you have cleaned up.
+ * ThreadDeath is the only exception which does not print a stack trace when
+ * the thread dies.
+ *
+ * @param t the Throwable to throw when the Thread dies
+ * @throws SecurityException if you cannot stop the Thread
+ * @throws NullPointerException in the calling thread, if t is null
+ * @see #interrupt()
+ * @see #checkAccess()
+ * @see #start()
+ * @see ThreadDeath
+ * @see ThreadGroup#uncaughtException(Thread, Throwable)
+ * @see SecurityManager#checkAccess(Thread)
+ * @see SecurityManager#checkPermission(Permission)
+ * @deprecated unsafe operation, try not to use
+ */
public final native void stop (Throwable e);
+
+ /**
+ * Suspend this Thread. It will not come back, ever, unless it is resumed.
+ *
+ * <p>This is inherently unsafe, as the suspended thread still holds locks,
+ * and can potentially deadlock your program. Hence, there is a security
+ * check: <code>checkAccess</code>.
+ *
+ * @throws SecurityException if you cannot suspend the Thread
+ * @see #checkAccess()
+ * @see #resume()
+ * @deprecated unsafe operation, try not to use
+ */
public final native void suspend ();
private final native void initialize_native ();
private final native static String gen_name ();
+ /**
+ * Allocate a new Thread object, with the specified ThreadGroup and name, and
+ * using the specified Runnable object's <code>run()</code> method to
+ * execute. If the Runnable object is null, <code>this</code> (which is
+ * a Runnable) is used instead.
+ *
+ * <p>If the ThreadGroup is null, the security manager is checked. If a
+ * manager exists and returns a non-null object for
+ * <code>getThreadGroup</code>, that group is used; otherwise the group
+ * of the creating thread is used. Note that the security manager calls
+ * <code>checkAccess</code> if the ThreadGroup is not null.
+ *
+ * <p>The new Thread will inherit its creator's priority and daemon status.
+ * These can be changed with <code>setPriority</code> and
+ * <code>setDaemon</code>.
+ *
+ * @param group the group to put the Thread into
+ * @param target the Runnable object to execute
+ * @param name the name for the Thread
+ * @throws NullPointerException if name is null
+ * @throws SecurityException if this thread cannot access <code>group</code>
+ * @throws IllegalThreadStateException if group is destroyed
+ * @see Runnable#run()
+ * @see #run()
+ * @see #setDaemon(boolean)
+ * @see #setPriority(int)
+ * @see SecurityManager#checkAccess(ThreadGroup)
+ * @see ThreadGroup#checkAccess()
+ */
public Thread (ThreadGroup g, Runnable r, String n)
{
this (currentThread (), g, r, n);
@@ -221,6 +620,37 @@ public class Thread implements Runnable
throw new NullPointerException ();
}
+ /**
+ * Allocate a new Thread object, as if by
+ * <code>Thread(group, null, name)</code>, and give it the specified stack
+ * size, in bytes. The stack size is <b>highly platform independent</b>,
+ * and the virtual machine is free to round up or down, or ignore it
+ * completely. A higher value might let you go longer before a
+ * <code>StackOverflowError</code>, while a lower value might let you go
+ * longer before an <code>OutOfMemoryError</code>. Or, it may do absolutely
+ * nothing! So be careful, and expect to need to tune this value if your
+ * virtual machine even supports it.
+ *
+ * @param group the group to put the Thread into
+ * @param target the Runnable object to execute
+ * @param name the name for the Thread
+ * @param size the stack size, in bytes; 0 to be ignored
+ * @throws NullPointerException if name is null
+ * @throws SecurityException if this thread cannot access <code>group</code>
+ * @throws IllegalThreadStateException if group is destroyed
+ * @since 1.4
+ */
+ public Thread (ThreadGroup g, Runnable r, String n, long size)
+ {
+ // Just ignore stackSize for now.
+ this (currentThread (), g, r, n);
+
+ // The Class Libraries book says ``threadName cannot be null''. I
+ // take this to mean NullPointerException.
+ if (n == null)
+ throw new NullPointerException ();
+ }
+
private Thread (Thread current, ThreadGroup g, Runnable r, String n)
{
if (g == null)
@@ -264,42 +694,152 @@ public class Thread implements Runnable
initialize_native ();
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(null, null,</code>
+ * <i>gname</i><code>)</code>, where <b><i>gname</i></b> is
+ * a newly generated name. Automatically generated names are of the
+ * form <code>"Thread-"+</code><i>n</i>, where <i>n</i> is an integer.
+ * <p>
+ * Threads created this way must have overridden their
+ * <code>run()</code> method to actually do anything. An example
+ * illustrating this method being used follows:
+ * <p><blockquote><pre>
+ * import java.lang.*;
+ *
+ * class plain01 implements Runnable {
+ * String name;
+ * plain01() {
+ * name = null;
+ * }
+ * plain01(String s) {
+ * name = s;
+ * }
+ * public void run() {
+ * if (name == null)
+ * System.out.println("A new thread created");
+ * else
+ * System.out.println("A new thread with name " + name +
+ * " created");
+ * }
+ * }
+ * class threadtest01 {
+ * public static void main(String args[] ) {
+ * int failed = 0 ;
+ *
+ * <b>Thread t1 = new Thread();</b>
+ * if (t1 != null)
+ * System.out.println("new Thread() succeed");
+ * else {
+ * System.out.println("new Thread() failed");
+ * failed++;
+ * }
+ * }
+ * }
+ * </pre></blockquote>
+ *
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread ()
{
this (null, null, gen_name ());
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(null, target,</code>
+ * <i>gname</i><code>)</code>, where <i>gname</i> is
+ * a newly generated name. Automatically generated names are of the
+ * form <code>"Thread-"+</code><i>n</i>, where <i>n</i> is an integer.
+ *
+ * @param target the object whose <code>run</code> method is called.
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread (Runnable r)
{
this (null, r, gen_name ());
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(null, null, name)</code>.
+ *
+ * @param name the name of the new thread.
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread (String n)
{
this (null, null, n);
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(group, target,</code>
+ * <i>gname</i><code>)</code>, where <i>gname</i> is
+ * a newly generated name. Automatically generated names are of the
+ * form <code>"Thread-"+</code><i>n</i>, where <i>n</i> is an integer.
+ *
+ * @param group the thread group.
+ * @param target the object whose <code>run</code> method is called.
+ * @exception SecurityException if the current thread cannot create a
+ * thread in the specified thread group.
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread (ThreadGroup g, Runnable r)
{
this (g, r, gen_name ());
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(group, null, name)</code>
+ *
+ * @param group the thread group.
+ * @param name the name of the new thread.
+ * @exception SecurityException if the current thread cannot create a
+ * thread in the specified thread group.
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread (ThreadGroup g, String n)
{
this (g, null, n);
}
+ /**
+ * Allocates a new <code>Thread</code> object. This constructor has
+ * the same effect as <code>Thread(null, target, name)</code>.
+ *
+ * @param target the object whose <code>run</code> method is called.
+ * @param name the name of the new thread.
+ * @see java.lang.Thread#Thread(java.lang.ThreadGroup,
+ * java.lang.Runnable, java.lang.String)
+ */
public Thread (Runnable r, String n)
{
this (null, r, n);
}
+ /**
+ * Returns a string representation of this thread, including the
+ * thread's name, priority, and thread group.
+ *
+ * @return a string representation of this thread.
+ */
public String toString ()
{
return "Thread[" + name + "," + priority + "," +
(group == null ? "" : group.getName()) + "]";
}
+ /**
+ * Causes the currently executing thread object to temporarily pause
+ * and allow other threads to execute.
+ */
public static native void yield ();
// Private data.
diff --git a/libjava/java/lang/Win32Process.java b/libjava/java/lang/Win32Process.java
index 72911d2961b..b1c7e027379 100644
--- a/libjava/java/lang/Win32Process.java
+++ b/libjava/java/lang/Win32Process.java
@@ -1,6 +1,6 @@
// Win32Process.java - Subclass of Process for Win32 systems.
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -22,51 +22,63 @@ import java.io.IOException;
// This is entirely internal to our implementation.
-// NOTE: when this is implemented, we'll need to add
-// HANDLE_FLAG_INHERIT in FileDescriptor and other places, to make
-// sure that file descriptors aren't inherited by the child process.
-// See _Jv_platform_close_on_exec.
-
// This file is copied to `ConcreteProcess.java' before compilation.
// Hence the class name apparently does not match the file name.
final class ConcreteProcess extends Process
{
- public void destroy ()
- {
- throw new Error("not implemented");
- }
-
+ public native void destroy ();
+
+ public native boolean hasExited ();
+
public int exitValue ()
{
- throw new Error("not implemented");
+ if (! hasExited ())
+ throw new IllegalThreadStateException ("Process has not exited");
+
+ return exitCode;
}
public InputStream getErrorStream ()
{
- throw new Error("not implemented");
+ return errorStream;
}
public InputStream getInputStream ()
{
- throw new Error("not implemented");
+ return inputStream;
}
public OutputStream getOutputStream ()
{
- throw new Error("not implemented");
+ return outputStream;
}
- public int waitFor () throws InterruptedException
- {
- throw new Error("not implemented");
- }
+ public native int waitFor () throws InterruptedException;
+
+ public native void startProcess (String[] progarray,
+ String[] envp,
+ File dir)
+ throws IOException;
+
+ public native void cleanup ();
public ConcreteProcess (String[] progarray,
String[] envp,
File dir)
throws IOException
{
- throw new IOException("not implemented");
+ startProcess (progarray, envp, dir);
}
+ // The standard streams (stdin, stdout and stderr, respectively)
+ // of the child as seen by the parent process.
+ private OutputStream outputStream;
+ private InputStream inputStream;
+ private InputStream errorStream;
+
+ // Handle to the child process - cast to HANDLE before use.
+ private int procHandle;
+
+ // Exit code of the child if it has exited.
+ private int exitCode;
}
diff --git a/libjava/java/lang/natObject.cc b/libjava/java/lang/natObject.cc
index a050baa3f66..33f3e8de27f 100644
--- a/libjava/java/lang/natObject.cc
+++ b/libjava/java/lang/natObject.cc
@@ -1,6 +1,6 @@
// natObject.cc - Implementation of the Object 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.
@@ -9,6 +9,7 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <string.h>
@@ -28,8 +29,6 @@ details. */
#include <java/lang/Cloneable.h>
#include <java/lang/Thread.h>
-#include "platform.h"
-
#ifdef LOCK_DEBUG
# include <stdio.h>
#endif
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 09f1e04f361..9879b259dd5 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -9,6 +9,7 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <stdlib.h>
@@ -33,8 +34,6 @@ details. */
#include <jni.h>
-#include "platform.h"
-
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index ffa3f1a5053..e2d42324386 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -1,6 +1,6 @@
// natSystem.cc - Native code implementing System 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.
@@ -9,6 +9,7 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <stdio.h>
#include <string.h>
@@ -24,8 +25,6 @@ details. */
#include <java/io/PrintStream.h>
#include <java/io/InputStream.h>
-#include "platform.h"
-
void
diff --git a/libjava/java/lang/natWin32Process.cc b/libjava/java/lang/natWin32Process.cc
index e69de29bb2d..38e6f919174 100644
--- a/libjava/java/lang/natWin32Process.cc
+++ b/libjava/java/lang/natWin32Process.cc
@@ -0,0 +1,294 @@
+// natWin32Process.cc - Native side of Win32 process code.
+
+/* 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 <stdio.h>
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+// Conflicts with the definition in "java/lang/reflect/Modifier.h"
+#undef STRICT
+
+#include <gcj/cni.h>
+#include <jvm.h>
+
+#include <java/lang/ConcreteProcess.h>
+#include <java/lang/IllegalThreadStateException.h>
+#include <java/lang/InterruptedException.h>
+#include <java/lang/NullPointerException.h>
+#include <java/lang/Thread.h>
+#include <java/io/File.h>
+#include <java/io/FileDescriptor.h>
+#include <java/io/FileInputStream.h>
+#include <java/io/FileOutputStream.h>
+#include <java/io/IOException.h>
+#include <java/lang/OutOfMemoryError.h>
+
+void
+java::lang::ConcreteProcess::cleanup (void)
+{
+ if (inputStream != NULL)
+ {
+ inputStream->close ();
+ inputStream = NULL;
+ }
+
+ if (outputStream != NULL)
+ {
+ outputStream->close ();
+ outputStream = NULL;
+ }
+
+ if (errorStream != NULL)
+ {
+ errorStream->close ();
+ errorStream = NULL;
+ }
+}
+
+void
+java::lang::ConcreteProcess::destroy (void)
+{
+ if (! hasExited ())
+ {
+ // Kill it forcibly and assign an (arbitrary) exit code of 0.
+ TerminateProcess ((HANDLE) procHandle, 0);
+ exitCode = 0;
+
+ cleanup ();
+ }
+}
+
+jboolean
+java::lang::ConcreteProcess::hasExited (void)
+{
+ DWORD exitStatus;
+
+ if (GetExitCodeProcess ((HANDLE) procHandle, &exitStatus) != 0)
+ {
+ // NOTE: STILL_ACTIVE is defined as "259" by Win32 - if the
+ // child actually exits with this return code, we have a
+ // problem here. See MSDN documentation on GetExitCodeProcess( ).
+
+ if (exitStatus == STILL_ACTIVE)
+ return false;
+ else
+ {
+ cleanup ();
+ exitCode = exitStatus;
+ return true;
+ }
+ }
+ else
+ return true;
+}
+
+jint
+java::lang::ConcreteProcess::waitFor (void)
+{
+ if (! hasExited ())
+ {
+ DWORD exitStatus = 0UL;
+
+ // FIXME: The wait should be interruptible.
+ WaitForSingleObject ((HANDLE) procHandle, INFINITE);
+
+ GetExitCodeProcess ((HANDLE) procHandle, &exitStatus);
+ exitCode = exitStatus;
+
+ cleanup ();
+ }
+
+ return exitCode;
+}
+
+static char *
+new_string (jstring string)
+{
+ jsize s = _Jv_GetStringUTFLength (string);
+ char *buf = (char *) _Jv_Malloc (s + 1);
+ _Jv_GetStringUTFRegion (string, 0, s, buf);
+ buf[s] = '\0';
+ return buf;
+}
+
+void
+java::lang::ConcreteProcess::startProcess (jstringArray progarray,
+ jstringArray envp,
+ java::io::File *dir)
+{
+ using namespace java::io;
+
+ procHandle = (jint) INVALID_HANDLE_VALUE;
+
+ // Reconstruct the command line.
+ jstring *elts = elements (progarray);
+
+ int cmdLineLen = 0;
+
+ for (int i = 0; i < progarray->length; ++i)
+ cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
+
+ char *cmdLine = (char *) _Jv_Malloc (cmdLineLen + 1);
+
+ int j = 0;
+ for (int i = 0; i < progarray->length; ++i)
+ {
+ jsize s = _Jv_GetStringUTFLength (elts[i]);
+ _Jv_GetStringUTFRegion (elts[i], 0, s, (cmdLine + j));
+
+ j += s;
+ *(cmdLine + j) = ' ';
+ j++;
+ }
+ *(cmdLine + j) = '\0';
+
+ // Get the environment, if any.
+ char *env = NULL;
+ if (envp)
+ {
+ elts = elements (envp);
+
+ int envLen = 0;
+ for (int i = 0; i < envp->length; ++i)
+ envLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
+
+ env = (char *) _Jv_Malloc (envLen + 1);
+
+ int j = 0;
+ for (int i = 0; i < envp->length; ++i)
+ {
+ jsize s = _Jv_GetStringUTFLength (elts[i]);
+ _Jv_GetStringUTFRegion (elts[i], 0, s, (env + j));
+
+ j += s;
+ *(env + j) = '\0';
+ j++;
+ }
+ *(env + j) = '\0';
+ }
+
+ // Get the working directory path, if specified.
+ char *wdir = NULL;
+ if (dir != NULL)
+ wdir = new_string (dir->getPath ());
+
+ errorStream = NULL;
+ inputStream = NULL;
+ outputStream = NULL;
+
+ java::lang::Throwable *exc = NULL;
+
+ try
+ {
+ // We create anonymous pipes to communicate with the child
+ // on each of standard streams.
+
+ HANDLE cldStdInRd, cldStdInWr;
+ HANDLE cldStdOutRd, cldStdOutWr;
+ HANDLE cldStdErrRd, cldStdErrWr;
+
+ SECURITY_ATTRIBUTES sAttrs;
+
+ // Explicitly allow the handles to the pipes to be inherited.
+ sAttrs.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sAttrs.bInheritHandle = 1;
+ sAttrs.lpSecurityDescriptor = NULL;
+
+
+ char tmpBuff[64];
+ if (CreatePipe (&cldStdInRd, &cldStdInWr, &sAttrs, 0) == 0)
+ {
+ sprintf (tmpBuff,
+ "Error creating stdin pipe (Win32 Error Code: %lu)",
+ GetLastError ());
+ throw new IOException (JvNewStringLatin1 (tmpBuff));
+ }
+
+ if (CreatePipe (&cldStdOutRd, &cldStdOutWr, &sAttrs, 0) == 0)
+ {
+ sprintf (tmpBuff,
+ "Error creating stdout pipe (Win32 Error Code: %lu)",
+ GetLastError ());
+ throw new IOException (JvNewStringLatin1 (tmpBuff));
+ }
+
+ if (CreatePipe (&cldStdErrRd, &cldStdErrWr, &sAttrs, 0) == 0)
+ {
+ sprintf (tmpBuff,
+ "Error creating stderr pipe (Win32 Error Code: %lu)",
+ GetLastError ());
+ throw new IOException (JvNewStringLatin1 (tmpBuff));
+ }
+
+ outputStream = new FileOutputStream
+ (new FileDescriptor ((jint) cldStdInWr));
+ inputStream = new FileInputStream
+ (new FileDescriptor ((jint) cldStdOutRd));
+ errorStream = new FileInputStream
+ (new FileDescriptor ((jint) cldStdErrRd));
+
+ // Now create the child process.
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+
+ ZeroMemory (&pi, sizeof (PROCESS_INFORMATION));
+
+ ZeroMemory (&si, sizeof (STARTUPINFO));
+ si.cb = sizeof (STARTUPINFO);
+
+ // Explicitly specify the handles to the standard streams.
+ si.dwFlags |= STARTF_USESTDHANDLES;
+
+ si.hStdInput = cldStdInRd;
+ si.hStdOutput = cldStdOutWr;
+ si.hStdError = cldStdErrWr;
+
+ if (CreateProcess (NULL,
+ cmdLine,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ env,
+ wdir,
+ &si,
+ &pi) == 0)
+ {
+ sprintf (tmpBuff,
+ "Error creating child process (Win32 Error Code: %lu)",
+ GetLastError ());
+ throw new IOException (JvNewStringLatin1 (tmpBuff));
+ }
+
+ procHandle = (jint ) pi.hProcess;
+
+ // Close the wrong ends (for the parent) of the pipes.
+ CloseHandle (cldStdInRd);
+ CloseHandle (cldStdOutWr);
+ CloseHandle (cldStdErrWr);
+
+ _Jv_Free (cmdLine);
+ if (env != NULL)
+ _Jv_Free (env);
+ if (wdir != NULL)
+ _Jv_Free (wdir);
+ }
+ catch (java::lang::Throwable *thrown)
+ {
+ cleanup ();
+ exc = thrown;
+ }
+
+ if (exc != NULL)
+ throw exc;
+}
diff --git a/libjava/java/math/BigDecimal.java b/libjava/java/math/BigDecimal.java
index 9c6e194a016..a4a4a560e94 100644
--- a/libjava/java/math/BigDecimal.java
+++ b/libjava/java/math/BigDecimal.java
@@ -189,7 +189,9 @@ public class BigDecimal extends Number implements Comparable
{
int exp = Integer.parseInt (num.substring (point));
exp -= scale;
- if (exp > 0)
+ if (signum () == 0)
+ scale = 0;
+ else if (exp > 0)
{
intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp));
scale = 0;
@@ -266,7 +268,7 @@ public class BigDecimal extends Number implements Comparable
throw new ArithmeticException ("scale is negative: " + newScale);
if (intVal.signum () == 0) // handle special case of 0.0/0.0
- return ZERO;
+ return newScale == 0 ? ZERO : new BigDecimal (ZERO.intVal, newScale);
// Ensure that pow gets a non-negative value.
int valScale = val.scale;
diff --git a/libjava/java/math/BigInteger.java b/libjava/java/math/BigInteger.java
index ac21eccc518..6f919f785cc 100644
--- a/libjava/java/math/BigInteger.java
+++ b/libjava/java/math/BigInteger.java
@@ -1,5 +1,5 @@
/* java.math.BigInteger -- Arbitary precision integers
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -110,6 +110,12 @@ public class BigInteger extends Number implements Comparable
109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251 };
+ /** HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Table 4.4. */
+ private static final int[] k =
+ {100,150,200,250,300,350,400,500,600,800,1250, Integer.MAX_VALUE};
+ private static final int[] t =
+ { 27, 18, 15, 12, 9, 8, 7, 6, 5, 4, 3, 2};
+
private BigInteger()
{
}
@@ -218,38 +224,29 @@ public class BigInteger extends Number implements Comparable
}
/** Return a (possibly-shared) BigInteger with a given long value. */
- private static BigInteger make(long value)
+ public static BigInteger valueOf(long val)
{
- if (value >= minFixNum && value <= maxFixNum)
- return smallFixNums[(int)value - minFixNum];
- int i = (int) value;
- if ((long)i == value)
+ if (val >= minFixNum && val <= maxFixNum)
+ return smallFixNums[(int) val - minFixNum];
+ int i = (int) val;
+ if ((long) i == val)
return new BigInteger(i);
BigInteger result = alloc(2);
result.ival = 2;
result.words[0] = i;
- result.words[1] = (int) (value >> 32);
+ result.words[1] = (int)(val >> 32);
return result;
}
- // FIXME: Could simply rename 'make' method above as valueOf while
- // changing all instances of 'make'. Don't do this until this class
- // is done as the Kawa class this is based on has 'make' methods
- // with other parameters; wait to see if they are used in BigInteger.
- public static BigInteger valueOf(long val)
- {
- return make(val);
- }
-
/** Make a canonicalized BigInteger from an array of words.
* The array may be reused (without copying). */
private static BigInteger make(int[] words, int len)
{
if (words == null)
- return make(len);
+ return valueOf(len);
len = BigInteger.wordsNeeded(words, len);
if (len <= 1)
- return len == 0 ? ZERO : make(words[0]);
+ return len == 0 ? ZERO : valueOf(words[0]);
BigInteger num = new BigInteger();
num.words = words;
num.ival = len;
@@ -267,15 +264,15 @@ public class BigInteger extends Number implements Comparable
int bptr = 0;
int word = sign;
for (int i = bytes.length % 4; i > 0; --i, bptr++)
- word = (word << 8) | (((int) bytes[bptr]) & 0xff);
+ word = (word << 8) | (bytes[bptr] & 0xff);
words[--nwords] = word;
// Elements remaining in byte[] are a multiple of 4.
while (nwords > 0)
words[--nwords] = bytes[bptr++] << 24 |
- (((int) bytes[bptr++]) & 0xff) << 16 |
- (((int) bytes[bptr++]) & 0xff) << 8 |
- (((int) bytes[bptr++]) & 0xff);
+ (bytes[bptr++] & 0xff) << 16 |
+ (bytes[bptr++] & 0xff) << 8 |
+ (bytes[bptr++] & 0xff);
return words;
}
@@ -284,9 +281,8 @@ public class BigInteger extends Number implements Comparable
*/
private static BigInteger alloc(int nwords)
{
- if (nwords <= 1)
- return new BigInteger();
BigInteger result = new BigInteger();
+ if (nwords > 1)
result.words = new int[nwords];
return result;
}
@@ -376,12 +372,6 @@ public class BigInteger extends Number implements Comparable
return compareTo(this, val) > 0 ? this : val;
}
- private final boolean isOdd()
- {
- int low = words == null ? ival : words[0];
- return (low & 1) != 0;
- }
-
private final boolean isZero()
{
return words == null && ival == 0;
@@ -392,11 +382,6 @@ public class BigInteger extends Number implements Comparable
return words == null && ival == 1;
}
- private final boolean isMinusOne()
- {
- return words == null && ival == -1;
- }
-
/** Calculate how many words are significant in words[0:len-1].
* Returns the least value x such that x>0 && words[0:x-1]==words[0:len-1],
* when words is viewed as a 2's complement integer.
@@ -433,14 +418,14 @@ public class BigInteger extends Number implements Comparable
words = null;
}
if (words == null && ival >= minFixNum && ival <= maxFixNum)
- return smallFixNums[(int) ival - minFixNum];
+ return smallFixNums[ival - minFixNum];
return this;
}
/** Add two ints, yielding a BigInteger. */
private static final BigInteger add(int x, int y)
{
- return BigInteger.make((long) x + (long) y);
+ return valueOf((long) x + (long) y);
}
/** Add a BigInteger and an int, yielding a new BigInteger. */
@@ -526,13 +511,13 @@ public class BigInteger extends Number implements Comparable
private static BigInteger add(BigInteger x, BigInteger y, int k)
{
if (x.words == null && y.words == null)
- return BigInteger.make((long) k * (long) y.ival + (long) x.ival);
+ return valueOf((long) k * (long) y.ival + (long) x.ival);
if (k != 1)
{
if (k == -1)
y = BigInteger.neg(y);
else
- y = BigInteger.times(y, BigInteger.make(k));
+ y = BigInteger.times(y, valueOf(k));
}
if (x.words == null)
return BigInteger.add(y, x.ival);
@@ -580,7 +565,7 @@ public class BigInteger extends Number implements Comparable
int[] xwords = x.words;
int xlen = x.ival;
if (xwords == null)
- return BigInteger.make((long) xlen * (long) y);
+ return valueOf((long) xlen * (long) y);
boolean negative;
BigInteger result = BigInteger.alloc(xlen + 1);
if (xwords[xlen - 1] < 0)
@@ -662,7 +647,7 @@ public class BigInteger extends Number implements Comparable
xNegative = true;
if (x == Long.MIN_VALUE)
{
- divide(BigInteger.make(x), BigInteger.make(y),
+ divide(valueOf(x), valueOf(y),
quotient, remainder, rounding_mode);
return;
}
@@ -684,7 +669,7 @@ public class BigInteger extends Number implements Comparable
remainder.set(x);
}
else
- divide(BigInteger.make(x), BigInteger.make(y),
+ divide(valueOf(x), valueOf(y),
quotient, remainder, rounding_mode);
return;
}
@@ -966,39 +951,6 @@ public class BigInteger extends Number implements Comparable
return rem.canonicalize();
}
- /** Calculate power for BigInteger exponents.
- * @param y exponent assumed to be non-negative. */
- private BigInteger pow(BigInteger y)
- {
- if (isOne())
- return this;
- if (isMinusOne())
- return y.isOdd () ? this : ONE;
- if (y.words == null && y.ival >= 0)
- return pow(y.ival);
-
- // Assume exponent is non-negative.
- if (isZero())
- return this;
-
- // Implemented by repeated squaring and multiplication.
- BigInteger pow2 = this;
- BigInteger r = null;
- for (;;) // for (i = 0; ; i++)
- {
- // pow2 == x**(2**i)
- // prod = x**(sum(j=0..i-1, (y>>j)&1))
- if (y.isOdd())
- r = r == null ? pow2 : times(r, pow2); // r *= pow2
- y = BigInteger.shift(y, -1);
- if (y.isZero())
- break;
- // pow2 *= pow2;
- pow2 = times(pow2, pow2);
- }
- return r == null ? ONE : r;
- }
-
/** Calculate the integral power of a BigInteger.
* @param exponent the exponent (must be non-negative)
*/
@@ -1008,7 +960,6 @@ public class BigInteger extends Number implements Comparable
{
if (exponent == 0)
return ONE;
- else
throw new ArithmeticException("negative exponent");
}
if (isZero())
@@ -1051,51 +1002,34 @@ public class BigInteger extends Number implements Comparable
private static final int[] euclidInv(int a, int b, int prevDiv)
{
- // Storage for return values, plus one slot for a temp int (see below).
- int[] xy;
-
if (b == 0)
throw new ArithmeticException("not invertible");
- else if (b == 1)
- {
+
+ if (b == 1)
// Success: values are indeed invertible!
// Bottom of the recursion reached; start unwinding.
- xy = new int[3];
- xy[0] = -prevDiv;
- xy[1] = 1;
- return xy;
- }
+ return new int[] { -prevDiv, 1 };
- xy = euclidInv(b, a % b, a / b); // Recursion happens here.
-
- // xy[2] is just temp storage for intermediate results in the following
- // calculation. This saves us a bit of space over having an int
- // allocated at every level of this recursive method.
- xy[2] = xy[0];
- xy[0] = xy[2] * -prevDiv + xy[1];
- xy[1] = xy[2];
+ int[] xy = euclidInv(b, a % b, a / b); // Recursion happens here.
+ a = xy[0]; // use our local copy of 'a' as a work var
+ xy[0] = a * -prevDiv + xy[1];
+ xy[1] = a;
return xy;
}
- private static final BigInteger[]
- euclidInv(BigInteger a, BigInteger b, BigInteger prevDiv)
+ private static final void euclidInv(BigInteger a, BigInteger b,
+ BigInteger prevDiv, BigInteger[] xy)
{
- // FIXME: This method could be more efficient memory-wise and should be
- // modified as such since it is recursive.
-
- // Storage for return values, plus one slot for a temp int (see below).
- BigInteger[] xy;
-
if (b.isZero())
throw new ArithmeticException("not invertible");
- else if (b.isOne())
+
+ if (b.isOne())
{
// Success: values are indeed invertible!
// Bottom of the recursion reached; start unwinding.
- xy = new BigInteger[3];
xy[0] = neg(prevDiv);
- xy[1] = ONE;
- return xy;
+ xy[1] = ONE;
+ return;
}
// Recursion happens in the following conditional!
@@ -1104,9 +1038,8 @@ public class BigInteger extends Number implements Comparable
if (a.words == null)
{
int[] xyInt = euclidInv(b.ival, a.ival % b.ival, a.ival / b.ival);
- xy = new BigInteger[3];
xy[0] = new BigInteger(xyInt[0]);
- xy[1] = new BigInteger(xyInt[1]);
+ xy[1] = new BigInteger(xyInt[1]);
}
else
{
@@ -1116,16 +1049,12 @@ public class BigInteger extends Number implements Comparable
// quot and rem may not be in canonical form. ensure
rem.canonicalize();
quot.canonicalize();
- xy = euclidInv(b, rem, quot);
+ euclidInv(b, rem, quot, xy);
}
- // xy[2] is just temp storage for intermediate results in the following
- // calculation. This saves us a bit of space over having a BigInteger
- // allocated at every level of this recursive method.
- xy[2] = xy[0];
- xy[0] = add(xy[1], times(xy[2], prevDiv), -1);
- xy[1] = xy[2];
- return xy;
+ BigInteger t = xy[0];
+ xy[0] = add(xy[1], times(t, prevDiv), -1);
+ xy[1] = t;
}
public BigInteger modInverse(BigInteger y)
@@ -1136,7 +1065,7 @@ public class BigInteger extends Number implements Comparable
// Degenerate cases.
if (y.isOne())
return ZERO;
- else if (isOne())
+ if (isOne())
return ONE;
// Use Euclid's algorithm as in gcd() but do this recursively
@@ -1144,8 +1073,6 @@ public class BigInteger extends Number implements Comparable
// unwind from the recursion.
// Used http://www.math.nmsu.edu/~crypto/EuclideanAlgo.html as reference.
BigInteger result = new BigInteger();
- int xval = ival;
- int yval = y.ival;
boolean swapped = false;
if (y.words == null)
@@ -1156,8 +1083,8 @@ public class BigInteger extends Number implements Comparable
// math. Note that BigInteger.mod() must be used even if this is
// already an int as the % operator would provide a negative result if
// this is negative, BigInteger.mod() never returns negative values.
- if (words != null || isNegative())
- xval = mod(y).ival;
+ int xval = (words != null || isNegative()) ? mod(y).ival : ival;
+ int yval = y.ival;
// Swap values so x > y.
if (yval > xval)
@@ -1178,16 +1105,13 @@ public class BigInteger extends Number implements Comparable
}
else
{
- BigInteger x = this;
-
// As above, force this to be a positive value via modulo math.
- if (isNegative())
- x = mod(y);
+ BigInteger x = isNegative() ? this.mod(y) : this;
// Swap values so x > y.
if (x.compareTo(y) < 0)
{
- BigInteger tmp = x; x = y; y = tmp;
+ result = x; x = y; y = result; // use 'result' as a work var
swapped = true;
}
// As above (for ints), result will be in the 2nd element unless
@@ -1198,7 +1122,9 @@ public class BigInteger extends Number implements Comparable
// quot and rem may not be in canonical form. ensure
rem.canonicalize();
quot.canonicalize();
- result = euclidInv(y, rem, quot)[swapped ? 0 : 1];
+ BigInteger[] xy = new BigInteger[2];
+ euclidInv(y, rem, quot, xy);
+ result = swapped ? xy[0] : xy[1];
// Result can't be negative, so make it positive by adding the
// original modulus, y (which is now x if they were swapped).
@@ -1222,16 +1148,13 @@ public class BigInteger extends Number implements Comparable
// To do this naively by first raising this to the power of exponent
// and then performing modulo m would be extremely expensive, especially
// for very large numbers. The solution is found in Number Theory
- // where a combination of partial powers and modulos can be done easily.
+ // where a combination of partial powers and moduli can be done easily.
//
// We'll use the algorithm for Additive Chaining which can be found on
// p. 244 of "Applied Cryptography, Second Edition" by Bruce Schneier.
- BigInteger s, t, u;
- int i;
-
- s = ONE;
- t = this;
- u = exponent;
+ BigInteger s = ONE;
+ BigInteger t = this;
+ BigInteger u = exponent;
while (!u.isZero())
{
@@ -1248,24 +1171,22 @@ public class BigInteger extends Number implements Comparable
private static final int gcd(int a, int b)
{
// Euclid's algorithm, copied from libg++.
+ int tmp;
if (b > a)
{
- int tmp = a; a = b; b = tmp;
+ tmp = a; a = b; b = tmp;
}
for(;;)
{
if (b == 0)
return a;
- else if (b == 1)
+ if (b == 1)
return b;
- else
- {
- int tmp = b;
+ tmp = b;
b = a % b;
a = tmp;
}
}
- }
public BigInteger gcd(BigInteger y)
{
@@ -1274,7 +1195,7 @@ public class BigInteger extends Number implements Comparable
if (words == null)
{
if (xval == 0)
- return BigInteger.abs(y);
+ return abs(y);
if (y.words == null
&& xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE)
{
@@ -1282,14 +1203,14 @@ public class BigInteger extends Number implements Comparable
xval = -xval;
if (yval < 0)
yval = -yval;
- return BigInteger.make(BigInteger.gcd(xval, yval));
+ return valueOf(gcd(xval, yval));
}
xval = 1;
}
if (y.words == null)
{
if (yval == 0)
- return BigInteger.abs(this);
+ return abs(this);
yval = 1;
}
int len = (xval > yval ? xval : yval) + 1;
@@ -1304,8 +1225,24 @@ public class BigInteger extends Number implements Comparable
return result.canonicalize();
}
+ /**
+ * <p>Returns <code>true</code> if this BigInteger is probably prime,
+ * <code>false</code> if it's definitely composite. If <code>certainty</code>
+ * is <code><= 0</code>, <code>true</code> is returned.</p>
+ *
+ * @param certainty a measure of the uncertainty that the caller is willing
+ * to tolerate: if the call returns <code>true</code> the probability that
+ * this BigInteger is prime exceeds <code>(1 - 1/2<sup>certainty</sup>)</code>.
+ * The execution time of this method is proportional to the value of this
+ * parameter.
+ * @return <code>true</code> if this BigInteger is probably prime,
+ * <code>false</code> if it's definitely composite.
+ */
public boolean isProbablePrime(int certainty)
{
+ if (certainty < 1)
+ return true;
+
/** We'll use the Rabin-Miller algorithm for doing a probabilistic
* primality test. It is fast, easy and has faster decreasing odds of a
* composite passing than with other tests. This means that this
@@ -1317,19 +1254,20 @@ public class BigInteger extends Number implements Comparable
* Cryptography, Second Edition" by Bruce Schneier.
*/
- // First rule out small prime factors and assure the number is odd.
- for (int i = 0; i < primes.length; i++)
+ // First rule out small prime factors
+ BigInteger rem = new BigInteger();
+ int i;
+ for (i = 0; i < primes.length; i++)
{
if (words == null && ival == primes[i])
return true;
- if (remainder(make(primes[i])).isZero())
+
+ divide(this, smallFixNums[primes[i] - minFixNum], null, rem, TRUNCATE);
+ if (rem.canonicalize().isZero())
return false;
}
// Now perform the Rabin-Miller test.
- // NB: I know that this can be simplified programatically, but
- // I have tried to keep it as close as possible to the algorithm
- // as written in the Schneier book for reference purposes.
// Set b to the number of times 2 evenly divides (this - 1).
// I.e. 2^b is the largest power of 2 that divides (this - 1).
@@ -1337,22 +1275,31 @@ public class BigInteger extends Number implements Comparable
int b = pMinus1.getLowestSetBit();
// Set m such that this = 1 + 2^b * m.
- BigInteger m = pMinus1.divide(make(2L << b - 1));
-
- Random rand = new Random();
- while (certainty-- > 0)
- {
- // Pick a random number greater than 1 and less than this.
- // The algorithm says to pick a small number to make the calculations
- // go faster, but it doesn't say how small; we'll use 2 to 1024.
- int a = rand.nextInt();
- a = (a < 0 ? -a : a) % 1023 + 2;
-
- BigInteger z = make(a).modPow(m, this);
+ BigInteger m = pMinus1.divide(valueOf(2L << b - 1));
+
+ // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Note
+ // 4.49 (controlling the error probability) gives the number of trials
+ // for an error probability of 1/2**80, given the number of bits in the
+ // number to test. we shall use these numbers as is if/when 'certainty'
+ // is less or equal to 80, and twice as much if it's greater.
+ int bits = this.bitLength();
+ for (i = 0; i < k.length; i++)
+ if (bits <= k[i])
+ break;
+ int trials = t[i];
+ if (certainty > 80)
+ trials *= 2;
+ BigInteger z;
+ for (int t = 0; t < trials; t++)
+ {
+ // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al.
+ // Remark 4.28 states: "...A strategy that is sometimes employed
+ // is to fix the bases a to be the first few primes instead of
+ // choosing them at random.
+ z = smallFixNums[primes[t] - minFixNum].modPow(m, this);
if (z.isOne() || z.equals(pMinus1))
continue; // Passes the test; may be prime.
- int i;
for (i = 0; i < b; )
{
if (z.isOne())
@@ -1361,7 +1308,7 @@ public class BigInteger extends Number implements Comparable
if (z.equals(pMinus1))
break; // Passes the test; may be prime.
- z = z.modPow(make(2), this);
+ z = z.modPow(valueOf(2), this);
}
if (i == b && !z.equals(pMinus1))
@@ -1462,9 +1409,9 @@ public class BigInteger extends Number implements Comparable
if (x.words == null)
{
if (count <= 0)
- return make(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0);
+ return valueOf(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0);
if (count < 32)
- return make((long) x.ival << count);
+ return valueOf((long) x.ival << count);
}
if (count == 0)
return x;
@@ -1502,7 +1449,6 @@ public class BigInteger extends Number implements Comparable
work = words;
int len = ival;
- int buf_size = len * (MPN.chars_per_word(radix) + 1);
if (radix == 16)
{
if (neg)
@@ -1555,7 +1501,7 @@ public class BigInteger extends Number implements Comparable
{
if (words == null)
return Integer.toString(ival, radix);
- else if (ival <= 2)
+ if (ival <= 2)
return Long.toString(longValue(), radix);
int buf_size = ival * (MPN.chars_per_word(radix) + 1);
StringBuffer buffer = new StringBuffer(buf_size);
@@ -1605,7 +1551,7 @@ public class BigInteger extends Number implements Comparable
{
if (obj == null || ! (obj instanceof BigInteger))
return false;
- return BigInteger.equals(this, (BigInteger) obj);
+ return equals(this, (BigInteger) obj);
}
private static BigInteger valueOf(String s, int radix)
@@ -1615,7 +1561,7 @@ public class BigInteger extends Number implements Comparable
// Testing (len < MPN.chars_per_word(radix)) would be more accurate,
// but slightly more expensive, for little practical gain.
if (len <= 15 && radix <= 16)
- return BigInteger.make(Long.parseLong(s, radix));
+ return valueOf(Long.parseLong(s, radix));
int byte_len = 0;
byte[] bytes = new byte[len];
@@ -1660,8 +1606,7 @@ public class BigInteger extends Number implements Comparable
if (ival <= 2)
return (double) longValue();
if (isNegative())
- return BigInteger.neg(this).roundToDouble(0, true, false);
- else
+ return neg(this).roundToDouble(0, true, false);
return roundToDouble(0, false, false);
}
@@ -1769,7 +1714,6 @@ public class BigInteger extends Number implements Comparable
* Assumes words.length >= (this.words == null ? 1 : this.ival).
* Result is zero-extended, but need not be a valid 2's complement number.
*/
-
private void getAbsolute(int[] words)
{
int len;
@@ -1820,7 +1764,7 @@ public class BigInteger extends Number implements Comparable
return;
}
realloc(len + 1);
- if (BigInteger.negate(words, x.words, len))
+ if (negate(words, x.words, len))
words[len++] = 0;
ival = len;
}
@@ -1844,7 +1788,7 @@ public class BigInteger extends Number implements Comparable
private static BigInteger neg(BigInteger x)
{
if (x.words == null && x.ival != Integer.MIN_VALUE)
- return make(- x.ival);
+ return valueOf(- x.ival);
BigInteger result = new BigInteger(0);
result.setNegative(x);
return result.canonicalize();
@@ -1852,7 +1796,7 @@ public class BigInteger extends Number implements Comparable
public BigInteger negate()
{
- return BigInteger.neg(this);
+ return neg(this);
}
/** Calculates ceiling(log2(this < 0 ? -this : this+1))
@@ -1862,7 +1806,6 @@ public class BigInteger extends Number implements Comparable
{
if (words == null)
return MPN.intLength(ival);
- else
return MPN.intLength(words, ival);
}
@@ -1913,7 +1856,7 @@ public class BigInteger extends Number implements Comparable
case 1: return x.and(y);
case 3: return x;
case 5: return y;
- case 15: return make(-1);
+ case 15: return valueOf(-1);
}
BigInteger result = new BigInteger();
setBitOp(result, op, x, y);
@@ -2111,15 +2054,15 @@ public class BigInteger extends Number implements Comparable
private static BigInteger and(BigInteger x, int y)
{
if (x.words == null)
- return BigInteger.make(x.ival & y);
+ return valueOf(x.ival & y);
if (y >= 0)
- return BigInteger.make(x.words[0] & y);
+ return valueOf(x.words[0] & y);
int len = x.ival;
int[] words = new int[len];
words[0] = x.words[0] & y;
while (--len > 0)
words[len] = x.words[len];
- return BigInteger.make(words, x.ival);
+ return make(words, x.ival);
}
/** Return the logical (bit-wise) "and" of two BigIntegers. */
@@ -2142,7 +2085,7 @@ public class BigInteger extends Number implements Comparable
words[i] = x.words[i] & y.words[i];
for ( ; i < len; i++)
words[i] = x.words[i];
- return BigInteger.make(words, len);
+ return make(words, len);
}
/** Return the logical (bit-wise) "(inclusive) or" of two BigIntegers. */
diff --git a/libjava/java/net/DatagramSocket.java b/libjava/java/net/DatagramSocket.java
index c286d650b73..334083a6f35 100644
--- a/libjava/java/net/DatagramSocket.java
+++ b/libjava/java/net/DatagramSocket.java
@@ -429,36 +429,38 @@ public class DatagramSocket
}
/**
- * Connects the datagram socket to a specified address/port.
- *
- * @param address The address to connect to.
- * @param port The port to connect to.
+ * This method connects this socket to the specified address and port.
+ * When a datagram socket is connected, it will only send or receive
+ * packets to and from the host to which it is connected. A multicast
+ * socket that is connected may only send and not receive packets.
+ *
+ * @param address The address to connect this socket to.
+ * @param port The port to connect this socket to.
*
* @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If address is null
- * or the port number is illegal.
+ * @exception IllegalArgumentException If address or port are invalid.
* @exception SecurityException If the caller is not allowed to send
- * datagrams to and receive datagrams from the address and port.
+ * datagrams to or receive from this address and port.
*
* @since 1.2
*/
public void connect(InetAddress address, int port)
{
if (address == null)
- throw new IllegalArgumentException ("Address may not be null");
+ throw new IllegalArgumentException ("Connect address may not be null");
if ((port < 1) || (port > 65535))
- throw new IllegalArgumentException ("Port number is illegal");
+ throw new IllegalArgumentException ("Port number is illegal: " + port);
SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkAccept(address.getHostName (), port);
+ sm.checkConnect(address.getHostName(), port);
try
{
- impl.connect (address, port);
- remoteAddress = address;
- remotePort = port;
+ impl.connect (address, port);
+ remoteAddress = address;
+ remotePort = port;
}
catch (SocketException e)
{
@@ -466,8 +468,10 @@ public class DatagramSocket
}
/**
- * Disconnects the datagram socket.
- *
+ * This method disconnects this socket from the address/port it was
+ * conencted to. If the socket was not connected in the first place,
+ * this method does nothing.
+ *
* @since 1.2
*/
public void disconnect()
@@ -476,8 +480,11 @@ public class DatagramSocket
}
/**
- * Receive a datagram packet.
- *
+ * Reads a datagram packet from the socket. Note that this method
+ * will block until a packet is received from the network. On return,
+ * the passed in <code>DatagramPacket</code> is populated with the data
+ * received and all the other information about the packet.
+ *
* @param p The datagram packet to put the incoming data into.
*
* @exception IOException If an error occurs.
@@ -511,7 +518,8 @@ public class DatagramSocket
}
/**
- * Sends a datagram packet.
+ * Sends the specified packet. The host and port to which the packet
+ * are to be sent should be set inside the packet.
*
* @param p The datagram packet to send.
*
diff --git a/libjava/java/net/NetPermission.java b/libjava/java/net/NetPermission.java
index 5b9502b7abe..1807d457d6c 100644
--- a/libjava/java/net/NetPermission.java
+++ b/libjava/java/net/NetPermission.java
@@ -64,7 +64,7 @@ public final class NetPermission extends BasicPermission
/**
* Initializes a new instance of <code>NetPermission</code> with the
- * specified name and value. Note that the value field is irrelevant and is
+ * specified name and perms. Note that the perms field is irrelevant and is
* ignored. This constructor should never need to be used.
*
* @param name The name of this permission
diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java
index 60a7d764cbc..32c2cd53db0 100644
--- a/libjava/java/net/NetworkInterface.java
+++ b/libjava/java/net/NetworkInterface.java
@@ -200,8 +200,9 @@ public final class NetworkInterface
return false;
NetworkInterface tmp = (NetworkInterface) obj;
- return name.equals (tmp.name) &&
- inetAddresses.equals (tmp.inetAddresses);
+
+ return (name.equals (tmp.name)
+ && inetAddresses.equals (tmp.inetAddresses));
}
/**
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index e2f8e637d09..0285c128c77 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -356,7 +356,7 @@ public class ServerSocket
}
catch (SocketException e)
{
- return false;
+ return false;
}
return true;
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index e57c1ed5381..005fd0461b2 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -95,6 +95,7 @@ public class Socket
* might want this behavior.
*
* @specnote This constructor is public since JDK 1.4
+ * @since 1.1
*/
public Socket ()
{
@@ -122,6 +123,8 @@ public class Socket
* <code>Socket</code>
*
* @exception SocketException If an error occurs
+ *
+ * @since 1.1
*/
protected Socket (SocketImpl impl) throws SocketException
{
@@ -180,6 +183,8 @@ public class Socket
* exists and does not allow a connection to the specified host/port or
* binding to the specified local host/port.
* @exception IOException If a connection error occurs.
+ *
+ * @since 1.1
*/
public Socket (String host, int port,
InetAddress localAddr, int localPort) throws IOException
@@ -200,6 +205,8 @@ public class Socket
* @exception IOException If an error occurs
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
+ *
+ * @since 1.1
*/
public Socket (InetAddress address, int port,
InetAddress localAddr, int localPort) throws IOException
@@ -396,6 +403,8 @@ public class Socket
* is not connected, then <code>null</code> is returned.
*
* @return The local address
+ *
+ * @since 1.1
*/
public InetAddress getLocalAddress ()
{
@@ -521,6 +530,8 @@ public class Socket
* @param on true to enable, false to disable
*
* @exception SocketException If an error occurs or Socket is not connected
+ *
+ * @since 1.1
*/
public void setTcpNoDelay (boolean on) throws SocketException
{
@@ -539,6 +550,8 @@ public class Socket
* @return Whether or not TCP_NODELAY is set
*
* @exception SocketException If an error occurs or Socket not connected
+ *
+ * @since 1.1
*/
public boolean getTcpNoDelay() throws SocketException
{
@@ -567,6 +580,8 @@ public class Socket
*
* @exception SocketException If an error occurs or Socket not connected
* @exception IllegalArgumentException If linger is negative
+ *
+ * @since 1.1
*/
public void setSoLinger(boolean on, int linger) throws SocketException
{
@@ -602,6 +617,8 @@ public class Socket
* if SO_LINGER not set
*
* @exception SocketException If an error occurs or Socket is not connected
+ *
+ * @since 1.1
*/
public int getSoLinger() throws SocketException
{
@@ -681,6 +698,8 @@ public class Socket
* 0 if not set
*
* @exception SocketException If an error occurs or Socket not connected
+ *
+ * @since 1.1
*/
public synchronized void setSoTimeout (int timeout) throws SocketException
{
@@ -707,6 +726,8 @@ public class Socket
* if not set
*
* @exception SocketException If an error occurs or Socket not connected
+ *
+ * @since 1.1
*/
public synchronized int getSoTimeout () throws SocketException
{
@@ -822,7 +843,7 @@ public class Socket
*
* @exception SocketException If an error occurs or Socket is not connected
*
- * @since Java 1.3
+ * @since 1.3
*/
public void setKeepAlive (boolean on) throws SocketException
{
@@ -840,7 +861,7 @@ public class Socket
*
* @exception SocketException If an error occurs or Socket is not connected
*
- * @since Java 1.3
+ * @since 1.3
*/
public boolean getKeepAlive () throws SocketException
{
@@ -918,6 +939,8 @@ public class Socket
* Closes the input side of the socket stream.
*
* @exception IOException If an error occurs.
+ *
+ * @since 1.3
*/
public void shutdownInput() throws IOException
{
@@ -931,6 +954,8 @@ public class Socket
* Closes the output side of the socket stream.
*
* @exception IOException If an error occurs.
+ *
+ * @since 1.3
*/
public void shutdownOutput() throws IOException
{
@@ -944,6 +969,8 @@ public class Socket
* Returns the socket channel associated with this socket.
*
* It returns null if no associated socket exists.
+ *
+ * @since 1.4
*/
public SocketChannel getChannel()
{
@@ -1032,6 +1059,8 @@ public class Socket
/**
* Checks if the socket is connected
+ *
+ * @since 1.4
*/
public boolean isConnected ()
{
@@ -1040,6 +1069,8 @@ public class Socket
/**
* Checks if the socket is already bound.
+ *
+ * @since 1.4
*/
public boolean isBound ()
{
@@ -1048,6 +1079,8 @@ public class Socket
/**
* Checks if the socket is closed.
+ *
+ * @since 1.4
*/
public boolean isClosed ()
{
@@ -1056,6 +1089,8 @@ public class Socket
/**
* Checks if the socket's input stream is shutdown
+ *
+ * @since 1.4
*/
public boolean isInputShutdown ()
{
@@ -1064,6 +1099,8 @@ public class Socket
/**
* Checks if the socket's output stream is shutdown
+ *
+ * @since 1.4
*/
public boolean isOutputShutdown ()
{
diff --git a/libjava/java/net/SocketImpl.java b/libjava/java/net/SocketImpl.java
index f0f1a3c87bc..12dcb0b9a5c 100644
--- a/libjava/java/net/SocketImpl.java
+++ b/libjava/java/net/SocketImpl.java
@@ -74,7 +74,7 @@ public abstract class SocketImpl implements SocketOptions
/**
* The port number the socket is bound to locally
*/
- protected int localport;
+ protected int localport = -1;
/**
* The port number of the remote end of the socket connection
diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java
index 18fb7ef2f1f..6fa65f8793a 100644
--- a/libjava/java/net/SocketPermission.java
+++ b/libjava/java/net/SocketPermission.java
@@ -276,62 +276,62 @@ public final class SocketPermission extends Permission
// Get ours
if (hostport.indexOf(":") == -1)
{
- ourfirstport = 0;
- ourlastport = 65535;
+ ourfirstport = 0;
+ ourlastport = 65535;
}
else
{
- // FIXME: Needs bulletproofing.
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- ourfirstport = 0;
- else if (range.indexOf("-") == -1)
- ourfirstport = Integer.parseInt(range);
- else
- ourfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- ourlastport = 65535;
- else if (range.indexOf("-") == -1)
- ourlastport = Integer.parseInt(range);
- else
- ourlastport =
- Integer.parseInt(range.
- substring(range.indexOf("-") + 1,
- range.length()));
+ // FIXME: Needs bulletproofing.
+ // This will dump if hostport if all sorts of bad data was passed to
+ // the constructor
+ String range = hostport.substring(hostport.indexOf(":") + 1);
+ if (range.startsWith("-"))
+ ourfirstport = 0;
+ else if (range.indexOf("-") == -1)
+ ourfirstport = Integer.parseInt(range);
+ else
+ ourfirstport =
+ Integer.parseInt(range.substring(0, range.indexOf("-")));
+
+ if (range.endsWith("-"))
+ ourlastport = 65535;
+ else if (range.indexOf("-") == -1)
+ ourlastport = Integer.parseInt(range);
+ else
+ ourlastport =
+ Integer.parseInt(range.
+ substring(range.indexOf("-") + 1,
+ range.length()));
}
// Get theirs
if (p.hostport.indexOf(":") == -1)
{
- theirfirstport = 0;
- ourlastport = 65535;
+ theirfirstport = 0;
+ ourlastport = 65535;
}
else
{
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = p.hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- theirfirstport = 0;
- else if (range.indexOf("-") == -1)
- theirfirstport = Integer.parseInt(range);
- else
- theirfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- theirlastport = 65535;
- else if (range.indexOf("-") == -1)
- theirlastport = Integer.parseInt(range);
- else
- theirlastport =
- Integer.parseInt(range.
- substring(range.indexOf("-") + 1,
- range.length()));
+ // This will dump if hostport if all sorts of bad data was passed to
+ // the constructor
+ String range = p.hostport.substring(hostport.indexOf(":") + 1);
+ if (range.startsWith("-"))
+ theirfirstport = 0;
+ else if (range.indexOf("-") == -1)
+ theirfirstport = Integer.parseInt(range);
+ else
+ theirfirstport =
+ Integer.parseInt(range.substring(0, range.indexOf("-")));
+
+ if (range.endsWith("-"))
+ theirlastport = 65535;
+ else if (range.indexOf("-") == -1)
+ theirlastport = Integer.parseInt(range);
+ else
+ theirlastport =
+ Integer.parseInt(range.
+ substring(range.indexOf("-") + 1,
+ range.length()));
}
// Now check them
@@ -361,17 +361,17 @@ public final class SocketPermission extends Permission
String ourcanonical = null, theircanonical = null;
try
{
- ourcanonical = InetAddress.getByName(ourhost).getHostName();
- theircanonical = InetAddress.getByName(theirhost).getHostName();
+ ourcanonical = InetAddress.getByName(ourhost).getHostName();
+ theircanonical = InetAddress.getByName(theirhost).getHostName();
}
catch (UnknownHostException e)
{
- // Who didn't resolve? Just assume current address is canonical enough
- // Is this ok to do?
- if (ourcanonical == null)
- ourcanonical = ourhost;
- if (theircanonical == null)
- theircanonical = theirhost;
+ // Who didn't resolve? Just assume current address is canonical enough
+ // Is this ok to do?
+ if (ourcanonical == null)
+ ourcanonical = ourhost;
+ if (theircanonical == null)
+ theircanonical = theirhost;
}
if (ourcanonical.equals(theircanonical))
@@ -380,9 +380,9 @@ public final class SocketPermission extends Permission
// Well, last chance. Try for a wildcard
if (ourhost.indexOf("*.") != -1)
{
- String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1));
- if (theircanonical.endsWith(wild_domain))
- return (true);
+ String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1));
+ if (theircanonical.endsWith(wild_domain))
+ return (true);
}
// Didn't make it
diff --git a/libjava/java/net/URLDecoder.java b/libjava/java/net/URLDecoder.java
index 36747409983..0a9067160b2 100644
--- a/libjava/java/net/URLDecoder.java
+++ b/libjava/java/net/URLDecoder.java
@@ -82,12 +82,12 @@ public class URLDecoder
{
try
{
- return decode(s, "UTF-8");
+ return decode(s, "UTF-8");
}
catch (UnsupportedEncodingException uee)
{
- // Should never happen since UTF-8 encoding should always be supported
- return s;
+ // Should never happen since UTF-8 encoding should always be supported
+ return s;
}
}
diff --git a/libjava/java/nio/Buffer.java b/libjava/java/nio/Buffer.java
index 9474fb453f0..7d291bedbc1 100644
--- a/libjava/java/nio/Buffer.java
+++ b/libjava/java/nio/Buffer.java
@@ -39,11 +39,33 @@ package java.nio;
public abstract class Buffer
{
- int cap = 0;
- int limit = 0;
- int pos = 0;
- int mark = -1;
-
+ private int cap = 0;
+ private int limit = 0;
+ private int pos = 0;
+ private int mark = -1;
+
+ // Creates a new Buffer.
+ //
+ // Should be package private.
+ //
+ Buffer (int capacity, int limit, int position, int mark)
+ {
+ if (capacity < 0)
+ throw new IllegalArgumentException ();
+
+ cap = capacity;
+ limit (limit);
+ position (position);
+
+ if (mark > 0)
+ {
+ if (mark > pos)
+ throw new IllegalArgumentException ();
+
+ this.mark = mark;
+ }
+ }
+
/**
* Retrieves the capacity of the buffer.
*/
diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java
index 874943a8757..8b7c6013019 100644
--- a/libjava/java/nio/ByteBuffer.java
+++ b/libjava/java/nio/ByteBuffer.java
@@ -37,43 +37,574 @@ exception statement from your version. */
package java.nio;
-public abstract class ByteBuffer extends Buffer
+import gnu.java.nio.ByteBufferImpl;
+
+/**
+ * @since 1.4
+ */
+public abstract class ByteBuffer extends Buffer implements Comparable
{
+ private ByteOrder endian = ByteOrder.BIG_ENDIAN;
+
+ int offset;
+ byte[] backing_buffer;
+
+ /**
+ * Allocates a new direct byte buffer.
+ */
+ public static ByteBuffer allocateDirect (int capacity)
+ {
+ throw new Error ("direct buffers are not implemented");
+ }
+
+ /**
+ * Allocates a new byte buffer.
+ */
public static ByteBuffer allocate (int capacity)
{
- return null;
+ return new ByteBufferImpl (capacity, 0, capacity);
}
+ /**
+ * Wraps a byte array into a buffer.
+ *
+ * @exception IndexOutOfBoundsException If the preconditions on the offset
+ * and length parameters do not hold
+ */
final public static ByteBuffer wrap (byte[] array, int offset, int length)
{
- return null;
+ return new ByteBufferImpl (array, offset, length);
}
+ /**
+ * Wraps a byte array into a buffer.
+ */
final public static ByteBuffer wrap (byte[] array)
{
return wrap (array, 0, array.length);
}
-
- final public ByteBuffer put (ByteBuffer src)
+
+ ByteBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ }
+
+ /**
+ * This method transfers bytes from this buffer into
+ * the given destination array.
+ *
+ * @param dst The destination array
+ * @param offset The offset within the array of the first byte to be written;
+ * must be non-negative and no larger than dst.length.
+ * @param length The maximum number of bytes to be written to the given array;
+ * must be non-negative and no larger than dst.length - offset.
+ *
+ * @exception BufferUnderflowException If there are fewer than length bytes
+ * remaining in this buffer.
+ * @exception IndexOutOfBoundsException - If the preconditions on the offset
+ * and length parameters do not hold.
+ */
+ public ByteBuffer get (byte[] dst, int offset, int length)
+ {
+ if ((offset < 0)
+ || (offset > dst.length)
+ || (length < 0)
+ || (length > (dst.length - offset)))
+ throw new IndexOutOfBoundsException ();
+
+ for (int i = offset; i < offset + length; i++)
+ {
+ dst [i] = get();
+ }
+
+ return this;
+ }
+
+ /**
+ * This method transfers bytes from this buffer into the given
+ * destination array.
+ *
+ * @param dst The byte array to write into.
+ *
+ * @exception BufferUnderflowException If there are fewer than dst.length
+ * bytes remaining in this buffer.
+ */
+ public ByteBuffer get (byte[] dst)
{
+ return get (dst, 0, dst.length);
+ }
+
+ /**
+ * Writes the content of src into the buffer.
+ *
+ * @param src The source data.
+ *
+ * @exception BufferOverflowException If there is insufficient space in this
+ * buffer for the remaining bytes in the source buffer.
+ * @exception IllegalArgumentException If the source buffer is this buffer.
+ * @exception ReadOnlyBufferException If this buffer is read only.
+ */
+ public ByteBuffer put (ByteBuffer src)
+ {
+ if (src == this)
+ throw new IllegalArgumentException ();
+
while (src.hasRemaining ())
put (src.get ());
return this;
}
-
- final public ByteBuffer put (byte[] src, int offset, int length)
+
+ /**
+ * Writes the content of the the array src into the buffer.
+ *
+ * @param src The array to copy into the buffer.
+ * @param offset The offset within the array of the first byte to be read;
+ * must be non-negative and no larger than src.length.
+ * @param length The number of bytes to be read from the given array;
+ * must be non-negative and no larger than src.length - offset.
+ *
+ * @exception BufferOverflowException If there is insufficient space in this
+ * buffer for the remaining bytes in the source buffer.
+ * @exception IndexOutOfBoundsException If the preconditions on the offset
+ * and length parameters do not hold.
+ * @exception ReadOnlyBufferException If this buffer is read only.
+ */
+ public ByteBuffer put (byte[] src, int offset, int length)
{
+ if ((offset < 0) ||
+ (offset > src.length) ||
+ (length < 0) ||
+ (length > src.length - offset))
+ throw new IndexOutOfBoundsException ();
+
for (int i = offset; i < offset + length; i++)
put (src [i]);
+
return this;
}
+
+ /**
+ * Writes the content of the the array src into the buffer.
+ *
+ * @param src The array to copy into the buffer.
+ *
+ * @exception BufferOverflowException If there is insufficient space in this
+ * buffer for the remaining bytes in the source buffer.
+ * @exception ReadOnlyBufferException If this buffer is read only.
+ */
public final ByteBuffer put (byte[] src)
{
return put (src, 0, src.length);
}
+ /**
+ * Tells whether or not this buffer is backed by an accessible byte array.
+ */
+ public final boolean hasArray ()
+ {
+ return (backing_buffer != null
+ && !isReadOnly ());
+ }
+
+ /**
+ * Returns the byte array that backs this buffer.
+ *
+ * @exception ReadOnlyBufferException If this buffer is backed by an array
+ * but is read-only.
+ * @exception UnsupportedOperationException If this buffer is not backed
+ * by an accessible array.
+ */
+ public final byte[] array ()
+ {
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return backing_buffer;
+ }
+
+ /**
+ * Returns the offset within this buffer's backing array of the first element
+ * of the buffer
+ *
+ * @exception ReadOnlyBufferException If this buffer is backed by an array
+ * but is read-only.
+ * @exception UnsupportedOperationException If this buffer is not backed
+ * by an accessible array.
+ */
+ public final int arrayOffset ()
+ {
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return offset;
+ }
+
+ /**
+ * Tells whether or not this buffer is equal to another object.
+ */
+ public boolean equals (Object obj)
+ {
+ if (obj != null &&
+ obj instanceof ByteBuffer)
+ {
+ return compareTo (obj) == 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * Compares this buffer to another object.
+ *
+ * @exception ClassCastException If the argument is not a byte buffer
+ */
+ public int compareTo (Object obj)
+ {
+ ByteBuffer a = (ByteBuffer) obj;
+
+ if (a.remaining() != remaining())
+ {
+ return 1;
+ }
+
+ if (! hasArray() ||
+ ! a.hasArray())
+ {
+ return 1;
+ }
+
+ int r = remaining();
+ int i1 = position ();
+ int i2 = a.position ();
+
+ for (int i = 0; i < r; i++)
+ {
+ int t = (int) (get (i1) - a.get (i2));
+
+ if (t != 0)
+ {
+ return (int) t;
+ }
+ }
+
+ return 0;
+ }
+
+ /**
+ * Retrieves this buffer's byte order.
+ */
+ public final ByteOrder order()
+ {
+ return endian;
+ }
+
+ /**
+ * Modifies this buffer's byte order.
+ */
+ public final ByteBuffer order (ByteOrder endian)
+ {
+ this.endian = endian;
+ return this;
+ }
+
+ /**
+ * Reads the byte at this buffer's current position,
+ * and then increments the position.
+ *
+ * @exception BufferUnderflowException If the buffer's current position
+ * is not smaller than its limit.
+ */
public abstract byte get ();
+ /**
+ * Relative put method.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
+ */
public abstract ByteBuffer put (byte b);
+
+ /**
+ * Absolute get method.
+ *
+ * @exception IndexOutOfBoundsException FIXME
+ */
+ public abstract byte get (int index);
+
+ /**
+ * Absolute put method.
+ *
+ * @exception ReadOnlyBufferException If this buffer is read-only
+ * @exception IndexOutOfBoundsException FIXME
+ */
+ public abstract ByteBuffer put (int index, byte b);
+
+ /**
+ * Compacts this buffer.
+ *
+ * @exception ReadOnlyBufferException If this buffer is read-only
+ */
+ public abstract ByteBuffer compact();
+
+ /**
+ * Tells whether or not this buffer is direct.
+ */
+ public abstract boolean isDirect();
+
+ /**
+ * Creates a new byte buffer whose content is a shared subsequence of this
+ * buffer's content.
+ */
+ public abstract ByteBuffer slice();
+
+ /**
+ * Creates a new byte buffer that shares this buffer's content.
+ */
+ public abstract ByteBuffer duplicate();
+
+ /**
+ * Creates a new, read-only byte buffer that shares this buffer's content.
+ */
+ public abstract ByteBuffer asReadOnlyBuffer();
+
+ /**
+ * Creates a view of this byte buffer as a short buffer.
+ */
+ public abstract ShortBuffer asShortBuffer();
+
+ /**
+ * Creates a view of this byte buffer as a char buffer.
+ */
+ public abstract CharBuffer asCharBuffer();
+
+ /**
+ * Creates a view of this byte buffer as an integer buffer.
+ */
+ public abstract IntBuffer asIntBuffer();
+
+ /**
+ * Creates a view of this byte buffer as a long buffer.
+ */
+ public abstract LongBuffer asLongBuffer();
+
+ /**
+ * Creates a view of this byte buffer as a float buffer.
+ */
+ public abstract FloatBuffer asFloatBuffer();
+
+ /**
+ * Creates a view of this byte buffer as a double buffer.
+ */
+ public abstract DoubleBuffer asDoubleBuffer();
+
+ /**
+ * Relative get method for reading a character value.
+ *
+ * @exception BufferUnderflowException If there are fewer than two bytes
+ * remaining in this buffer.
+ */
+ public abstract char getChar();
+
+ /**
+ * Relative put method for writing a character value.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ */
+ public abstract ByteBuffer putChar(char value);
+
+ /**
+ * Absolute get method for reading a character value.
+ *
+ * @exception IndexOutOfBoundsException If there are fewer than two bytes
+ * remaining in this buffer
+ */
+ public abstract char getChar(int index);
+
+ /**
+ * Absolute put method for writing a character value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus one.
+ */
+ public abstract ByteBuffer putChar(int index, char value);
+
+ /**
+ * Relative get method for reading a short value.
+ *
+ * @exception BufferUnderflowException If index is negative or not smaller
+ * than the buffer's limit, minus one.
+ */
+ public abstract short getShort();
+
+ /**
+ * Relative put method for writing a short value.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ */
+ public abstract ByteBuffer putShort(short value);
+
+ /**
+ * Absolute get method for reading a short value.
+ *
+ * @exception IndexOutOfBoundsException If there are fewer than two bytes
+ * remaining in this buffer
+ */
+ public abstract short getShort(int index);
+
+ /**
+ * Absolute put method for writing a short value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus one.
+ */
+ public abstract ByteBuffer putShort(int index, short value);
+
+ /**
+ * Relative get method for reading an integer value.
+ *
+ * @exception BufferUnderflowException If there are fewer than four bytes
+ * remaining in this buffer.
+ */
+ public abstract int getInt();
+
+ /**
+ * Relative put method for writing an integer value.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ */
+ public abstract ByteBuffer putInt(int value);
+
+ /**
+ * Absolute get method for reading an integer value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus three.
+ */
+ public abstract int getInt(int index);
+
+ /**
+ * Absolute put method for writing an integer value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus three.
+ */
+ public abstract ByteBuffer putInt(int index, int value);
+
+ /**
+ * Relative get method for reading a long value.
+ *
+ * @exception BufferUnderflowException If there are fewer than eight bytes
+ * remaining in this buffer.
+ */
+ public abstract long getLong();
+
+ /**
+ * Relative put method for writing a long value.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ */
+ public abstract ByteBuffer putLong(long value);
+
+ /**
+ * Absolute get method for reading a long value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus seven.
+ */
+ public abstract long getLong(int index);
+
+ /**
+ * Absolute put method for writing a float value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus seven.
+ */
+ public abstract ByteBuffer putLong(int index, long value);
+
+ /**
+ * Relative get method for reading a float value.
+ *
+ * @exception BufferUnderflowException If there are fewer than four bytes
+ * remaining in this buffer.
+ */
+ public abstract float getFloat();
+
+ /**
+ * Relative put method for writing a float value.
+ *
+ * @exception BufferOverflowException If there are fewer than four bytes
+ * remaining in this buffer.
+ */
+ public abstract ByteBuffer putFloat(float value);
+
+ /**
+ * Absolute get method for reading a float value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus three.
+ */
+ public abstract float getFloat(int index);
+
+ /**
+ * Relative put method for writing a float value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus three.
+ */
+ public abstract ByteBuffer putFloat(int index, float value);
+
+ /**
+ * Relative get method for reading a double value.
+ *
+ * @exception BufferUnderflowException If there are fewer than eight bytes
+ * remaining in this buffer.
+ */
+ public abstract double getDouble();
+
+ /**
+ * Relative put method for writing a double value.
+ *
+ * @exception BufferOverflowException If this buffer's current position is
+ * not smaller than its limit.
+ */
+ public abstract ByteBuffer putDouble(double value);
+
+ /**
+ * Absolute get method for reading a double value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus seven.
+ */
+ public abstract double getDouble(int index);
+
+ /**
+ * Absolute put method for writing a double value.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit, minus seven.
+ */
+ public abstract ByteBuffer putDouble(int index, double value);
+
+ /**
+ * Returns a string summarizing the state of this buffer.
+ */
+ public String toString ()
+ {
+ return getClass ().getName () +
+ "[pos=" + position () +
+ " lim=" + limit () +
+ " cap=" + capacity () + "]";
+ }
}
diff --git a/libjava/java/nio/CharBuffer.java b/libjava/java/nio/CharBuffer.java
index 2a21ef93ff5..e2996023047 100644
--- a/libjava/java/nio/CharBuffer.java
+++ b/libjava/java/nio/CharBuffer.java
@@ -37,144 +37,226 @@ exception statement from your version. */
package java.nio;
+import gnu.java.nio.CharBufferImpl;
+
+/**
+ * @since 1.4
+ */
public abstract class CharBuffer extends Buffer
+ implements Comparable, CharSequence
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
-
protected char [] backing_buffer;
+ /**
+ * Allocates a new <code>CharBuffer</code> object with a given capacity.
+ */
public static CharBuffer allocate (int capacity)
{
- return null;
+ return new CharBufferImpl (capacity, 0, capacity);
}
/**
+ * Wraps a character array into a <code>CharBuffer</code> object.
+ *
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
*/
final public static CharBuffer wrap (char[] array, int offset, int length)
{
- if ((offset < 0) ||
- (offset > array.length) ||
- (length < 0) ||
- (length > (array.length - offset)))
- throw new IndexOutOfBoundsException ();
-
- return null;
+ return new CharBufferImpl (array, offset, length);
}
+ /**
+ * Wraps a character sequence into a <code>CharBuffer</code> object.
+ */
final public static CharBuffer wrap (CharSequence a)
{
return wrap (a, 0, a.length ());
}
/**
+ * Wraps a character sequence into a <code>CharBuffer</code> object.
+ *
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
*/
final public static CharBuffer wrap (CharSequence a, int offset, int length)
{
- char [] buffer = new char [length];
+ if ((offset < 0)
+ || (offset > a.length ())
+ || (length < 0)
+ || (length > (a.length () - offset)))
+ throw new IndexOutOfBoundsException ();
+
+ char [] buffer = new char [a.length ()];
for (int i = offset; i < length; i++)
{
buffer [i] = a.charAt (i);
}
- return wrap (buffer, 0, length);
+ return wrap (buffer, offset, length);
}
+ /**
+ * Wraps a character array into a <code>CharBuffer</code> object.
+ */
final public static CharBuffer wrap (char[] array)
{
- return wrap (array, 0, array.length);
+ return wrap (array, 0, array.length);
+ }
+
+ CharBuffer (int cap, int lim, int pos, int mark)
+ {
+ super (cap, lim, pos, mark);
}
/**
- * @exception BufferUnderflowException FIXME
+ * Relative get method.
+ *
+ * @exception BufferUnderflowException If the buffer's current position is
+ * not smaller than its limit.
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
*/
- final public CharBuffer get (char[] dst, int offset, int length)
+ public CharBuffer get (char[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
dst [i] = get ();
}
+
return this;
}
/**
- * @exception BufferUnderflowException FIXME
+ * Relative get method.
+ *
+ * @exception BufferUnderflowException If there are fewer than length
+ * characters remaining in this buffer.
*/
- final public CharBuffer get (char[] dst)
+ public CharBuffer get (char[] dst)
{
return get (dst, 0, dst.length);
}
/**
- * @exception BufferOverflowException FIXME
- * @exception IllegalArgumentException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * @exception BufferOverflowException If there are fewer than length of
+ * source buffer characters remaining in this buffer.
+ * @exception IllegalArgumentException If the source buffer is this buffer.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
- final public CharBuffer put (CharBuffer src)
+ public CharBuffer put (CharBuffer src)
{
- while (src.hasRemaining ())
- put (src.get ());
+ if (src == this)
+ throw new IllegalArgumentException ();
+
+ if (src.length () > 0)
+ {
+ char [] toPut = new char [src.length ()];
+ src.get (toPut);
+ src.put (toPut);
+ }
return this;
}
/**
- * @exception BufferOverflowException FIXME
+ * @exception BufferOverflowException If there are fewer then length
+ * characters remaining in this buffer.
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
- * @exception ReadOnlyBufferException FIXME
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
- final public CharBuffer put (char[] src, int offset, int length)
+ public CharBuffer put (char[] src, int offset, int length)
{
+ if (offset < 0
+ || offset >= src.length
+ || length < 0
+ || length >= (src.length - offset))
+ throw new IndexOutOfBoundsException ();
+
+ // Put nothing into this buffer when not enough space left.
+ if (length > remaining ())
+ throw new BufferOverflowException ();
+
for (int i = offset; i < offset + length; i++)
- put (src [i]);
+ {
+ put (src [i]);
+ }
return this;
}
/**
- * @exception BufferOverflowException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * Relative put method.
+ *
+ * @exception BufferOverflowException If there are fewer then length of the
+ * array characters remaining in this buffer.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public final CharBuffer put (char[] src)
{
return put (src, 0, src.length);
}
+ /**
+ * Tells wether this is buffer is backed by an array or not.
+ */
public final boolean hasArray ()
{
- return backing_buffer != null;
+ return (backing_buffer != null
+ && ! isReadOnly ());
}
/**
- * @exception ReadOnlyBufferException FIXME
- * @exception UnsupportedOperationException FIXME
+ * Returns the array that backs this buffer.
+ *
+ * @exception ReadOnlyBufferException If this buffer is read-only.
+ * @exception UnsupportedOperationException If this buffer is not backed
+ * by an accessible array.
*/
public final char[] array ()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
/**
- * @exception ReadOnlyBufferException FIXME
- * @exception UnsupportedOperationException FIXME
+ * Returns the offset to the position of a character in this buffer.
+ *
+ * @exception ReadOnlyBufferException If this buffer is read-only.
+ * @exception UnsupportedOperationException If this buffer is not backed
+ * by an accessible array.
*/
public final int arrayOffset ()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return 0;
}
+ /**
+ * Calculates a hash code for this buffer-
+ */
public int hashCode ()
{
+ // FIXME: Check what SUN calculates here.
return super.hashCode ();
}
+ /**
+ * Checks if this buffer is equal to obj.
+ */
public boolean equals (Object obj)
{
if (obj instanceof CharBuffer)
@@ -184,7 +266,10 @@ public abstract class CharBuffer extends Buffer
}
/**
- * @exception ClassCastException FIXME
+ * Compares two character buffer objects.
+ *
+ * @exception ClassCastException If obj is not an object derived from
+ * <code>CharBuffer</code>.
*/
public int compareTo(Object obj)
{
@@ -197,8 +282,8 @@ public abstract class CharBuffer extends Buffer
return 1;
int r = remaining ();
- int i1 = pos;
- int i2 = a.pos;
+ int i1 = position ();
+ int i2 = a.position ();
for (int i = 0; i < r; i++)
{
@@ -207,85 +292,134 @@ public abstract class CharBuffer extends Buffer
if (t != 0)
return (int) t;
}
+
return 0;
}
/**
- * @exception BufferUnderflowException FIXME
+ * Relative get method.
+ *
+ * @exception BufferUnderflowException If there are no remaining characters
+ * in this buffer.
*/
public abstract char get ();
/**
- * @exception BufferOverflowException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * Relative put method.
+ *
+ * @exception BufferOverflowException If there no remaining characters in
+ * this buffer.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract CharBuffer put (char b);
/**
- * @exception IndexOutOfBoundsException FIXME
+ * Absolute get method.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit.
*/
public abstract char get (int index);
/**
- * @exception IndexOutOfBoundsException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * Absolute put method.
+ *
+ * @exception IndexOutOfBoundsException If index is negative or not smaller
+ * than the buffer's limit.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract CharBuffer put (int index, char b);
/**
- * @exception ReadOnlyBufferException FIXME
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract CharBuffer compact ();
+ /**
+ * Tells wether this buffer is direct or not.
+ */
public abstract boolean isDirect ();
public abstract CharBuffer slice ();
+ /**
+ * Duplicates this buffer.
+ */
public abstract CharBuffer duplicate ();
+ /**
+ * Returns this buffer made read-only.
+ */
public abstract CharBuffer asReadOnlyBuffer ();
+ /**
+ * Returns the remaining content of the buffer as a string.
+ */
public String toString ()
{
- return "";
+ return new String (array (), position (), length ());
}
+ /**
+ * Returns the length of the remaining chars in this buffer.
+ */
public final int length ()
{
- return 0;
+ return remaining ();
}
+ /**
+ * Returns the byte order of this buffer.
+ */
public abstract ByteOrder order ();
/**
- * @exception IndexOutOfBoundsException FIXME
+ * Creates a new character buffer that represents the specified subsequence
+ * of this buffer, relative to the current position.
+ *
+ * @exception IndexOutOfBoundsException If the preconditions on start and
+ * end do not hold.
*/
public abstract CharSequence subSequence (int start, int length);
/**
- * @exception BufferOverflowException FIXME
- * @exception IndexOutOfBoundsException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * Relative put method.
+ *
+ * @exception BufferOverflowException If there is insufficient space in this
+ * buffer.
+ * @exception IndexOutOfBoundsException If the preconditions on the start
+ * and end parameters do not hold.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public CharBuffer put (String str, int start, int length)
{
- return null;
+ return put (str.toCharArray (), start, length);
}
/**
- * @exception BufferOverflowException FIXME
- * @exception ReadOnlyBufferException FIXME
+ * Relative put method.
+ *
+ * @exception BufferOverflowException If there is insufficient space in this
+ * buffer.
+ * @exception ReadOnlyBufferException If this buffer is read-only.
*/
public final CharBuffer put (String str)
{
- return null;
+ return put (str, 0, str.length ());
}
/**
- * @exception IndexOutOfBoundsException FIXME
+ * Returns the character at <code>position() + index</code>.
+ *
+ * @exception IndexOutOfBoundsException If index is negative not smaller than
+ * <code>remaining()</code>.
*/
public final char charAt (int index)
{
- return ' ';
+ if (index < 0
+ || index >= remaining ())
+ throw new IndexOutOfBoundsException ();
+
+ return get (position () + index);
}
}
diff --git a/libjava/java/nio/DoubleBuffer.java b/libjava/java/nio/DoubleBuffer.java
index 7059b6e2430..27f3a16d34e 100644
--- a/libjava/java/nio/DoubleBuffer.java
+++ b/libjava/java/nio/DoubleBuffer.java
@@ -39,14 +39,14 @@ package java.nio;
import gnu.java.nio.DoubleBufferImpl;
-public abstract class DoubleBuffer extends Buffer
+public abstract class DoubleBuffer extends Buffer implements Comparable
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
protected double [] backing_buffer;
+ protected int array_offset;
public static DoubleBuffer allocateDirect(int capacity)
{
- return new DoubleBufferImpl(capacity, 0, capacity);
+ throw new Error ("direct buffers are not implemented");
}
public static DoubleBuffer allocate(int capacity)
@@ -77,7 +77,12 @@ public abstract class DoubleBuffer extends Buffer
return wrap(array, 0, array.length);
}
- final public DoubleBuffer get (double[] dst, int offset, int length)
+ DoubleBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ }
+
+ public DoubleBuffer get (double[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
@@ -87,12 +92,12 @@ public abstract class DoubleBuffer extends Buffer
return this;
}
- final public DoubleBuffer get(double[] dst)
+ public DoubleBuffer get (double[] dst)
{
return get(dst, 0, dst.length);
}
- final public DoubleBuffer put(DoubleBuffer src)
+ public DoubleBuffer put (DoubleBuffer src)
{
while (src.hasRemaining())
put(src.get());
@@ -100,7 +105,7 @@ public abstract class DoubleBuffer extends Buffer
return this;
}
- final public DoubleBuffer put (double[] src, int offset, int length)
+ public DoubleBuffer put (double[] src, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
put(src[i]);
@@ -115,17 +120,30 @@ public abstract class DoubleBuffer extends Buffer
public final boolean hasArray()
{
- return (backing_buffer != null);
+ return (backing_buffer != null
+ && !isReadOnly ());
}
public final double[] array()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
public final int arrayOffset()
{
- return 0;
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return array_offset;
}
public int hashCode()
@@ -172,17 +190,7 @@ public abstract class DoubleBuffer extends Buffer
return 0;
}
- public final ByteOrder order()
- {
- return endian;
- }
-
- public final DoubleBuffer order(ByteOrder bo)
- {
- endian = bo;
- return this;
- }
-
+ public abstract ByteOrder order ();
public abstract double get();
public abstract DoubleBuffer put (double b);
public abstract double get(int index);
@@ -192,34 +200,4 @@ public abstract class DoubleBuffer extends Buffer
public abstract DoubleBuffer slice();
public abstract DoubleBuffer duplicate();
public abstract DoubleBuffer asReadOnlyBuffer();
- public abstract ShortBuffer asShortBuffer();
- public abstract CharBuffer asCharBuffer();
- public abstract IntBuffer asIntBuffer();
- public abstract LongBuffer asLongBuffer();
- public abstract FloatBuffer asFloatBuffer();
- public abstract DoubleBuffer asDoubleBuffer();
- public abstract char getChar();
- public abstract DoubleBuffer putChar(char value);
- public abstract char getChar(int index);
- public abstract DoubleBuffer putChar(int index, char value);
- public abstract short getShort();
- public abstract DoubleBuffer putShort(short value);
- public abstract short getShort(int index);
- public abstract DoubleBuffer putShort(int index, short value);
- public abstract int getInt();
- public abstract DoubleBuffer putInt(int value);
- public abstract int getInt(int index);
- public abstract DoubleBuffer putInt(int index, int value);
- public abstract long getLong();
- public abstract DoubleBuffer putLong(long value);
- public abstract long getLong(int index);
- public abstract DoubleBuffer putLong(int index, long value);
- public abstract float getFloat();
- public abstract DoubleBuffer putFloat(float value);
- public abstract float getFloat(int index);
- public abstract DoubleBuffer putFloat(int index, float value);
- public abstract double getDouble();
- public abstract DoubleBuffer putDouble(double value);
- public abstract double getDouble(int index);
- public abstract DoubleBuffer putDouble(int index, double value);
}
diff --git a/libjava/java/nio/FloatBuffer.java b/libjava/java/nio/FloatBuffer.java
index f06ef187791..16c92d61023 100644
--- a/libjava/java/nio/FloatBuffer.java
+++ b/libjava/java/nio/FloatBuffer.java
@@ -39,14 +39,14 @@ package java.nio;
import gnu.java.nio.FloatBufferImpl;
-public abstract class FloatBuffer extends Buffer
+public abstract class FloatBuffer extends Buffer implements Comparable
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
protected float [] backing_buffer;
+ protected int array_offset;
public static FloatBuffer allocateDirect(int capacity)
{
- return new FloatBufferImpl (capacity, 0, capacity);
+ throw new Error ("direct buffers not implemented");
}
public static FloatBuffer allocate(int capacity)
@@ -77,7 +77,13 @@ public abstract class FloatBuffer extends Buffer
return wrap(array, 0, array.length);
}
- final public FloatBuffer get(float[] dst, int offset, int length)
+ FloatBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ array_offset = 0;
+ }
+
+ public FloatBuffer get (float[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
@@ -87,12 +93,12 @@ public abstract class FloatBuffer extends Buffer
return this;
}
- final public FloatBuffer get(float[] dst)
+ public FloatBuffer get (float[] dst)
{
return get(dst, 0, dst.length);
}
- final public FloatBuffer put(FloatBuffer src)
+ public FloatBuffer put (FloatBuffer src)
{
while (src.hasRemaining())
put(src.get());
@@ -100,7 +106,7 @@ public abstract class FloatBuffer extends Buffer
return this;
}
- final public FloatBuffer put(float[] src, int offset, int length)
+ public FloatBuffer put (float[] src, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
put(src[i]);
@@ -115,17 +121,30 @@ public abstract class FloatBuffer extends Buffer
public final boolean hasArray()
{
- return (backing_buffer != null);
+ return (backing_buffer != null
+ && !isReadOnly ());
}
public final float[] array()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
public final int arrayOffset()
{
- return 0;
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return array_offset;
}
public int hashCode()
@@ -139,6 +158,7 @@ public abstract class FloatBuffer extends Buffer
{
return compareTo(obj) == 0;
}
+
return false;
}
@@ -171,17 +191,7 @@ public abstract class FloatBuffer extends Buffer
return 0;
}
- public final ByteOrder order()
- {
- return endian;
- }
-
- public final FloatBuffer order(ByteOrder bo)
- {
- endian = bo;
- return this;
- }
-
+ public abstract ByteOrder order ();
public abstract float get();
public abstract java.nio. FloatBuffer put(float b);
public abstract float get(int index);
@@ -191,34 +201,4 @@ public abstract class FloatBuffer extends Buffer
public abstract FloatBuffer slice();
public abstract FloatBuffer duplicate();
public abstract FloatBuffer asReadOnlyBuffer();
- public abstract ShortBuffer asShortBuffer();
- public abstract CharBuffer asCharBuffer();
- public abstract IntBuffer asIntBuffer();
- public abstract LongBuffer asLongBuffer();
- public abstract FloatBuffer asFloatBuffer();
- public abstract DoubleBuffer asDoubleBuffer();
- public abstract char getChar();
- public abstract FloatBuffer putChar(char value);
- public abstract char getChar(int index);
- public abstract FloatBuffer putChar(int index, char value);
- public abstract short getShort();
- public abstract FloatBuffer putShort(short value);
- public abstract short getShort(int index);
- public abstract FloatBuffer putShort(int index, short value);
- public abstract int getInt();
- public abstract FloatBuffer putInt(int value);
- public abstract int getInt(int index);
- public abstract FloatBuffer putInt(int index, int value);
- public abstract long getLong();
- public abstract FloatBuffer putLong(long value);
- public abstract long getLong(int index);
- public abstract FloatBuffer putLong(int index, long value);
- public abstract float getFloat();
- public abstract FloatBuffer putFloat(float value);
- public abstract float getFloat(int index);
- public abstract FloatBuffer putFloat(int index, float value);
- public abstract double getDouble();
- public abstract FloatBuffer putDouble(double value);
- public abstract double getDouble(int index);
- public abstract FloatBuffer putDouble(int index, double value);
}
diff --git a/libjava/java/nio/IntBuffer.java b/libjava/java/nio/IntBuffer.java
index d2d28d36b10..18e353b2013 100644
--- a/libjava/java/nio/IntBuffer.java
+++ b/libjava/java/nio/IntBuffer.java
@@ -39,14 +39,14 @@ package java.nio;
import gnu.java.nio.IntBufferImpl;
-public abstract class IntBuffer extends Buffer
+public abstract class IntBuffer extends Buffer implements Comparable
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
protected int [] backing_buffer;
+ protected int array_offset;
public static IntBuffer allocateDirect(int capacity)
{
- return new IntBufferImpl (capacity, 0, capacity);
+ throw new Error ("direct buffers not implemented");
}
public static IntBuffer allocate(int capacity)
@@ -77,7 +77,13 @@ public abstract class IntBuffer extends Buffer
return wrap(array, 0, array.length);
}
- final public IntBuffer get(int[] dst, int offset, int length)
+ IntBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ array_offset = 0;
+ }
+
+ public IntBuffer get(int[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
@@ -87,12 +93,12 @@ public abstract class IntBuffer extends Buffer
return this;
}
- final public IntBuffer get(int[] dst)
+ public IntBuffer get (int[] dst)
{
return get(dst, 0, dst.length);
}
- final public IntBuffer put(IntBuffer src)
+ public IntBuffer put (IntBuffer src)
{
while (src.hasRemaining())
put(src.get());
@@ -100,7 +106,7 @@ public abstract class IntBuffer extends Buffer
return this;
}
- final public IntBuffer put(int[] src, int offset, int length)
+ public IntBuffer put (int[] src, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
put(src[i]);
@@ -115,17 +121,30 @@ public abstract class IntBuffer extends Buffer
public final boolean hasArray()
{
- return (backing_buffer != null);
+ return (backing_buffer != null
+ && !isReadOnly ());
}
public final int[] array()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
public final int arrayOffset()
{
- return 0;
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return array_offset;
}
public int hashCode()
@@ -172,17 +191,7 @@ public abstract class IntBuffer extends Buffer
return 0;
}
- public final ByteOrder order()
- {
- return endian;
- }
-
- public final IntBuffer order(ByteOrder bo)
- {
- endian = bo;
- return this;
- }
-
+ public abstract ByteOrder order();
public abstract int get();
public abstract IntBuffer put(int b);
public abstract int get(int index);
@@ -192,34 +201,4 @@ public abstract class IntBuffer extends Buffer
public abstract IntBuffer slice();
public abstract IntBuffer duplicate();
public abstract IntBuffer asReadOnlyBuffer();
- public abstract ShortBuffer asShortBuffer();
- public abstract CharBuffer asCharBuffer();
- public abstract IntBuffer asIntBuffer();
- public abstract LongBuffer asLongBuffer();
- public abstract FloatBuffer asFloatBuffer();
- public abstract DoubleBuffer asDoubleBuffer();
- public abstract char getChar();
- public abstract IntBuffer putChar(char value);
- public abstract char getChar(int index);
- public abstract IntBuffer putChar(int index, char value);
- public abstract short getShort();
- public abstract IntBuffer putShort(short value);
- public abstract short getShort(int index);
- public abstract IntBuffer putShort(int index, short value);
- public abstract int getInt();
- public abstract IntBuffer putInt(int value);
- public abstract int getInt(int index);
- public abstract IntBuffer putInt(int index, int value);
- public abstract long getLong();
- public abstract IntBuffer putLong(long value);
- public abstract long getLong(int index);
- public abstract IntBuffer putLong(int index, long value);
- public abstract float getFloat();
- public abstract IntBuffer putFloat(float value);
- public abstract float getFloat(int index);
- public abstract IntBuffer putFloat(int index, float value);
- public abstract double getDouble();
- public abstract IntBuffer putDouble(double value);
- public abstract double getDouble(int index);
- public abstract IntBuffer putDouble(int index, double value);
}
diff --git a/libjava/java/nio/LongBuffer.java b/libjava/java/nio/LongBuffer.java
index 5bca6d53b70..8b737194d0c 100644
--- a/libjava/java/nio/LongBuffer.java
+++ b/libjava/java/nio/LongBuffer.java
@@ -39,14 +39,14 @@ package java.nio;
import gnu.java.nio.LongBufferImpl;
-public abstract class LongBuffer extends Buffer
+public abstract class LongBuffer extends Buffer implements Comparable
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
protected long [] backing_buffer;
+ protected int array_offset;
public static LongBuffer allocateDirect(int capacity)
{
- return new LongBufferImpl(capacity, 0, capacity);
+ throw new Error ("direct buffers not implemented");
}
public static LongBuffer allocate(int capacity)
@@ -77,7 +77,13 @@ public abstract class LongBuffer extends Buffer
return wrap(array, 0, array.length);
}
- final public LongBuffer get(long[] dst, int offset, int length)
+ LongBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ array_offset = 0;
+ }
+
+ public LongBuffer get (long[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
@@ -87,12 +93,12 @@ public abstract class LongBuffer extends Buffer
return this;
}
- final public LongBuffer get(long[] dst)
+ public LongBuffer get (long[] dst)
{
return get(dst, 0, dst.length);
}
- final public LongBuffer put(LongBuffer src)
+ public LongBuffer put (LongBuffer src)
{
while (src.hasRemaining())
put(src.get());
@@ -100,7 +106,7 @@ public abstract class LongBuffer extends Buffer
return this;
}
- final public LongBuffer put(long[] src, int offset, int length)
+ public LongBuffer put (long[] src, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
put(src[i]);
@@ -115,17 +121,30 @@ public abstract class LongBuffer extends Buffer
public final boolean hasArray()
{
- return (backing_buffer != null);
+ return (backing_buffer != null
+ && !isReadOnly ());
}
public final long[] array()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
public final int arrayOffset()
{
- return 0;
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return array_offset;
}
public int hashCode()
@@ -173,17 +192,7 @@ public abstract class LongBuffer extends Buffer
return 0;
}
- public final ByteOrder order()
- {
- return endian;
- }
-
- public final LongBuffer order(ByteOrder bo)
- {
- endian = bo;
- return this;
- }
-
+ public abstract ByteOrder order();
public abstract long get();
public abstract java.nio. LongBuffer put(long b);
public abstract long get(int index);
@@ -193,34 +202,4 @@ public abstract class LongBuffer extends Buffer
public abstract LongBuffer slice();
public abstract LongBuffer duplicate();
public abstract LongBuffer asReadOnlyBuffer();
- public abstract ShortBuffer asShortBuffer();
- public abstract CharBuffer asCharBuffer();
- public abstract IntBuffer asIntBuffer();
- public abstract LongBuffer asLongBuffer();
- public abstract FloatBuffer asFloatBuffer();
- public abstract DoubleBuffer asDoubleBuffer();
- public abstract char getChar();
- public abstract LongBuffer putChar(char value);
- public abstract char getChar(int index);
- public abstract LongBuffer putChar(int index, char value);
- public abstract short getShort();
- public abstract LongBuffer putShort(short value);
- public abstract short getShort(int index);
- public abstract LongBuffer putShort(int index, short value);
- public abstract int getInt();
- public abstract LongBuffer putInt(int value);
- public abstract int getInt(int index);
- public abstract LongBuffer putInt(int index, int value);
- public abstract long getLong();
- public abstract LongBuffer putLong(long value);
- public abstract long getLong(int index);
- public abstract LongBuffer putLong(int index, long value);
- public abstract float getFloat();
- public abstract LongBuffer putFloat(float value);
- public abstract float getFloat(int index);
- public abstract LongBuffer putFloat(int index, float value);
- public abstract double getDouble();
- public abstract LongBuffer putDouble(double value);
- public abstract double getDouble(int index);
- public abstract LongBuffer putDouble(int index, double value);
}
diff --git a/libjava/java/nio/MappedByteBuffer.java b/libjava/java/nio/MappedByteBuffer.java
index dc1b20d892c..305327b74c5 100644
--- a/libjava/java/nio/MappedByteBuffer.java
+++ b/libjava/java/nio/MappedByteBuffer.java
@@ -37,6 +37,29 @@ exception statement from your version. */
package java.nio;
+/**
+ * @author Michael Koch
+ * @since 1.4
+ */
public abstract class MappedByteBuffer extends ByteBuffer
{
+ MappedByteBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ }
+
+ public final MappedByteBuffer force ()
+ {
+ return this;
+ }
+
+ public final boolean isLoaded ()
+ {
+ return true;
+ }
+
+ public final MappedByteBuffer load ()
+ {
+ return this;
+ }
}
diff --git a/libjava/java/nio/ShortBuffer.java b/libjava/java/nio/ShortBuffer.java
index 5301366ceee..8c5915dc148 100644
--- a/libjava/java/nio/ShortBuffer.java
+++ b/libjava/java/nio/ShortBuffer.java
@@ -39,14 +39,14 @@ package java.nio;
import gnu.java.nio.ShortBufferImpl;
-public abstract class ShortBuffer extends Buffer
+public abstract class ShortBuffer extends Buffer implements Comparable
{
- private ByteOrder endian = ByteOrder.BIG_ENDIAN;
protected short [] backing_buffer;
+ protected int array_offset;
public static ShortBuffer allocateDirect(int capacity)
{
- return new ShortBufferImpl(capacity, 0, capacity);
+ throw new Error ("direct buffers not implemented");
}
public static ShortBuffer allocate(int capacity)
@@ -77,7 +77,13 @@ public abstract class ShortBuffer extends Buffer
return wrap(array, 0, array.length);
}
- final public ShortBuffer get(short[] dst, int offset, int length)
+ ShortBuffer (int capacity, int limit, int position, int mark)
+ {
+ super (capacity, limit, position, mark);
+ array_offset = 0;
+ }
+
+ public ShortBuffer get (short[] dst, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
{
@@ -87,12 +93,12 @@ public abstract class ShortBuffer extends Buffer
return this;
}
- final public ShortBuffer get(short[] dst)
+ public ShortBuffer get (short[] dst)
{
return get(dst, 0, dst.length);
}
- final public ShortBuffer put(ShortBuffer src)
+ public ShortBuffer put (ShortBuffer src)
{
while (src.hasRemaining())
put(src.get());
@@ -100,7 +106,7 @@ public abstract class ShortBuffer extends Buffer
return this;
}
- final public ShortBuffer put(short[] src, int offset, int length)
+ public ShortBuffer put (short[] src, int offset, int length)
{
for (int i = offset; i < offset + length; i++)
put(src[i]);
@@ -115,17 +121,30 @@ public abstract class ShortBuffer extends Buffer
public final boolean hasArray()
{
- return (backing_buffer != null);
+ return (backing_buffer != null
+ && !isReadOnly ());
}
public final short[] array()
{
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
return backing_buffer;
}
public final int arrayOffset()
{
- return 0;
+ if (backing_buffer == null)
+ throw new UnsupportedOperationException ();
+
+ if (isReadOnly ())
+ throw new ReadOnlyBufferException ();
+
+ return array_offset;
}
public int hashCode()
@@ -173,17 +192,7 @@ public abstract class ShortBuffer extends Buffer
return 0;
}
- public final ByteOrder order()
- {
- return endian;
- }
-
- public final ShortBuffer order(ByteOrder bo)
- {
- endian = bo;
- return this;
- }
-
+ public abstract ByteOrder order ();
public abstract short get();
public abstract java.nio. ShortBuffer put(short b);
public abstract short get(int index);
@@ -193,34 +202,4 @@ public abstract class ShortBuffer extends Buffer
public abstract ShortBuffer slice();
public abstract ShortBuffer duplicate();
public abstract ShortBuffer asReadOnlyBuffer();
- public abstract ShortBuffer asShortBuffer();
- public abstract CharBuffer asCharBuffer();
- public abstract IntBuffer asIntBuffer();
- public abstract LongBuffer asLongBuffer();
- public abstract FloatBuffer asFloatBuffer();
- public abstract DoubleBuffer asDoubleBuffer();
- public abstract char getChar();
- public abstract ShortBuffer putChar(char value);
- public abstract char getChar(int index);
- public abstract ShortBuffer putChar(int index, char value);
- public abstract short getShort();
- public abstract ShortBuffer putShort(short value);
- public abstract short getShort(int index);
- public abstract ShortBuffer putShort(int index, short value);
- public abstract int getInt();
- public abstract ShortBuffer putInt(int value);
- public abstract int getInt(int index);
- public abstract ShortBuffer putInt(int index, int value);
- public abstract long getLong();
- public abstract ShortBuffer putLong(long value);
- public abstract long getLong(int index);
- public abstract ShortBuffer putLong(int index, long value);
- public abstract float getFloat();
- public abstract ShortBuffer putFloat(float value);
- public abstract float getFloat(int index);
- public abstract ShortBuffer putFloat(int index, float value);
- public abstract double getDouble();
- public abstract ShortBuffer putDouble(double value);
- public abstract double getDouble(int index);
- public abstract ShortBuffer putDouble(int index, double value);
}
diff --git a/libjava/java/nio/channels/DatagramChannel.java b/libjava/java/nio/channels/DatagramChannel.java
index 6c457557b95..4a7ac9825f7 100644
--- a/libjava/java/nio/channels/DatagramChannel.java
+++ b/libjava/java/nio/channels/DatagramChannel.java
@@ -88,7 +88,7 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException The channel's socket is not connected.
*/
- public final long write (ByteBuffer[] srcs)
+ public final long write (ByteBuffer[] srcs) throws IOException
{
long b = 0;
@@ -111,14 +111,15 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/
- public abstract DatagramChannel connect (SocketAddress remote);
+ public abstract DatagramChannel connect (SocketAddress remote)
+ throws IOException;
/**
* Disonnects this channel's socket.
*
* @exception IOException If an error occurs
*/
- public abstract DatagramChannel disconnect ();
+ public abstract DatagramChannel disconnect () throws IOException;
/**
* Tells whether or not this channel's socket is connected.
@@ -131,7 +132,7 @@ public abstract class DatagramChannel
/**
* Reads data from this channel.
*/
- public abstract int read (ByteBuffer dst);
+ public abstract int read (ByteBuffer dst) throws IOException;
/**
* Reads data from this channel.
@@ -139,7 +140,8 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/
- public abstract long read (ByteBuffer[] dsts, int offset, int length);
+ public abstract long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException;
/**
* Receives a datagram via this channel.
@@ -154,7 +156,7 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/
- public abstract SocketAddress receive (ByteBuffer dst);
+ public abstract SocketAddress receive (ByteBuffer dst) throws IOException;
/**
* Sends a datagram via this channel.
@@ -169,7 +171,8 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/
- public abstract int send (ByteBuffer src, SocketAddress target);
+ public abstract int send (ByteBuffer src, SocketAddress target)
+ throws IOException;
/**
* Retrieves the channel's socket.
@@ -182,7 +185,7 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/
- public abstract int write (ByteBuffer src);
+ public abstract int write (ByteBuffer src) throws IOException;
/**
* Writes data to this channel.
@@ -190,7 +193,8 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/
- public abstract long write (ByteBuffer[] srcs, int offset, int length);
+ public abstract long write (ByteBuffer[] srcs, int offset, int length)
+ throws IOException;
/**
* Retrieves the valid operations for this channel.
diff --git a/libjava/java/nio/channels/FileChannel.java b/libjava/java/nio/channels/FileChannel.java
index 8970b983923..3fa0f35843e 100644
--- a/libjava/java/nio/channels/FileChannel.java
+++ b/libjava/java/nio/channels/FileChannel.java
@@ -65,9 +65,17 @@ public abstract class FileChannel extends AbstractInterruptibleChannel
m = a;
}
+ /**
+ * Returns a string representation of the <code>MapMode</code> object.
+ */
public String toString()
{
- return "" + m;
+ if (this == READ_ONLY)
+ return "READ_ONLY";
+ else if (this == READ_WRITE)
+ return "READ_WRITE";
+
+ return "PRIVATE";
}
}
@@ -81,20 +89,28 @@ public abstract class FileChannel extends AbstractInterruptibleChannel
/**
* Maps the file into the memory.
*
- * @exception IOException If an error occurs.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If mode is READ_ONLY but this channel was
+ * not opened for reading.
+ * @exception NonWritableChannelException If mode is READ_WRITE or PRIVATE but this
+ * channel was not opened for writing.
*/
public abstract MappedByteBuffer map(MapMode mode, long position, long size)
throws IOException;
/**
* Return the size of the file thus far
+ *
+ * @exception ClosedChannelException If this channel is closed.
*/
public abstract long size() throws IOException;
/**
* Writes data to the channel.
*
- * @exception IOException If an error occurs.
+ * @exception IOException If an I/O error occurs.
*/
public long write (ByteBuffer[] srcs) throws IOException
{
@@ -110,26 +126,243 @@ public abstract class FileChannel extends AbstractInterruptibleChannel
/**
* Writes data to the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract int write (ByteBuffer src) throws IOException;
+
+ /**
+ * Writes data to the channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If position is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
+ */
+ public abstract int write (ByteBuffer srcs, long position) throws IOException;
+
+ /**
+ * Writes data to the channel.
+ *
+ * @exception IOException If an I/O error occurs.
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;
/**
* Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException;
+
+ /**
+ * Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public final long read (ByteBuffer[] dsts) throws IOException
+ {
+ long result = 0;
+
+ for (int i = 0; i < dsts.length; i++)
+ {
+ read (dsts [i]);
+ }
+
+ return result;
+ }
+
+ /**
+ * Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
*/
public abstract int read(ByteBuffer dst) throws IOException;
/**
+ * Reads data from the channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If position is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading.
+ */
+ public abstract int read(ByteBuffer dst, long position) throws IOException;
+
+ /**
* Closes the channel.
*
* This is called from @see close.
*
- * @exception IOException If an error occurs.
+ * @exception IOException If an I/O error occurs.
*/
protected abstract void implCloseChannel() throws IOException;
/**
* msync with the disk
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract void force(boolean metaData) throws IOException;
+
+ /**
+ * Creates a file lock for the whole assoziated file.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception FileLockInterruptionException If the invoking thread is
+ * interrupted while blocked in this method.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If shared is true and this channel
+ * was not opened for reading.
+ * @exception NonWritableChannelException If shared is false and this channel
+ * was not opened for writing.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public final FileLock lock () throws IOException
+ {
+ return lock (0, Long.MAX_VALUE, false);
+ }
+
+ /**
+ * Creates a file lock for a region of the assoziated file.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception FileLockInterruptionException If the invoking thread is
+ * interrupted while blocked in this method.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ * @exception NonReadableChannelException If shared is true and this channel
+ * was not opened for reading.
+ * @exception NonWritableChannelException If shared is false and this channel
+ * was not opened for writing.
+ */
+ public abstract FileLock lock (long position, long size, boolean shared)
+ throws IOException;
+
+ /**
+ * Tries to aqquire alock on the whole assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public final FileLock tryLock () throws IOException
+ {
+ return tryLock (0, Long.MAX_VALUE, false);
+ }
+
+ /**
+ * Tries to aqquire a lock on a region of the assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public abstract FileLock tryLock (long position, long size, boolean shared)
+ throws IOException;
+
+ /**
+ * Returns the current position on the file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract long position () throws IOException;
+
+ /**
+ * Sets the position of the channel on the assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If newPosition is negative.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract FileChannel position (long newPosition) throws IOException;
+
+ /**
+ * Transfers bytes from this channel's file to the given writable byte
+ * channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading.
+ * @exception NonWritableChannelException If the target channel was not
+ * opened for writing.
+ */
+ public abstract long transferTo (long position, long count,
+ WritableByteChannel target)
+ throws IOException;
+
+ /**
+ * Transfers bytes from the given readable channel into this channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If the source channel was not
+ * opened for reading.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
+ */
+ public abstract long transferFrom (ReadableByteChannel src, long position,
+ long count) throws IOException;
+
+ /**
+ * Truncates the channel's file at <code>size</code>.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If size is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
*/
- public abstract void force(boolean metaData);
+ public abstract FileChannel truncate (long size) throws IOException;
}
diff --git a/libjava/java/nio/channels/Pipe.java b/libjava/java/nio/channels/Pipe.java
index 22f3d156f68..939d7b52ad2 100644
--- a/libjava/java/nio/channels/Pipe.java
+++ b/libjava/java/nio/channels/Pipe.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.nio.channels;
+import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel;
import java.nio.channels.spi.SelectorProvider;
@@ -104,7 +105,7 @@ public abstract class Pipe
*
* @exception IOException If an error occurs
*/
- public static Pipe open()
+ public static Pipe open() throws IOException
{
return SelectorProvider.provider ().openPipe();
}
diff --git a/libjava/java/nio/channels/SelectableChannel.java b/libjava/java/nio/channels/SelectableChannel.java
index 2bc5cc47e35..72abac89654 100644
--- a/libjava/java/nio/channels/SelectableChannel.java
+++ b/libjava/java/nio/channels/SelectableChannel.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.nio.channels;
+import java.io.IOException;
import java.nio.channels.spi.AbstractInterruptibleChannel;
import java.nio.channels.spi.SelectorProvider;
@@ -67,7 +68,8 @@ public abstract class SelectableChannel
* is registered with one or more selectors.
* @exception IOException If an error occurs.
*/
- public abstract SelectableChannel configureBlocking (boolean block);
+ public abstract SelectableChannel configureBlocking (boolean block)
+ throws IOException;
/**
* Tells whether this channel is blocking or not.
diff --git a/libjava/java/nio/channels/SelectionKey.java b/libjava/java/nio/channels/SelectionKey.java
index 8d06a301143..39b66f1902a 100644
--- a/libjava/java/nio/channels/SelectionKey.java
+++ b/libjava/java/nio/channels/SelectionKey.java
@@ -43,10 +43,10 @@ package java.nio.channels;
*/
public abstract class SelectionKey
{
- public static final int OP_ACCEPT = 1<<0;
- public static final int OP_CONNECT = 1<<1;
- public static final int OP_READ = 1<<2;
- public static final int OP_WRITE = 1<<3;
+ public static final int OP_ACCEPT = 16;
+ public static final int OP_CONNECT = 8;
+ public static final int OP_READ = 1;
+ public static final int OP_WRITE = 4;
Object attached;
diff --git a/libjava/java/nio/channels/ServerSocketChannel.java b/libjava/java/nio/channels/ServerSocketChannel.java
index 16a3a82df5b..e41af212623 100644
--- a/libjava/java/nio/channels/ServerSocketChannel.java
+++ b/libjava/java/nio/channels/ServerSocketChannel.java
@@ -73,7 +73,7 @@ public abstract class ServerSocketChannel
* @exception SecurityException If a security manager has been installed and
* it does not permit access to the remote endpoint of the new connection.
*/
- public abstract SocketChannel accept ();
+ public abstract SocketChannel accept () throws IOException;
/**
* Retrieves the channels socket.
diff --git a/libjava/java/nio/channels/SocketChannel.java b/libjava/java/nio/channels/SocketChannel.java
index 368a8ee468c..c22eb1d1945 100644
--- a/libjava/java/nio/channels/SocketChannel.java
+++ b/libjava/java/nio/channels/SocketChannel.java
@@ -49,6 +49,7 @@ import java.net.SocketAddress;
* @since 1.4
*/
abstract public class SocketChannel extends AbstractSelectableChannel
+ implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
{
/**
* Initializes this socket.
@@ -100,7 +101,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public final long read (ByteBuffer[] dsts)
+ public final long read (ByteBuffer[] dsts) throws IOException
{
long b = 0;
@@ -118,7 +119,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public final long write (ByteBuffer[] dsts)
+ public final long write (ByteBuffer[] dsts) throws IOException
{
long b = 0;
@@ -144,7 +145,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public abstract int read (ByteBuffer dst);
+ public abstract int read (ByteBuffer dst) throws IOException;
/**
* Connects the channel's socket to the remote address.
@@ -179,7 +180,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception NoConnectionPendingException If this channel is not connected
* and a connection operation has not been initiated.
*/
- public abstract boolean finishConnect ();
+ public abstract boolean finishConnect () throws IOException;
/**
* Tells whether or not the channel's socket is connected.
@@ -197,7 +198,8 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public abstract long read (ByteBuffer[] dsts, int offset, int length);
+ public abstract long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException;
/**
* Retrieves the channel's socket.
@@ -210,7 +212,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public abstract int write (ByteBuffer src);
+ public abstract int write (ByteBuffer src) throws IOException;
/**
* Writes data to the channel.
@@ -218,5 +220,6 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
- public abstract long write (ByteBuffer[] srcs, int offset, int length);
+ public abstract long write (ByteBuffer[] srcs, int offset, int length)
+ throws IOException;
}
diff --git a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java b/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
index 855087b5f07..dd4177a8a01 100644
--- a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.nio.channels.spi;
import java.io.IOException;
+import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.Channel;
import java.nio.channels.InterruptibleChannel;
@@ -84,6 +85,7 @@ public abstract class AbstractInterruptibleChannel
* I/O operation was interrupted.
*/
protected final void end (boolean completed)
+ throws AsynchronousCloseException
{
}
diff --git a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
index da03693d2cc..b13bb4af24f 100644
--- a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
@@ -75,6 +75,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
* Adjusts this channel's blocking mode.
*/
public final SelectableChannel configureBlocking (boolean block)
+ throws IOException
{
synchronized (LOCK)
{
@@ -90,7 +91,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
*
* @exception IOException If an error occurs
*/
- protected final void implCloseChannel ()
+ protected final void implCloseChannel () throws IOException
{
implCloseSelectableChannel ();
}
@@ -98,12 +99,13 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
/**
* Closes this selectable channel.
*/
- protected abstract void implCloseSelectableChannel ();
+ protected abstract void implCloseSelectableChannel () throws IOException;
/**
* Adjusts this channel's blocking mode.
*/
- protected abstract void implConfigureBlocking (boolean block);
+ protected abstract void implConfigureBlocking (boolean block)
+ throws IOException;
/**
* Tells whether or not every I/O operation on this channel will block
diff --git a/libjava/java/nio/channels/spi/SelectorProvider.java b/libjava/java/nio/channels/spi/SelectorProvider.java
index 06017f76edb..1d4ccfa5339 100644
--- a/libjava/java/nio/channels/spi/SelectorProvider.java
+++ b/libjava/java/nio/channels/spi/SelectorProvider.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package java.nio.channels.spi;
-/* import gnu.java.nio.channels.SelectorProviderImpl; */
+import gnu.java.nio.SelectorProviderImpl;
+import java.io.IOException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe;
import java.nio.channels.ServerSocketChannel;
@@ -67,27 +68,28 @@ public abstract class SelectorProvider
/**
* Opens a datagram channel.
*/
- public abstract DatagramChannel openDatagramChannel ();
+ public abstract DatagramChannel openDatagramChannel () throws IOException;
/**
* Opens a pipe.
*/
- public abstract Pipe openPipe ();
+ public abstract Pipe openPipe () throws IOException;
/**
* Opens a selector.
*/
- public abstract AbstractSelector openSelector ();
+ public abstract AbstractSelector openSelector () throws IOException;
/**
* Opens a server socket channel.
*/
- public abstract ServerSocketChannel openServerSocketChannel ();
+ public abstract ServerSocketChannel openServerSocketChannel ()
+ throws IOException;
/**
* Opens a socket channel.
*/
- public abstract SocketChannel openSocketChannel ();
+ public abstract SocketChannel openSocketChannel () throws IOException;
/**
* Returns the system-wide default selector provider for this invocation
@@ -95,8 +97,10 @@ public abstract class SelectorProvider
*/
public static SelectorProvider provider ()
{
-/* if (pr == null) */
-/* pr = new SelectorProviderImpl (); */
+ if (pr == null)
+ {
+ pr = new SelectorProviderImpl ();
+ }
return pr;
}
diff --git a/libjava/java/nio/charset/Charset.java b/libjava/java/nio/charset/Charset.java
index cc60c99b9b6..889267f302f 100644
--- a/libjava/java/nio/charset/Charset.java
+++ b/libjava/java/nio/charset/Charset.java
@@ -187,9 +187,10 @@ public abstract class Charset implements Comparable
return canonicalName;
}
- public final boolean isRegistered (String name)
+ public final boolean isRegistered ()
{
- return !name.startsWith ("x-") && !name.startsWith ("X-");
+ return (!canonicalName.startsWith ("x-")
+ && !canonicalName.startsWith ("X-"));
}
public abstract boolean contains (Charset cs);
diff --git a/libjava/java/nio/charset/CharsetEncoder.java b/libjava/java/nio/charset/CharsetEncoder.java
index dd434a79752..dc1fa99cd93 100644
--- a/libjava/java/nio/charset/CharsetEncoder.java
+++ b/libjava/java/nio/charset/CharsetEncoder.java
@@ -319,6 +319,11 @@ public abstract class CharsetEncoder
return this;
}
+ public CodingErrorAction unmappableCharacterAction ()
+ {
+ return unmappableCharacterAction;
+ }
+
public final CharsetEncoder onUnmappableCharacter
(CodingErrorAction newAction)
{
diff --git a/libjava/java/nio/charset/IllegalCharsetNameException.java b/libjava/java/nio/charset/IllegalCharsetNameException.java
index 762eb687fbf..f46e63aa14f 100644
--- a/libjava/java/nio/charset/IllegalCharsetNameException.java
+++ b/libjava/java/nio/charset/IllegalCharsetNameException.java
@@ -38,16 +38,25 @@ exception statement from your version. */
package java.nio.charset;
/**
+ * @author Michael Koch
* @since 1.4
*/
public class IllegalCharsetNameException extends IllegalArgumentException
{
/**
+ * Compatible with JDK 1.4+
+ */
+ private static final long serialVersionUID = 1457525358470002989L;
+
+ String charsetName;
+
+ /**
* Creates the exception
*/
public IllegalCharsetNameException (String charsetName)
{
- super (charsetName);
+ super ();
+ this.charsetName = charsetName;
}
/**
@@ -55,6 +64,6 @@ public class IllegalCharsetNameException extends IllegalArgumentException
*/
public String getCharsetName ()
{
- return getMessage ();
+ return charsetName;
}
}
diff --git a/libjava/java/nio/charset/UnsupportedCharsetException.java b/libjava/java/nio/charset/UnsupportedCharsetException.java
index 13aaa520524..beb0be96df3 100644
--- a/libjava/java/nio/charset/UnsupportedCharsetException.java
+++ b/libjava/java/nio/charset/UnsupportedCharsetException.java
@@ -38,16 +38,25 @@ exception statement from your version. */
package java.nio.charset;
/**
+ * @author Michael Koch
* @since 1.4
*/
public class UnsupportedCharsetException extends IllegalArgumentException
{
/**
+ * Compatible with JDK 1.4+
+ */
+ private static final long serialVersionUID = 1490765524727386367L;
+
+ String charsetName;
+
+ /**
* Creates the exception
*/
public UnsupportedCharsetException (String charsetName)
{
- super (charsetName);
+ super ();
+ this.charsetName = charsetName;
}
/**
@@ -55,6 +64,6 @@ public class UnsupportedCharsetException extends IllegalArgumentException
*/
public String getCharsetName ()
{
- return getMessage ();
+ return charsetName;
}
}
diff --git a/libjava/java/security/SecureRandom.java b/libjava/java/security/SecureRandom.java
index a0b7f95f397..d9ac153da2b 100644
--- a/libjava/java/security/SecureRandom.java
+++ b/libjava/java/security/SecureRandom.java
@@ -1,5 +1,5 @@
/* SecureRandom.java --- Secure Random class implmentation
- Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -36,6 +36,7 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.security;
+
import java.io.Serializable;
import java.util.Random;
import java.util.Enumeration;
@@ -358,9 +359,10 @@ public class SecureRandom extends Random
int ret = 0;
for (int i = 0; i < tmp.length; i++)
- ret |= tmp[i] << (8 * i);
+ ret |= (tmp[i] & 0xFF) << (8 * i);
- return ret;
+ long mask = (1L << numBits) - 1;
+ return (int) (ret & mask);
}
/**
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
index c42ff3ca9e9..0f8b44c43a6 100644
--- a/libjava/java/sql/Timestamp.java
+++ b/libjava/java/sql/Timestamp.java
@@ -1,5 +1,5 @@
/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.text.SimpleDateFormat;
*/
public class Timestamp extends java.util.Date
{
- static final long serialVersionUID = 3581463369166924961L;
+ static final long serialVersionUID = 2745179027874758501L;
/**
* Used for parsing and formatting this date.
@@ -237,19 +237,37 @@ public class Timestamp extends java.util.Date
}
/**
+ * Compare two Timestamp
+ * @param when the other Timestamp.
+ * @return 0, if the date represented
+ * by obj is exactly the same as the time represented by this
+ * object, a negative if this Timestamp is before the other Timestamp, and
+ * a positive value otherwise.
* @since 1.2
*/
- /*
public int compareTo(Timestamp ts)
{
-
- }*/
-
+ int s = super.compareTo((java.util.Date) ts);
+ if (s != 0)
+ return s;
+ // If Date components were equal, then we check the nanoseconds.
+ return nanos - ts.nanos;
+ }
+
/**
+ * Compares this Timestamp to another. This behaves like
+ * <code>compareTo(Timestamp)</code>, but it may throw a
+ * <code>ClassCastException</code>
+ * @param obj the other Timestamp.
+ * @return 0, if the Timestamp represented
+ * by obj is exactly the same as the time represented by this
+ * object, a negative if this Timestamp is before the other Timestamp, and
+ * a positive value otherwise.
+ * @exception ClassCastException if obj is not of type Timestamp.
* @since 1.2
- *//*
+ */
public int compareTo(Object obj)
{
return compareTo((Timestamp) obj);
- }*/
+ }
}
diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java
index 907ec2c4d7a..279cf1e7b82 100644
--- a/libjava/java/util/Properties.java
+++ b/libjava/java/util/Properties.java
@@ -377,9 +377,21 @@ label = Name:\\u0020</pre>
= new PrintWriter(new OutputStreamWriter(out, "ISO-8859-1"));
if (header != null)
writer.println("#" + header);
- writer.println("#" + new Date());
- list(writer);
- writer.flush();
+ writer.println ("#" + Calendar.getInstance ().getTime ());
+
+ Iterator iter = entrySet ().iterator ();
+ int i = size ();
+ StringBuffer s = new StringBuffer (); // Reuse the same buffer.
+ while (--i >= 0)
+ {
+ Map.Entry entry = (Map.Entry) iter.next ();
+ formatForOutput ((String) entry.getKey (), s, true);
+ s.append ('=');
+ formatForOutput ((String) entry.getValue (), s, false);
+ writer.println (s);
+ }
+
+ writer.flush ();
}
/**
@@ -453,54 +465,50 @@ label = Name:\\u0020</pre>
}
/**
- * Writes the key/value pairs to the given print stream. They are
- * written in the way described in the method store. This does not visit
- * the keys in the default properties.
+ * Prints the key/value pairs to the given print stream. This is
+ * mainly useful for debugging purposes.
*
- * @param out the stream, where the key/value pairs are written to
- * @throws ClassCastException if this property contains any key or
+ * @param out the print stream, where the key/value pairs are written to
+ * @throws ClassCastException if this property contains a key or a
* value that isn't a string
- * @see #store(OutputStream, String)
+ * @see #list(PrintWriter)
*/
public void list(PrintStream out)
{
- Iterator iter = entrySet().iterator();
- int i = size();
- StringBuffer s = new StringBuffer(); // Reuse the same buffer.
- while (--i >= 0)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- formatForOutput((String) entry.getKey(), s, true);
- s.append('=');
- formatForOutput((String) entry.getValue(), s, false);
- out.println(s);
- }
+ PrintWriter writer = new PrintWriter (out);
+ list (writer);
}
/**
- * Writes the key/value pairs to the given print writer. They are
- * written in the way, described in the method store.
+ * Prints the key/value pairs to the given print writer. This is
+ * mainly useful for debugging purposes.
*
- * @param out the writer, where the key/value pairs are written to
- * @throws ClassCastException if this property contains any key or
+ * @param out the print writer where the key/value pairs are written to
+ * @throws ClassCastException if this property contains a key or a
* value that isn't a string
- * @see #store(OutputStream, String)
* @see #list(PrintStream)
* @since 1.1
*/
public void list(PrintWriter out)
{
- Iterator iter = entrySet().iterator();
- int i = size();
- StringBuffer s = new StringBuffer(); // Reuse the same buffer.
+ out.println ("-- listing properties --");
+
+ Iterator iter = entrySet ().iterator ();
+ int i = size ();
while (--i >= 0)
{
- Map.Entry entry = (Map.Entry) iter.next();
- formatForOutput((String) entry.getKey(), s, true);
- s.append('=');
- formatForOutput((String) entry.getValue(), s, false);
- out.println(s);
+ Map.Entry entry = (Map.Entry) iter.next ();
+ out.print ((String) entry.getKey () + "=");
+
+ // JDK 1.3/1.4 restrict the printed value, but not the key,
+ // to 40 characters, including the truncating ellipsis.
+ String s = (String ) entry.getValue ();
+ if (s != null && s.length () > 40)
+ out.println (s.substring (0, 37) + "...");
+ else
+ out.println (s);
}
+ out.flush ();
}
/**
diff --git a/libjava/java/util/natTimeZone.cc b/libjava/java/util/natTimeZone.cc
index ea59293513d..cb564a97591 100644
--- a/libjava/java/util/natTimeZone.cc
+++ b/libjava/java/util/natTimeZone.cc
@@ -1,6 +1,6 @@
// natTimeZone.cc -- Native side of TimeZone 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.
@@ -9,12 +9,11 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <gcj/cni.h>
#include <jvm.h>
-#include "platform.h"
-
#include <java/util/TimeZone.h>
#include <java/lang/Character.h>
#include <java/lang/Integer.h>
diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java
index 5aac73d7e5a..b04534977f1 100644
--- a/libjava/java/util/zip/InflaterInputStream.java
+++ b/libjava/java/util/zip/InflaterInputStream.java
@@ -1,5 +1,5 @@
/* InflaterInputStream.java - Input stream filter for decompressing
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -90,6 +90,8 @@ public class InflaterInputStream extends FilterInputStream
{
if (inf == null)
throw new IOException ("stream closed");
+ if (len == 0)
+ return 0;
if (inf.finished())
return -1;
diff --git a/libjava/java/util/zip/ZipEntry.java b/libjava/java/util/zip/ZipEntry.java
index c9f1b1d7d44..5284d793f6c 100644
--- a/libjava/java/util/zip/ZipEntry.java
+++ b/libjava/java/util/zip/ZipEntry.java
@@ -84,11 +84,15 @@ public class ZipEntry implements ZipConstants, Cloneable
* Creates a zip entry with the given name.
* @param name the name. May include directory components separated
* by '/'.
+ *
+ * @exception NullPointerException when name is null.
+ * @exception IllegalArgumentException when name is bigger then 65535 chars.
*/
public ZipEntry(String name)
{
- if (name == null)
- throw new NullPointerException();
+ int length = name.length();
+ if (length > 65535)
+ throw new IllegalArgumentException("name length is " + length);
this.name = name;
}
@@ -365,7 +369,7 @@ public class ZipEntry implements ZipConstants, Cloneable
*/
public void setComment(String comment)
{
- if (comment.length() > 0xffff)
+ if (comment != null && comment.length() > 0xffff)
throw new IllegalArgumentException();
this.comment = comment;
}
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index 4b027b088a9..8f7ef6f8d6f 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -305,6 +305,15 @@ public class ZipFile implements ZipConstants
}
/**
+ * Calls the <code>close()</code> method when this ZipFile has not yet
+ * been explicitly closed.
+ */
+ protected void finalize() throws IOException
+ {
+ if (!closed) close();
+ }
+
+ /**
* Returns an enumeration of all Zip entries in this Zip file.
*/
public Enumeration entries()
diff --git a/libjava/java/util/zip/ZipInputStream.java b/libjava/java/util/zip/ZipInputStream.java
index c4905978d74..2fba9f556dc 100644
--- a/libjava/java/util/zip/ZipInputStream.java
+++ b/libjava/java/util/zip/ZipInputStream.java
@@ -1,5 +1,5 @@
/* java.util.zip.ZipInputStream
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -286,6 +286,8 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
*/
public int read(byte[] b, int off, int len) throws IOException
{
+ if (len == 0)
+ return 0;
if (crc == null)
throw new IOException("Stream closed.");
if (entry == null)
diff --git a/libjava/javax/accessibility/AccessibleContext.java b/libjava/javax/accessibility/AccessibleContext.java
index d84c1463d39..18679d4a4f5 100644
--- a/libjava/javax/accessibility/AccessibleContext.java
+++ b/libjava/javax/accessibility/AccessibleContext.java
@@ -72,7 +72,7 @@ public abstract class AccessibleContext
= "AccessibleName";
/**
- * Constanat used when the accessible description has changed. Both the old
+ * Constant used when the accessible description has changed. Both the old
* and new values are listed in the event.
*
* @see #getAccessibleDescription()
diff --git a/libjava/javax/sql/ConnectionEvent.java b/libjava/javax/sql/ConnectionEvent.java
index 1c4b5ef5b71..b973dca3dc3 100644
--- a/libjava/javax/sql/ConnectionEvent.java
+++ b/libjava/javax/sql/ConnectionEvent.java
@@ -1,5 +1,5 @@
/* ConnectionEvent.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,8 +46,11 @@ import java.util.EventObject;
*/
public class ConnectionEvent extends EventObject
{
- private SQLException sqlException;
-
+ private static final long serialVersionUID = -4843217645290030002L;
+
+ // Note that the name is chosen for serialization.
+ private SQLException ex;
+
/**
* @since 1.4
*/
@@ -62,7 +65,7 @@ public class ConnectionEvent extends EventObject
public ConnectionEvent(PooledConnection con, SQLException ex)
{
super(con);
- this.sqlException = ex;
+ this.ex = ex;
}
/**
@@ -70,6 +73,6 @@ public class ConnectionEvent extends EventObject
*/
public SQLException getSQLException()
{
- return sqlException;
+ return ex;
}
}
diff --git a/libjava/jni.cc b/libjava/jni.cc
index c1a2880156d..7dd98364118 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -10,6 +10,7 @@ details. */
#include <config.h>
+#include <stdio.h>
#include <stddef.h>
#include <string.h>
@@ -2028,9 +2029,9 @@ _Jv_GetJNIEnvNewFrame (jclass klass)
// This is `extern "C"' because the compiler uses it.
extern "C" void *
_Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
- _Jv_Utf8Const *signature)
+ _Jv_Utf8Const *signature, int args_size)
{
- char buf[10 + 6 * (name->length + signature->length)];
+ char buf[10 + 6 * (name->length + signature->length) + 12];
int long_start;
void *function;
@@ -2050,18 +2051,72 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
return function;
// If there was no override, then look in the symbol table.
- mangled_name (klass, name, signature, buf, &long_start);
- char c = buf[long_start];
- buf[long_start] = '\0';
- function = _Jv_FindSymbolInExecutable (buf);
+ buf[0] = '_';
+ mangled_name (klass, name, signature, buf + 1, &long_start);
+ char c = buf[long_start + 1];
+ buf[long_start + 1] = '\0';
+
+ function = _Jv_FindSymbolInExecutable (buf + 1);
+#ifdef WIN32
+ // On Win32, we use the "stdcall" calling convention (see JNICALL
+ // in jni.h).
+ //
+ // For a function named 'fooBar' that takes 'nn' bytes as arguments,
+ // by default, MinGW GCC exports it as 'fooBar@nn', MSVC exports it
+ // as '_fooBar@nn' and Borland C exports it as 'fooBar'. We try to
+ // take care of all these variations here.
+
+ char asz_buf[12]; /* '@' + '2147483647' (32-bit INT_MAX) + '\0' */
+ char long_nm_sv[11]; /* Ditto, except for the '\0'. */
+
if (function == NULL)
{
- buf[long_start] = c;
+ // We have tried searching for the 'fooBar' form (BCC) - now
+ // try the others.
+
+ // First, save the part of the long name that will be damaged
+ // by appending '@nn'.
+ memcpy (long_nm_sv, (buf + long_start + 1 + 1), sizeof (long_nm_sv));
+
+ sprintf (asz_buf, "@%d", args_size);
+ strcat (buf, asz_buf);
+
+ // Search for the '_fooBar@nn' form (MSVC).
function = _Jv_FindSymbolInExecutable (buf);
+
+ if (function == NULL)
+ {
+ // Search for the 'fooBar@nn' form (MinGW GCC).
+ function = _Jv_FindSymbolInExecutable (buf + 1);
+ }
+ }
+#else /* WIN32 */
+ args_size; /* Dummy statement to avoid unused parameter warning */
+#endif /* ! WIN32 */
+
+ if (function == NULL)
+ {
+ buf[long_start + 1] = c;
+#ifdef WIN32
+ // Restore the part of the long name that was damaged by
+ // appending the '@nn'.
+ memcpy ((buf + long_start + 1 + 1), long_nm_sv, sizeof (long_nm_sv));
+#endif /* WIN32 */
+ function = _Jv_FindSymbolInExecutable (buf + 1);
if (function == NULL)
{
- jstring str = JvNewStringUTF (name->data);
- throw new java::lang::UnsatisfiedLinkError (str);
+#ifdef WIN32
+ strcat (buf, asz_buf);
+ function = _Jv_FindSymbolInExecutable (buf);
+ if (function == NULL)
+ function = _Jv_FindSymbolInExecutable (buf + 1);
+
+ if (function == NULL)
+#endif /* WIN32 */
+ {
+ jstring str = JvNewStringUTF (name->data);
+ throw new java::lang::UnsatisfiedLinkError (str);
+ }
}
}
@@ -2092,9 +2147,17 @@ _Jv_JNIMethod::call (ffi_cif *, void *ret, ffi_raw *args, void *__this)
// time.
JvSynchronize sync (global_ref_table);
if (_this->function == NULL)
- _this->function = _Jv_LookupJNIMethod (_this->defining_class,
- _this->self->name,
- _this->self->signature);
+ {
+ int args_size = sizeof (JNIEnv *) + _this->args_raw_size;
+
+ if (_this->self->accflags & java::lang::reflect::Modifier::STATIC)
+ args_size += sizeof (_this->defining_class);
+
+ _this->function = _Jv_LookupJNIMethod (_this->defining_class,
+ _this->self->name,
+ _this->self->signature,
+ args_size);
+ }
}
JvAssert (_this->args_raw_size % sizeof (ffi_raw) == 0);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
index ebebc438ae8..e33aff046fc 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@@ -50,3 +50,39 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
NSA_SET_PTR (env, obj, widget);
}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont
+ (JNIEnv *env, jobject obj, jstring jname, jint size)
+{
+ const char *xlfd;
+# define FBUFSZ 200
+ char buf[FBUFSZ];
+ void *ptr;
+ GdkFont * new_font;
+ GtkStyle * style;
+ GtkWidget * button;
+ GtkWidget * label;
+
+ ptr = NSA_GET_PTR (env, obj);
+ button = GTK_WIDGET (ptr);
+ label = GTK_BIN(button)->child;
+
+ if (label == NULL) return;
+ xlfd = (*env)->GetStringUTFChars (env, jname, NULL);
+ snprintf(buf, FBUFSZ, xlfd, size);
+ (*env)->ReleaseStringUTFChars (env, jname, xlfd);
+ gdk_threads_enter();
+ new_font = gdk_font_load (buf); /* FIXME: deprecated. Replacement? */
+ if (new_font == NULL)
+ {
+ /* Fail quietly for now. */
+ gdk_threads_leave();
+ return;
+ }
+ style = gtk_style_copy (gtk_widget_get_style (label));
+ style -> font = new_font;
+ gtk_widget_set_style (label, style);
+ /* FIXME: Documentation varies as to whether we should unref style. */
+ gdk_threads_leave();
+}
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 4b8787e7d93..9237a01b5a8 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
@@ -65,9 +65,10 @@ post_adjustment_event (GtkAdjustment *adj, struct range_scrollbar *rs)
type = AWT_ADJUSTMENT_BLOCK_DECREMENT;
break;
case GTK_SCROLL_JUMP:
+ case GTK_SCROLL_NONE: /* Apparently generated when slider is dragged. */
type = AWT_ADJUSTMENT_TRACK;
break;
- default: /* GTK_SCROLL_NONE */
+ default: /* Can this happen? If so, is this right? */
return;
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
index 8f58623d573..27f27461518 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
@@ -135,27 +135,32 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkTextGetSize
text = GTK_WIDGET (TEXT_FROM_SW (ptr));
sw = GTK_SCROLLED_WINDOW (ptr);
- gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->hscrollbar),
+ gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar),
"size_request", &myreq);
//gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->hscrollbar),
// &myreq);
dims[0]=myreq.width+GTK_SCROLLED_WINDOW_CLASS
(GTK_OBJECT (sw)->klass)->scrollbar_spacing;
- gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar),
+ gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->hscrollbar),
"size_request", &myreq);
//gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->vscrollbar),
// &myreq);
- dims[1]=myreq.width+GTK_SCROLLED_WINDOW_CLASS
+ dims[1]=myreq.height+GTK_SCROLLED_WINDOW_CLASS
(GTK_OBJECT (sw)->klass)->scrollbar_spacing;
/* The '1' in the following assignments is from
#define TEXT_BORDER_ROOM 1
in gtktext.c */
+ /* Gtk text seems to wrap slightly prematurely. Compensate. */
+ ++cols;
+ ++dims[0];
+
dims[0] += ((cols * gdk_char_width (text->style->font, 'W'))
+ (2 * (text->style->klass->xthickness + 1)));
- dims[1] += ((rows * gdk_char_height (text->style->font, 'W'))
+ /* Guess at the height. Is there a better way? */
+ dims[1] += ((rows * gdk_string_height (text->style->font, "Wg"))
+ (2 * (text->style->klass->ythickness + 1)));
gdk_threads_leave ();
@@ -207,3 +212,35 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange
(*env)->ReleaseStringUTFChars (env, contents, str);
}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
+ (JNIEnv *env, jobject obj, jstring jname, jint size)
+{
+ const char *xlfd;
+# define FBUFSZ 200
+ char buf[FBUFSZ];
+ void *ptr;
+ GdkFont * new_font;
+ GtkStyle * style;
+ GtkWidget * text;
+
+ ptr = NSA_GET_PTR (env, obj);
+ text = GTK_WIDGET (TEXT_FROM_SW (ptr));
+
+ xlfd = (*env)->GetStringUTFChars (env, jname, NULL);
+ snprintf(buf, FBUFSZ, xlfd, size);
+ (*env)->ReleaseStringUTFChars (env, jname, xlfd);
+ gdk_threads_enter();
+ new_font = gdk_font_load (buf); /* FIXME: deprecated. Replacement? */
+ if (new_font == NULL)
+ {
+ /* Fail quietly for now. */
+ gdk_threads_leave();
+ return;
+ }
+ style = gtk_style_copy (gtk_widget_get_style (text));
+ style -> font = new_font;
+ gtk_widget_set_style (text , style);
+ /* FIXME: Documentation varies as to whether we should unref style. */
+ gdk_threads_leave();
+}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
index 9085a57937d..658c8639bb7 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
@@ -148,3 +148,36 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_setEchoChar
gdk_threads_leave ();
}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
+ (JNIEnv *env, jobject obj, jstring jname, jint size)
+{
+ const char *xlfd;
+# define FBUFSZ 200
+ char buf[FBUFSZ];
+ void *ptr;
+ GdkFont * new_font;
+ GtkStyle * style;
+ GtkWidget * text;
+
+ ptr = NSA_GET_PTR (env, obj);
+ text = GTK_WIDGET (ptr);
+
+ xlfd = (*env)->GetStringUTFChars (env, jname, NULL);
+ snprintf(buf, FBUFSZ, xlfd, size);
+ (*env)->ReleaseStringUTFChars (env, jname, xlfd);
+ gdk_threads_enter();
+ new_font = gdk_font_load(buf); /* FIXME: deprecated. Replacement? */
+ if (new_font == NULL)
+ {
+ /* Fail quietly for now. */
+ gdk_threads_leave();
+ return;
+ }
+ style = gtk_style_copy (gtk_widget_get_style (text));
+ style -> font = new_font;
+ gtk_widget_set_style (text , style);
+ /* FIXME: Documentation varies as to whether we should unref style. */
+ gdk_threads_leave();
+}
diff --git a/libjava/libgcj.spec.in b/libjava/libgcj.spec.in
index 3e80feff7d0..93d449d904d 100644
--- a/libjava/libgcj.spec.in
+++ b/libjava/libgcj.spec.in
@@ -6,4 +6,4 @@
%rename lib liborig
*lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
-*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ -fkeep-inline-functions
+*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 11f7803f3a0..caf3a836a6d 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,35 @@
+2003-02-16 Jeff Sturm <jsturm@one-point.com>
+
+ * libjava.lang/CompareNaN.java: New test.
+ * libjava.lang/CompareNaN.out: New test.
+
+2003-02-16 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/xfails: Add Class.reflect2 and String.getBytes FAILs.
+
+2003-02-15 Mark Wielaard <mark@klomp.org>
+
+ * lib/libjava.exp (test_libjava_from_javac): Use regsub not string map.
+ * libjava.mauve/mauve.exp (mauve_compute_uses): Likewise.
+ (test_mauve): Likewise.
+
+2003-02-14 Mark Wielaard <mark@klomp.org>
+
+ * lib/libjava.exp (test_libjava_from_javac): Don't create .o files
+ containing $ characters and always quote class files with "'"s.
+
+2003-02-14 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/mauve.exp (mauve_compute_uses): Add inner class
+ object files by changing all occurances of $ to ^.
+ (test_mauve): Replace ^ with $ for class file names and quote
+ them with "'"s.
+
+2003-02-13 Tom Tromey <tromey@redhat.com>
+
+ * libjava.mauve/xfails: Added entries for an unimplemented Class
+ method.
+
2003-02-07 Mark Wielaard <mark@klomp.org>
* libjava.mauve/xfails: Add new entries for
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 05cf08fe8e3..6be5ec67662 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -787,8 +787,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
if {$mode == "compile"} {
foreach c_file $class_files {
set executable [file rootname [file tail $c_file]].o
+ # Don't write files which contain $ chars.
+ regsub -all "\\$" $executable "\^" executable
set x [libjava_prune_warnings \
- [libjava_tcompile $c_file "$executable" $type $args]]
+ [libjava_tcompile '$c_file' "$executable" $type $args]]
lappend removeList $executable
if {$x != ""} {
break
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index ce4b0cee9cb..cdc7e21f2dd 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -46,6 +46,13 @@ proc mauve_compute_uses {aName} {
foreach file $ufiles {
set file [file rootname $file].o
lappend uses($item) $file
+ # Now add all inner classes
+ foreach inner [glob -nocomplain [file rootname $file]$*.class] {
+ # Prevent excessive escaping by replacing $ with a ^ in the .o name
+ set inner [file rootname $inner].o
+ regsub -all "\\$" $inner "\^" inner
+ lappend uses($item) $inner
+ }
}
}
@@ -179,9 +186,11 @@ proc test_mauve {} {
foreach obj $uses($file) {
if {! [file exists $obj]} then {
verbose "compiling $obj for test of $class"
+ # The .class file does contain a $, but we can quote it between "'"s.
set srcfile [file rootname $obj].class
+ regsub -all "\\^" $srcfile "\$" srcfile
set x [libjava_prune_warnings \
- [target_compile [pwd]/$srcfile $obj object $compile_args]]
+ [libjava_tcompile '[pwd]/$srcfile' $obj object $compile_args]]
if {$x != ""} then {
fail "Compile $obj for $class"
set ok 0
@@ -196,7 +205,7 @@ proc test_mauve {} {
}
set x [libjava_prune_warnings \
- [target_compile [concat $uses($file) $objlist] \
+ [libjava_tcompile [concat $uses($file) $objlist] \
$Executable executable $link_args]]
if {$x != ""} then {
set proc_ok 0
diff --git a/libjava/testsuite/libjava.mauve/xfails b/libjava/testsuite/libjava.mauve/xfails
index 25253b251b3..dda740eee44 100644
--- a/libjava/testsuite/libjava.mauve/xfails
+++ b/libjava/testsuite/libjava.mauve/xfails
@@ -25,8 +25,25 @@ FAIL: gnu.testlet.java.lang.Character.getType (number 20)
FAIL: gnu.testlet.java.lang.Character.getType (number 22)
FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 1 (number 1)
FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 2 (number 1)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 2)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 3)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 5)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 3)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 4)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 5)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 1)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 2)
+FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 3)
FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_intValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1)
FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_intValue returned wrong results - 1 (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UTF-16") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBig") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBigUnmarked") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittle") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittleUnmarked") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("ISO8859_15") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16BE") (number 1)
+FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16LE") (number 1)
FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1)
FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2)
FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: equals() (number 1)
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 238a3e926f1..dcb003dfb22 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1,6 +1,6 @@
// defineclass.cc - defining a class from .class format.
-/* Copyright (C) 2001, 2002 Free Software Foundation
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -821,6 +821,12 @@ private:
// assigns to locals[0] (overwriting `this') and then returns
// without really initializing.
type this_type;
+ // This is a list of all subroutines that have been seen at this
+ // point. Ordinarily this is NULL; it is only allocated and used
+ // in relatively weird situations involving non-ret exit from a
+ // subroutine. We have to keep track of this in this way to avoid
+ // endless recursion in these cases.
+ subr_info *seen_subrs;
// INVALID marks a state which is not on the linked list of states
// requiring reverification.
@@ -839,6 +845,7 @@ private:
stack = NULL;
locals = NULL;
local_changed = NULL;
+ seen_subrs = NULL;
}
state (int max_stack, int max_locals)
@@ -851,6 +858,7 @@ private:
stack[i] = unsuitable_type;
locals = new type[max_locals];
local_changed = (bool *) _Jv_Malloc (sizeof (bool) * max_locals);
+ seen_subrs = NULL;
for (int i = 0; i < max_locals; ++i)
{
locals[i] = unsuitable_type;
@@ -866,6 +874,7 @@ private:
stack = new type[max_stack];
locals = new type[max_locals];
local_changed = (bool *) _Jv_Malloc (sizeof (bool) * max_locals);
+ seen_subrs = NULL;
copy (orig, max_stack, max_locals, ret_semantics);
next = INVALID;
}
@@ -878,6 +887,7 @@ private:
delete[] locals;
if (local_changed)
_Jv_Free (local_changed);
+ clean_subrs ();
}
void *operator new[] (size_t bytes)
@@ -900,6 +910,17 @@ private:
_Jv_Free (mem);
}
+ void clean_subrs ()
+ {
+ subr_info *info = seen_subrs;
+ while (info != NULL)
+ {
+ subr_info *next = info->next;
+ _Jv_Free (info);
+ info = next;
+ }
+ }
+
void copy (const state *copy, int max_stack, int max_locals,
bool ret_semantics = false)
{
@@ -919,6 +940,16 @@ private:
locals[i] = copy->locals[i];
local_changed[i] = copy->local_changed[i];
}
+
+ clean_subrs ();
+ if (copy->seen_subrs)
+ {
+ for (subr_info *info = seen_subrs; info != NULL; info = info->next)
+ add_subr (info->pc);
+ }
+ else
+ seen_subrs = NULL;
+
this_type = copy->this_type;
// Don't modify `next'.
}
@@ -945,6 +976,15 @@ private:
local_changed[i] = false;
}
+ // Indicate that we've been in this this subroutine.
+ void add_subr (int pc)
+ {
+ subr_info *n = (subr_info *) _Jv_Malloc (sizeof (subr_info));
+ n->pc = pc;
+ n->next = seen_subrs;
+ seen_subrs = n;
+ }
+
// Merge STATE_OLD into this state. Destructively modifies this
// state. Returns true if the new state was in fact changed.
// Will throw an exception if the states are not mergeable.
@@ -972,10 +1012,23 @@ private:
}
else
{
- // If the subroutines differ, indicate that the state
- // changed. This is needed to detect when subroutines have
- // merged.
- changed = true;
+ // If the subroutines differ, and we haven't seen this
+ // subroutine before, indicate that the state changed. This
+ // is needed to detect when subroutines have merged.
+ bool found = false;
+ for (subr_info *info = seen_subrs; info != NULL; info = info->next)
+ {
+ if (info->pc == state_old->subroutine)
+ {
+ found = true;
+ break;
+ }
+ }
+ if (! found)
+ {
+ add_subr (state_old->subroutine);
+ changed = true;
+ }
}
// Merge stacks. Special handling for NO_STACK case.
@@ -1379,7 +1432,6 @@ private:
{
int *prev_loc = &next_verify_pc;
int npc = next_verify_pc;
- bool skipped = false;
while (npc != state::NO_NEXT)
{
@@ -1396,7 +1448,6 @@ private:
return npc;
}
- skipped = true;
prev_loc = &states[npc]->next;
npc = states[npc]->next;
}
diff --git a/libjava/win32.cc b/libjava/win32.cc
index af1163fbfa9..59c3be244b6 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -1,6 +1,6 @@
// win32.cc - Helper functions for Microsoft-flavored OSs.
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -9,11 +9,11 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <jvm.h>
#include <sys/timeb.h>
#include <stdlib.h>
-#include "platform.h"
#include <java/lang/ArithmeticException.h>
#include <java/util/Properties.h>