[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath: serialisation fixes for URI

Kaffe CVS cvs-commits at kaffe.org
Wed Aug 18 13:02:42 PDT 2004


PatchSet 5079 
Date: 2004/08/18 19:58:26
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: serialisation fixes for URI

2004-08-18  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/net/URI.java:
        Resynced with GNU Classpath.

        2004-08-18  Bryce McKinlay  <mckinlay at redhat.com>

        PR libgcj/17081
        * java/net/URI.java (string): New field. Make all other fields
        transient.
        (readObject): Implemented.
        (writeObject): Implemented.
        (URI): Set 'string'.

Members: 
	ChangeLog:1.2637->1.2638 
	libraries/javalib/java/net/URI.java:1.7->1.8 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2637 kaffe/ChangeLog:1.2638
--- kaffe/ChangeLog:1.2637	Wed Aug 18 16:37:55 2004
+++ kaffe/ChangeLog	Wed Aug 18 19:58:26 2004
@@ -1,5 +1,19 @@
 2004-08-18  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/net/URI.java:
+	Resynced with GNU Classpath.
+
+	2004-08-18  Bryce McKinlay  <mckinlay at redhat.com>
+
+        PR libgcj/17081
+        * java/net/URI.java (string): New field. Make all other fields
+        transient.
+        (readObject): Implemented.
+        (writeObject): Implemented.
+        (URI): Set 'string'.
+
+2004-08-18  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/util/logging/Handler.java:
 	Resynced with GNU Classpath.
 
Index: kaffe/libraries/javalib/java/net/URI.java
diff -u kaffe/libraries/javalib/java/net/URI.java:1.7 kaffe/libraries/javalib/java/net/URI.java:1.8
--- kaffe/libraries/javalib/java/net/URI.java:1.7	Mon May 17 22:25:07 2004
+++ kaffe/libraries/javalib/java/net/URI.java	Wed Aug 18 19:58:30 2004
@@ -111,30 +111,44 @@
    * Index of fragment component in parsed URI.
    */
   private static final int FRAGMENT_GROUP = 10;
-  private String scheme;
-  private String rawSchemeSpecificPart;
-  private String schemeSpecificPart;
-  private String rawAuthority;
-  private String authority;
-  private String rawUserInfo;
-  private String userInfo;
-  private String rawHost;
-  private String host;
-  private int port;
-  private String rawPath;
-  private String path;
-  private String rawQuery;
-  private String query;
-  private String rawFragment;
-  private String fragment;
+  private transient String scheme;
+  private transient String rawSchemeSpecificPart;
+  private transient String schemeSpecificPart;
+  private transient String rawAuthority;
+  private transient String authority;
+  private transient String rawUserInfo;
+  private transient String userInfo;
+  private transient String rawHost;
+  private transient String host;
+  private transient int port;
+  private transient String rawPath;
+  private transient String path;
+  private transient String rawQuery;
+  private transient String query;
+  private transient String rawFragment;
+  private transient String fragment;
+  private String string;
 
   private void readObject(ObjectInputStream is)
     throws ClassNotFoundException, IOException
   {
+    this.string = (String) is.readObject();
+    try
+    {
+      parseURI(this.string);
+    }
+    catch (URISyntaxException x)
+    {
+      // Should not happen.
+      throw new RuntimeException(x);
+    }
   }
 
-  private void writeObject(ObjectOutputStream is) throws IOException
-  {
+  private void writeObject(ObjectOutputStream os) throws IOException
+  {
+    if (string == null)
+      string = toString(); 
+    os.writeObject(string);
   }
 
   private static String getURIGroup(Matcher match, int group)
@@ -362,6 +376,7 @@
    */
   public URI(String str) throws URISyntaxException
   {
+    this.string = str;
     parseURI(str);
   }
 




More information about the kaffe mailing list