[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath
Kaffe CVS
cvs-commits at kaffe.org
Mon Jul 26 14:45:35 PDT 2004
PatchSet 5021
Date: 2004/07/26 21:13:39
Author: dalibor
Branch: HEAD
Tag: (none)
Log:
Resynced with GNU Classpath
2004-07-26 Dalibor Topic <robilad at kaffe.org>
* libraries/javalib/gnu/java/nio/VMPipe.java,
libraries/javalib/gnu/java/security/action/SetAccessibleAction.java:
New files. Taken from GNU Classpath.
* libraries/javalib/Makefile.am,
libraries/javalib/Makefile.in,
libraries/javalib/all.files:
Regenerated.
* libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java,
libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java,
libraries/javalib/gnu/java/io/EncodingManager.java,
libraries/javalib/gnu/java/math/MPN.java,
libraries/javalib/gnu/java/net/content/text/plain.java,
libraries/javalib/gnu/java/net/protocol/file/Connection.java,
libraries/javalib/gnu/java/net/protocol/http/Connection.java,
libraries/javalib/gnu/java/net/protocol/jar/Connection.java,
libraries/javalib/gnu/java/net/protocol/jar/Handler.java,
libraries/javalib/gnu/java/nio/FileLockImpl.java,
libraries/javalib/gnu/java/nio/PipeImpl.java,
libraries/javalib/gnu/java/nio/SocketChannelImpl.java,
libraries/javalib/gnu/java/rmi/dgc/DGCImpl.java,
libraries/javalib/gnu/java/rmi/rmic/CompilerProcess.java,
libraries/javalib/gnu/java/rmi/rmic/RMIC.java,
libraries/javalib/gnu/java/security/Engine.java,
libraries/javalib/java/applet/Applet.java,
libraries/javalib/java/io/BufferedWriter.java,
libraries/javalib/java/io/File.java,
libraries/javalib/java/io/FilterWriter.java,
libraries/javalib/java/io/ObjectInputStream.java,
libraries/javalib/java/io/ObjectOutputStream.java,
libraries/javalib/java/io/ObjectStreamClass.java,
libraries/javalib/java/io/PrintWriter.java,
libraries/javalib/java/math/BigDecimal.java,
libraries/javalib/java/net/DatagramSocket.java,
libraries/javalib/java/net/Socket.java,
libraries/javalib/java/net/SocketPermission.java,
libraries/javalib/java/net/URL.java,
libraries/javalib/java/net/URLConnection.java,
libraries/javalib/java/nio/ByteOrder.java,
libraries/javalib/java/nio/charset/CharsetDecoder.java,
libraries/javalib/java/sql/Timestamp.java,
libraries/javalib/java/util/SimpleTimeZone.java,
libraries/javalib/java/util/zip/GZIPOutputStream.java:
Resynced with GNU Classpath.
Members:
ChangeLog:1.2579->1.2580
libraries/javalib/Makefile.am:1.208->1.209
libraries/javalib/Makefile.in:1.284->1.285
libraries/javalib/all.files:1.8->1.9
libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java:1.4->1.5
libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.1->1.2
libraries/javalib/gnu/java/io/EncodingManager.java:1.3->1.4
libraries/javalib/gnu/java/math/MPN.java:1.1->1.2
libraries/javalib/gnu/java/net/content/text/plain.java:1.2->1.3
libraries/javalib/gnu/java/net/protocol/file/Connection.java:1.6->1.7
libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.10->1.11
libraries/javalib/gnu/java/net/protocol/jar/Connection.java:1.4->1.5
libraries/javalib/gnu/java/net/protocol/jar/Handler.java:1.6->1.7
libraries/javalib/gnu/java/nio/FileLockImpl.java:1.7->1.8
libraries/javalib/gnu/java/nio/PipeImpl.java:1.4->1.5
libraries/javalib/gnu/java/nio/SocketChannelImpl.java:1.13->1.14
libraries/javalib/gnu/java/nio/VMPipe.java:INITIAL->1.1
libraries/javalib/gnu/java/rmi/dgc/DGCImpl.java:1.2->1.3
libraries/javalib/gnu/java/rmi/rmic/CompilerProcess.java:1.2->1.3
libraries/javalib/gnu/java/rmi/rmic/RMIC.java:1.3->1.4
libraries/javalib/gnu/java/security/Engine.java:1.2->1.3
libraries/javalib/gnu/java/security/action/SetAccessibleAction.java:INITIAL->1.1
libraries/javalib/java/applet/Applet.java:1.11->1.12
libraries/javalib/java/io/BufferedWriter.java:1.8->1.9
libraries/javalib/java/io/File.java:1.50->1.51
libraries/javalib/java/io/FilterWriter.java:1.5->1.6
libraries/javalib/java/io/ObjectInputStream.java:1.38->1.39
libraries/javalib/java/io/ObjectOutputStream.java:1.21->1.22
libraries/javalib/java/io/ObjectStreamClass.java:1.24->1.25
libraries/javalib/java/io/PrintWriter.java:1.7->1.8
libraries/javalib/java/math/BigDecimal.java:1.9->1.10
libraries/javalib/java/net/DatagramSocket.java:1.23->1.24
libraries/javalib/java/net/Socket.java:1.34->1.35
libraries/javalib/java/net/SocketPermission.java:1.5->1.6
libraries/javalib/java/net/URL.java:1.44->1.45
libraries/javalib/java/net/URLConnection.java:1.19->1.20
libraries/javalib/java/nio/ByteOrder.java:1.6->1.7
libraries/javalib/java/nio/charset/CharsetDecoder.java:1.1->1.2
libraries/javalib/java/sql/Timestamp.java:1.7->1.8
libraries/javalib/java/util/SimpleTimeZone.java:1.17->1.18
libraries/javalib/java/util/zip/GZIPOutputStream.java:1.7->1.8
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2579 kaffe/ChangeLog:1.2580
--- kaffe/ChangeLog:1.2579 Mon Jul 26 13:54:54 2004
+++ kaffe/ChangeLog Mon Jul 26 21:13:39 2004
@@ -1,5 +1,186 @@
2004-07-26 Dalibor Topic <robilad at kaffe.org>
+ * libraries/javalib/gnu/java/nio/VMPipe.java,
+ libraries/javalib/gnu/java/security/action/SetAccessibleAction.java:
+ New files. Taken from GNU Classpath.
+
+ * libraries/javalib/Makefile.am,
+ libraries/javalib/Makefile.in,
+ libraries/javalib/all.files:
+ Regenerated.
+
+ * libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java,
+ libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java,
+ libraries/javalib/gnu/java/io/EncodingManager.java,
+ libraries/javalib/gnu/java/math/MPN.java,
+ libraries/javalib/gnu/java/net/content/text/plain.java,
+ libraries/javalib/gnu/java/net/protocol/file/Connection.java,
+ libraries/javalib/gnu/java/net/protocol/http/Connection.java,
+ libraries/javalib/gnu/java/net/protocol/jar/Connection.java,
+ libraries/javalib/gnu/java/net/protocol/jar/Handler.java,
+ libraries/javalib/gnu/java/nio/FileLockImpl.java,
+ libraries/javalib/gnu/java/nio/PipeImpl.java,
+ libraries/javalib/gnu/java/nio/SocketChannelImpl.java,
+ libraries/javalib/gnu/java/rmi/dgc/DGCImpl.java,
+ libraries/javalib/gnu/java/rmi/rmic/CompilerProcess.java,
+ libraries/javalib/gnu/java/rmi/rmic/RMIC.java,
+ libraries/javalib/gnu/java/security/Engine.java,
+ libraries/javalib/java/applet/Applet.java,
+ libraries/javalib/java/io/BufferedWriter.java,
+ libraries/javalib/java/io/File.java,
+ libraries/javalib/java/io/FilterWriter.java,
+ libraries/javalib/java/io/ObjectInputStream.java,
+ libraries/javalib/java/io/ObjectOutputStream.java,
+ libraries/javalib/java/io/ObjectStreamClass.java,
+ libraries/javalib/java/io/PrintWriter.java,
+ libraries/javalib/java/math/BigDecimal.java,
+ libraries/javalib/java/net/DatagramSocket.java,
+ libraries/javalib/java/net/Socket.java,
+ libraries/javalib/java/net/SocketPermission.java,
+ libraries/javalib/java/net/URL.java,
+ libraries/javalib/java/net/URLConnection.java,
+ libraries/javalib/java/nio/ByteOrder.java,
+ libraries/javalib/java/nio/charset/CharsetDecoder.java,
+ libraries/javalib/java/sql/Timestamp.java,
+ libraries/javalib/java/util/SimpleTimeZone.java,
+ libraries/javalib/java/util/zip/GZIPOutputStream.java:
+ Resynced with GNU Classpath.
+
+ 2004-07-16 Michael Koch <konqueror at gmx.de>
+
+ * java/util/zip/GZIPOutputStream.java:
+ Fixed javadocs.
+
+ 2004-07-15 Bryce McKinlay <mckinlay at redhat.com>
+
+ PR libgcj/16574
+ * java/sql/Timestamp.java (dateFormat): Renamed from sdf.
+ (decimalFormat): New static variable.
+ (sbuf): Likewise.
+ (getTime): New. Override Date.getTime().
+ (toString): Synchronize. Use decimalFormat to format nanos value
+ correctly. Truncate extra zeros.
+ (before): Compare getNanos() only if getTime() is equal.
+ (after): Likewise.
+
+ 2004-07-15 Michael Koch <konqueror at gmx.de>
+
+ * java/nio/charset/CharsetDecoder.java
+ (decode): Fix for bug #9177: Reset state before flipping.
+
+ 2004-07-16 Michael Koch <konqueror at gmx.de>
+
+ * java/nio/ByteOrder.java
+ (static): Removed. Not needed.
+ Thanks to Patrick Reali for noticing.
+
+ 2004-07-21 Bryce McKinlay <mckinlay at redhat.com>
+
+ * java/net/URLConnection.java (position): New field.
+ (dateFormat1, dateFormat2, dateFormat3): Removed.
+ (dateFormats): New field.
+ (getHeaderFieldDate): Use new dateFormats array. Re-use parsePosition
+ each time instead of re-allocating.
+ (initializeDateFormats): Initialize 'dateFormats'.
+
+ 2004-07-16 Jeroen Frijters <jeroen at frijters.net>
+
+ * java/net/URL.java (URL(String,String,int,String,URLStreamHandler):
+ Don't set authority if host isn't specified.
+
+ 2004-07-20 Bryce McKinlay <mckinlay at redhat.com>
+
+ * java/net/Socket.java (getImpl): Now private. Remove comment.
+
+ 2004-07-17 Michael Koch <konqueror at gmx.de>
+
+ * java/net/DatagramSocket.java
+ (getLocalAddress): Check if socket is bound or not.
+ * java/net/Socket.java
+ (getLocalAddrss): Check if socket is bound or not.
+ (getPort): Return -1 when not connected. Dont check getImpl() for
+ null.
+ (setReuseAddress): Check if socket is closed.
+ (isConnected): Check if getImpl() returns null.
+
+ 2004-07-20 Bryce McKinlay <mckinlay at redhat.com>
+
+ * java/io/BufferedWriter.java (BufferedWriter): Use existing lock
+ of chained Writer when calling super-constructor.
+ * java/io/FilterWriter.java (FilterWriter): Likewise.
+ * java/io/PrintWriter.java (PrintWriter): Likewise.
+
+ 2004-06-26 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * java/applet/Applet.java: Revert changes from 2004-04-29,
+ 2004-03-15 and 2004-03-14.
+
+ 2004-07-20 Patrik Reali <reali at acm.org>
+
+ * gnu/java/nio/PipeImpl.java,
+ vm/reference/gnu/java/nio/VMPipe.java,
+ vm/reference/gnu/java/nio/VMPipeImpl.java: VMPipeImpl renamed to VMPipe
+
+ 2004-07-20 Patrik Reali <reali at acm.org>
+
+ * gnu/java/nio/PipeImpl.java,
+ vm/reference/gnu/java/nio/VMPipeImpl.java: native method init moved
+ from gnu.java.nio.PipeImpl to gnu.java.nio.VMPipeImpl
+
+ 2004-04-23 Tom Tromey <tromey at redhat.com>
+
+ * java/math/BigDecimal.java (divide): Removed unused variable.
+ * gnu/java/nio/SocketChannelImpl.java: Cleaned up imports.
+ * gnu/java/nio/FileLockImpl.java: Cleaned up imports.
+
+ 2004-07-23 Mark Wielaard <mark at klomp.org>
+
+ * gnu/java/net/protocol/http/Connection.java (static): Get httpAgent
+ from system property inside AccessController.doPrivileged() call.
+ (proxyPort): Made package private.
+ (proxyInUse): Likewise.
+ (proxyHost): Likewise.
+ (userAgent): Likewise.
+
+ 2004-07-23 Bryce McKinlay <mckinlay at redhat.com>
+
+ * gnu/java/net/protocol/http/Connection.java: Use GetPropertyAction
+ for privileged getProperty calls.
+ * java/io/ObjectOutputStream.java (getField): No longer static. Use
+ SetAccessibleAction instead of anonymous class for doPrivileged call.
+ (getMethod): Likewise.
+ (setAccessible): New field. PrivilegedAction object to use when
+ calling setAccessible.
+ * java/io/ObjectStreamClass.java (calculateOffsets): Use
+ SetAccessibleAction instead of anonymous class for diPrivileged call.
+ (setFields): Likewise.
+ (getClassUID): Likewise.
+ (findMethod): Likewise.
+ * gnu/java/security/action/SetAccessibleAction.java: New class.
+
+ 2004-07-25 Dalibor Topic <robilad at kaffe.org>
+
+ * gnu/java/awt/ComponentDataBlitOp.java,
+ Cleaned up imports.
+
+ 2003-07-09 Michael Koch <konqueror at gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkMenuPeer.java:
+ Reworked import statements.
+
+ 2004-06-07 Archie Cobbs <archie at dellroad.org>
+
+ * gnu/java/io/EncodingManager.java, java/util/ResourceBundle.java:
+ Replace ``Class.forName("Foo")'' with ``Foo.class''.
+
+ 2004-05-07 Michael Koch <konqueror at gmx.de>
+
+ * gnu/java/math/MPN.java,
+ gnu/java/rmi/rmic/CompilerProcess.java:
+ Fixed javadocs all over.
+
+2004-07-26 Dalibor Topic <robilad at kaffe.org>
+
* test/regression/BeanBug.java: Adapted expected output
for Classpath's AWT.
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.208 kaffe/libraries/javalib/Makefile.am:1.209
--- kaffe/libraries/javalib/Makefile.am:1.208 Mon Jul 26 02:40:58 2004
+++ kaffe/libraries/javalib/Makefile.am Mon Jul 26 21:13:44 2004
@@ -127,6 +127,7 @@
$(gnu_java_rmi_rmic_SRCS) \
$(gnu_java_rmi_server_SRCS) \
$(gnu_java_security_SRCS) \
+ $(gnu_java_security_action_SRCS) \
$(gnu_java_security_der_SRCS) \
$(gnu_java_security_provider_SRCS) \
$(gnu_java_security_x509_SRCS) \
@@ -1156,7 +1157,8 @@
gnu/java/nio/ServerSocketChannelImpl.java \
gnu/java/nio/ServerSocketChannelSelectionKey.java \
gnu/java/nio/SocketChannelImpl.java \
- gnu/java/nio/SocketChannelSelectionKey.java
+ gnu/java/nio/SocketChannelSelectionKey.java \
+ gnu/java/nio/VMPipe.java
gnu_java_nio_channels_SRCS = \
gnu/java/nio/channels/FileChannelImpl.java
gnu_java_nio_charset_SRCS = \
@@ -1209,6 +1211,8 @@
gnu/java/security/Engine.java \
gnu/java/security/OID.java \
gnu/java/security/PolicyFile.java
+gnu_java_security_action_SRCS = \
+ gnu/java/security/action/SetAccessibleAction.java
gnu_java_security_der_SRCS = \
gnu/java/security/der/BitString.java \
gnu/java/security/der/DEREncodingException.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.284 kaffe/libraries/javalib/Makefile.in:1.285
--- kaffe/libraries/javalib/Makefile.in:1.284 Mon Jul 26 02:41:00 2004
+++ kaffe/libraries/javalib/Makefile.in Mon Jul 26 21:13:45 2004
@@ -451,6 +451,7 @@
$(gnu_java_rmi_rmic_SRCS) \
$(gnu_java_rmi_server_SRCS) \
$(gnu_java_security_SRCS) \
+ $(gnu_java_security_action_SRCS) \
$(gnu_java_security_der_SRCS) \
$(gnu_java_security_provider_SRCS) \
$(gnu_java_security_x509_SRCS) \
@@ -1557,7 +1558,8 @@
gnu/java/nio/ServerSocketChannelImpl.java \
gnu/java/nio/ServerSocketChannelSelectionKey.java \
gnu/java/nio/SocketChannelImpl.java \
- gnu/java/nio/SocketChannelSelectionKey.java
+ gnu/java/nio/SocketChannelSelectionKey.java \
+ gnu/java/nio/VMPipe.java
gnu_java_nio_channels_SRCS = \
gnu/java/nio/channels/FileChannelImpl.java
@@ -1618,6 +1620,9 @@
gnu/java/security/Engine.java \
gnu/java/security/OID.java \
gnu/java/security/PolicyFile.java
+
+gnu_java_security_action_SRCS = \
+ gnu/java/security/action/SetAccessibleAction.java
gnu_java_security_der_SRCS = \
gnu/java/security/der/BitString.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.8 kaffe/libraries/javalib/all.files:1.9
--- kaffe/libraries/javalib/all.files:1.8 Mon Jul 26 02:41:01 2004
+++ kaffe/libraries/javalib/all.files Mon Jul 26 21:13:47 2004
@@ -787,6 +787,7 @@
gnu/java/nio/ServerSocketChannelSelectionKey.java
gnu/java/nio/SocketChannelImpl.java
gnu/java/nio/SocketChannelSelectionKey.java
+gnu/java/nio/VMPipe.java
gnu/java/rmi/dgc/DGCImpl.java
gnu/java/rmi/dgc/DGCImpl_Skel.java
gnu/java/rmi/dgc/DGCImpl_Stub.java
@@ -818,6 +819,7 @@
gnu/java/rmi/server/UnicastRemoteStub.java
gnu/java/rmi/server/UnicastServer.java
gnu/java/rmi/server/UnicastServerRef.java
+gnu/java/security/action/SetAccessibleAction.java
gnu/java/security/der/BitString.java
gnu/java/security/der/DEREncodingException.java
gnu/java/security/der/DER.java
Index: kaffe/libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java
diff -u kaffe/libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java:1.4 kaffe/libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java:1.5
--- kaffe/libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java:1.4 Thu Jul 22 19:20:08 2004
+++ kaffe/libraries/javalib/gnu/java/awt/ComponentDataBlitOp.java Mon Jul 26 21:13:47 2004
@@ -36,9 +36,14 @@
package gnu.java.awt;
-import java.awt.geom.*;
-import java.awt.image.*;
import java.awt.RenderingHints;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.ComponentSampleModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.Raster;
+import java.awt.image.RasterOp;
+import java.awt.image.WritableRaster;
/**
* This raster copy operation assumes that both source and destination
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.1 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.2
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.1 Thu Jul 22 19:20:17 2004
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java Mon Jul 26 21:13:48 2004
@@ -52,11 +52,15 @@
native void create (String label);
native void addItem (MenuItemPeer item, int key, boolean shiftModifier);
native void setupAccelGroup (GtkGenericPeer container);
+ native void addTearOff ();
public GtkMenuPeer (Menu menu)
{
super (menu);
+ if (menu.isTearOff())
+ addTearOff();
+
MenuContainer parent = menu.getParent ();
if (parent instanceof Menu)
setupAccelGroup ((GtkGenericPeer)((Menu)parent).getPeer ());
Index: kaffe/libraries/javalib/gnu/java/io/EncodingManager.java
diff -u kaffe/libraries/javalib/gnu/java/io/EncodingManager.java:1.3 kaffe/libraries/javalib/gnu/java/io/EncodingManager.java:1.4
--- kaffe/libraries/javalib/gnu/java/io/EncodingManager.java:1.3 Mon Mar 22 11:24:13 2004
+++ kaffe/libraries/javalib/gnu/java/io/EncodingManager.java Mon Jul 26 21:13:49 2004
@@ -38,17 +38,17 @@
package gnu.java.io;
-import gnu.java.io.decode.Decoder;
-import gnu.java.io.decode.KaffeDecoder;
-import gnu.java.io.encode.Encoder;
-import gnu.java.io.encode.KaffeEncoder;
-
+import java.lang.reflect.Constructor;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Hashtable;
+import java.util.StringTokenizer;
+import gnu.java.io.decode.Decoder;
+import gnu.java.io.encode.Encoder;
+
-// gnu.java.io.EncodingManager that works with kaffe
+import java.io.FileOutputStream;
/**
* This class is used to create new instances of Decoders for a specified
@@ -57,8 +57,7 @@
*
* @version 0.0
*
- * @author Aaron M. Renn (arenn at urbanophile.com),
- * Ito Kazumitsu (kaz at maczuka.gcd.org)
+ * @author Aaron M. Renn (arenn at urbanophile.com)
*/
public class EncodingManager
{
@@ -70,9 +69,24 @@
*/
/**
+ * This is the encoding class search path
+ */
+private static String encoding_path;
+
+/**
* This is the system default character encoding
*/
-private static String default_encoding = "Default";
+private static String default_encoding;
+
+/**
+ * This is the <code>Constructor</code> for the default <code>Decoder</code>
+ */
+private static Constructor default_decoder_cons;
+
+/**
+ * This is the <code>Constructor</code> for the default <code>Encoder</code>
+ */
+private static Constructor default_encoder_cons;
/**
* This is the default instance of the default <code>Decoder</code>, put
@@ -87,42 +101,68 @@
private static Encoder default_encoder_instance;
/**
+ * This is our hash table of previously loaded <code>Decoder</code> classes
+ */
+private static Hashtable decoder_cons;
+
+/**
* This is hash table of cached instances of <code>Decoder</code> objects
*/
private static Hashtable decoder_instances;
/**
+ * This is our hash table of previously loaded <code>Encoder</code> classes
+ */
+private static Hashtable encoder_cons;
+
+/**
* This is hash table of cached instances of <code>Encoder</code> objects
*/
private static Hashtable encoder_instances;
-/*
static
{
// Initialize hashtables
+ decoder_cons = new Hashtable();
+ encoder_cons = new Hashtable();
decoder_instances = new Hashtable();
encoder_instances = new Hashtable();
+ // Find the system default decoder search path
+ encoding_path = System.getProperty("file.encoding.pkg");
+ if (encoding_path == null)
+ encoding_path = "gnu.java.io";
+ else
+ encoding_path = encoding_path + ":gnu.java.io";
+
// Find the system default encoding name
- // String default_encoding = System.getProperty("file.encoding","8859_1");
- // I am not sure whether System has already been initialized.
- String default_encoding = "Default";
+ String default_encoding = System.getProperty("file.encoding","8859_1");
// Load the class
try
{
// First the Decoder side
+ default_decoder_cons = findDecoderConstructor(default_encoding, true);
+
+ Object[] objs = new Object[1];
+ objs[0] = null;
default_decoder_instance =
- new KaffeDecoder(null, default_encoding);
+ (Decoder)default_decoder_cons.newInstance(objs);
// Now the Encoder side
+ default_encoder_cons = findEncoderConstructor(default_encoding, true);
+
+ objs = new Object[1];
+ objs[0] = null;
default_encoder_instance =
- new KaffeEncoder(null, default_encoding);
+ (Encoder)default_encoder_cons.newInstance(objs);
// Add items to the hashtable;
+ decoder_cons.put(default_encoding, default_decoder_cons);
+ encoder_cons.put(default_encoding, default_encoder_cons);
decoder_instances.put(default_encoding, default_decoder_instance);
encoder_instances.put(default_encoding, default_encoder_instance);
}
@@ -131,8 +171,7 @@
throw new Error("Cannot load system default encoding '" +
default_encoding + "': " + e.getMessage());
}
-}
-*/
+}
/*************************************************************************/
@@ -140,6 +179,90 @@
* Class Methods
*/
+/**
+ * This method loads a <code>Decoder</code> class for the given
+ * encoding name.
+ *
+ * @exception UnsupportedEncodingException If a <code>Decoder</code> for this encoding cannot be found.
+ */
+private static Constructor
+findDecoderConstructor(String encoding, boolean cache)
+ throws UnsupportedEncodingException
+{
+ // First check for an aliased encoding name
+ String alias = System.getProperty("gnu.java.io.encoding_scheme_alias." +
+ encoding);
+ if (alias != null)
+ encoding = alias;
+
+ StringTokenizer st = new StringTokenizer(encoding_path, ":");
+
+ while (st.hasMoreTokens())
+ {
+ String classname = st.nextToken() + ".decode.Decoder" + encoding;
+ try
+ {
+ Class cls = Class.forName(classname);
+
+ Class[] params = new Class[1];
+ params[0] = InputStream.class;
+
+ Constructor cons = cls.getConstructor(params);
+
+ if (cache)
+ decoder_cons.put(encoding, cons);
+
+ return(cons);
+ }
+ catch(Exception e) { ; }
+ }
+
+ throw new UnsupportedEncodingException(encoding);
+}
+
+/*************************************************************************/
+
+/**
+ * This method loads an <code>Encoder</code> class for the given
+ * encoding name.
+ *
+ * @exception UnsupportedEncodingException If a <code>Encoder</code> for this encoding cannot be found.
+ */
+private static Constructor
+findEncoderConstructor(String encoding, boolean cache)
+ throws UnsupportedEncodingException
+{
+ // First check for an aliased encoding name
+ String alias = System.getProperty("gnu.java.io.encoding_scheme_alias." +
+ encoding);
+ if (alias != null)
+ encoding = alias;
+
+ StringTokenizer st = new StringTokenizer(encoding_path, ":");
+
+ while (st.hasMoreTokens())
+ {
+ String classname = st.nextToken() + ".encode.Encoder" + encoding;
+ try
+ {
+ Class cls = Class.forName(classname);
+
+ Class[] params = new Class[1];
+ params[0] = OutputStream.class;
+
+ Constructor cons = cls.getConstructor(params);
+
+ if (cache)
+ encoder_cons.put(encoding, cons);
+
+ return(cons);
+ }
+ catch(Exception e) { ; }
+ }
+
+ throw new UnsupportedEncodingException(encoding);
+}
+
/*************************************************************************/
/**
@@ -151,11 +274,9 @@
* @return An instance of the default <code>Decoder</code>.
*/
public static Decoder
-getDecoder() throws UnsupportedEncodingException
+getDecoder()
{
- // return(default_decoder_instance);
- // return(new KaffeDecoder(null, default_encoding));
- return(new KaffeDecoder(null, "Default"));
+ return(default_decoder_instance);
}
/*************************************************************************/
@@ -202,7 +323,6 @@
public static Decoder
getDecoder(String encoding, boolean cache) throws UnsupportedEncodingException
{
- if (decoder_instances == null) decoder_instances = new Hashtable();
Decoder dec = (Decoder)decoder_instances.get(encoding);
if (dec != null)
return(dec);
@@ -227,15 +347,20 @@
public static Decoder
getDecoder(InputStream in)
{
+ Object[] params = new Object[1];
+ params[0] = in;
+
+ Decoder dec = null;
try
{
- // return(getDecoder(in, default_encoding, false));
- return(getDecoder(in, "Default", false));
+ dec = (Decoder)default_decoder_cons.newInstance(params);
}
catch(Exception e)
{
throw new Error("Unexpected problems with default decoder");
}
+
+ return(dec);
}
/*************************************************************************/
@@ -269,7 +394,7 @@
*
* @param in The <code>InputStream</code> to read from
* @param encoding The name of the character encoding scheme to use
- * @param cache <code>true</code> to cache the returned <code>Decoder</code>, <code>false</code> otherwise. Actually, not used.
+ * @param cache <code>true</code> to cache the returned <code>Decoder</code>, <code>false</code> otherwise.
*
* @exception UnsupportedEncodingException If a <code>Decoder</code> for this encoding cannot be found
*/
@@ -277,10 +402,14 @@
getDecoder(InputStream in, String encoding, boolean cache)
throws UnsupportedEncodingException
{
+ Constructor cons = findDecoderConstructor(encoding, cache);
+ Object[] params = new Object[1];
+ params[0] = in;
+
Decoder dec = null;
try
{
- dec = new KaffeDecoder(in, encoding);
+ dec = (Decoder)cons.newInstance(params);
}
catch(Exception e)
{
@@ -303,8 +432,7 @@
public static Encoder
getEncoder()
{
- // return(default_encoder_instance);
- return(new KaffeEncoder(null, "Default"));
+ return(default_encoder_instance);
}
/*************************************************************************/
@@ -351,7 +479,6 @@
public static Encoder
getEncoder(String encoding, boolean cache) throws UnsupportedEncodingException
{
- if (encoder_instances == null) encoder_instances = new Hashtable();
Encoder enc = (Encoder)encoder_instances.get(encoding);
if (enc != null)
return(enc);
@@ -376,15 +503,17 @@
public static Encoder
getEncoder(OutputStream out)
{
+ Object[] params = new Object[1];
+ params[0] = out;
+
Encoder enc = null;
try
{
- // enc = getEncoder(out, default_encoding, false);
- enc = getEncoder(out, "Default", false);
+ enc = (Encoder)default_encoder_cons.newInstance(params);
}
catch(Exception e)
{
- throw new Error("Unexpected problems with default encoder");
+ throw new Error("Unexpected problems with default decoder");
}
return(enc);
@@ -421,7 +550,7 @@
*
* @param in The <code>OutputStream</code> to read from
* @param encoding The name of the character encoding scheme to use
- * @param cache <code>true</code> to cache the returned <code>Encoder</code>, <code>false</code> otherwise. Actually, not used.
+ * @param cache <code>true</code> to cache the returned <code>Encoder</code>, <code>false</code> otherwise.
*
* @exception UnsupportedEncodingException If a <code>Decoder</code> for this encoding cannot be found
*/
@@ -429,10 +558,14 @@
getEncoder(OutputStream out, String encoding, boolean cache)
throws UnsupportedEncodingException
{
+ Constructor cons = findEncoderConstructor(encoding, cache);
+ Object[] params = new Object[1];
+ params[0] = out;
+
Encoder enc = null;
try
{
- enc = new KaffeEncoder(out, encoding);
+ enc = (Encoder)cons.newInstance(params);
}
catch(Exception e)
{
Index: kaffe/libraries/javalib/gnu/java/math/MPN.java
diff -u kaffe/libraries/javalib/gnu/java/math/MPN.java:1.1 kaffe/libraries/javalib/gnu/java/math/MPN.java:1.2
--- kaffe/libraries/javalib/gnu/java/math/MPN.java:1.1 Sun Jul 18 15:28:11 2004
+++ kaffe/libraries/javalib/gnu/java/math/MPN.java Mon Jul 26 21:13:50 2004
@@ -1,5 +1,5 @@
/* gnu.java.math.MPN
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -482,7 +482,7 @@
}
/** Compare x[0:size-1] with y[0:size-1], treating them as unsigned integers.
- * @result -1, 0, or 1 depending on if x<y, x==y, or x>y.
+ * @result -1, 0, or 1 depending on if x<y, x==y, or x>y.
* This is basically the same as gmp's mpn_cmp function.
*/
public static int cmp (int[] x, int[] y, int size)
@@ -502,22 +502,24 @@
return 0;
}
- /** Compare x[0:xlen-1] with y[0:ylen-1], treating them as unsigned integers.
- * @result -1, 0, or 1 depending on if x<y, x==y, or x>y.
+ /**
+ * Compare x[0:xlen-1] with y[0:ylen-1], treating them as unsigned integers.
+ *
+ * @return -1, 0, or 1 depending on if x<y, x==y, or x>y.
*/
public static int cmp (int[] x, int xlen, int[] y, int ylen)
{
return xlen > ylen ? 1 : xlen < ylen ? -1 : cmp (x, y, xlen);
}
- /* Shift x[x_start:x_start+len-1] count bits to the "right"
+ /**
+ * Shift x[x_start:x_start+len-1] count bits to the "right"
* (i.e. divide by 2**count).
* Store the len least significant words of the result at dest.
* The bits shifted out to the right are returned.
* OK if dest==x.
- * Assumes: 0 < count < 32
+ * Assumes: 0 < count < 32
*/
-
public static int rshift (int[] dest, int[] x, int x_start,
int len, int count)
{
@@ -535,11 +537,12 @@
return retval;
}
- /* Shift x[x_start:x_start+len-1] count bits to the "right"
+ /**
+ * Shift x[x_start:x_start+len-1] count bits to the "right"
* (i.e. divide by 2**count).
* Store the len least significant words of the result at dest.
* OK if dest==x.
- * Assumes: 0 <= count < 32
+ * Assumes: 0 <= count < 32
* Same as rshift, but handles count==0 (and has no return value).
*/
public static void rshift0 (int[] dest, int[] x, int x_start,
@@ -556,7 +559,7 @@
* @param x a two's-complement "bignum"
* @param len the number of significant words in x
* @param count the shift count
- * @return (long)(x[0..len-1] >> count).
+ * @return (long)(x[0..len-1] >> count).
*/
public static long rshift_long (int[] x, int len, int count)
{
@@ -579,7 +582,7 @@
/* Shift x[0:len-1] left by count bits, and store the len least
* significant words of the result in dest[d_offset:d_offset+len-1].
* Return the bits shifted out from the most significant digit.
- * Assumes 0 < count < 32.
+ * Assumes 0 < count < 32.
* OK if dest==x.
*/
@@ -601,7 +604,7 @@
return retval;
}
- /** Return least i such that word&(1<<i). Assumes word!=0. */
+ /** Return least i such that word & (1<<i). Assumes word!=0. */
public static int findLowestBit (int word)
{
@@ -621,7 +624,7 @@
return i;
}
- /** Return least i such that words & (1<<i). Assumes there is such an i. */
+ /** Return least i such that words & (1<<i). Assumes there is such an i. */
public static int findLowestBit (int[] words)
{
Index: kaffe/libraries/javalib/gnu/java/net/content/text/plain.java
diff -u kaffe/libraries/javalib/gnu/java/net/content/text/plain.java:1.2 kaffe/libraries/javalib/gnu/java/net/content/text/plain.java:1.3
--- kaffe/libraries/javalib/gnu/java/net/content/text/plain.java:1.2 Mon Mar 22 11:24:17 2004
+++ kaffe/libraries/javalib/gnu/java/net/content/text/plain.java Mon Jul 26 21:13:51 2004
@@ -38,9 +38,9 @@
package gnu.java.net.content.text;
-import java.io.IOException;
import java.net.ContentHandler;
import java.net.URLConnection;
+import java.io.IOException;
/**
* This class is the ContentHandler for the text/plain MIME type. It
Index: kaffe/libraries/javalib/gnu/java/net/protocol/file/Connection.java
diff -u kaffe/libraries/javalib/gnu/java/net/protocol/file/Connection.java:1.6 kaffe/libraries/javalib/gnu/java/net/protocol/file/Connection.java:1.7
--- kaffe/libraries/javalib/gnu/java/net/protocol/file/Connection.java:1.6 Mon Mar 22 11:24:18 2004
+++ kaffe/libraries/javalib/gnu/java/net/protocol/file/Connection.java Mon Jul 26 21:13:51 2004
@@ -43,8 +43,8 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilePermission;
-import java.io.IOException;
import java.io.InputStream;
+import java.io.IOException;
import java.io.OutputStream;
import java.net.ProtocolException;
import java.net.URL;
@@ -52,8 +52,8 @@
import java.security.Permission;
import java.util.AbstractSet;
import java.util.Iterator;
-import java.util.NoSuchElementException;
import java.util.Set;
+import java.util.NoSuchElementException;
/**
* This subclass of java.net.URLConnection models a URLConnection via
Index: kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java
diff -u kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.10 kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.11
--- kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.10 Mon Jul 12 01:12:18 2004
+++ kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java Mon Jul 26 21:13:51 2004
@@ -1,5 +1,6 @@
/* HttpURLConnection.java -- URLConnection class for HTTP protocol
- Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,14 +39,12 @@
package gnu.java.net.protocol.http;
-import gnu.java.net.HeaderFieldHelper;
-
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
-import java.io.IOException;
import java.io.InputStream;
+import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@@ -53,9 +52,13 @@
import java.net.ProtocolException;
import java.net.Socket;
import java.net.URL;
+import java.net.URLConnection;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import gnu.java.net.HeaderFieldHelper;
/**
* This subclass of java.net.URLConnection models a URLConnection via
@@ -76,41 +79,45 @@
* The socket we are connected to
*/
private Socket socket;
- private static int proxyPort = 80;
- private static boolean proxyInUse = false;
- private static String proxyHost = null;
-
- private static final String userAgent;
+
+ // Properties depeending on system properties settings
+ static int proxyPort = 80;
+ static boolean proxyInUse = false;
+ static String proxyHost = null;
+ static String userAgent;
static
{
- // Recognize some networking properties listed at
- // http://java.sun.com/j2se/1.4/docs/guide/net/properties.html.
- String port = null;
- proxyHost = System.getProperty("http.proxyHost");
- if (proxyHost != null)
- {
- proxyInUse = true;
- if ((port = System.getProperty("http.proxyPort")) != null)
- {
- try
- {
- proxyPort = Integer.parseInt(port);
*** Patch too long, truncated ***
More information about the kaffe
mailing list