Il giorno mer, 12/07/2006 alle 19.24 +0200, Mario Torre ha scritto:
> This patch is hopefully a fix for clone method in
> gnu.java.security.OID.java
> Can someone please comment on this?

I noticed that this class implements java.io.Serializable, but does not
have a serialVersionUID, so this new patch adds it, and also fixes
clone.

Comments are welcomed,
Mario

2006-07-12  Mario Torre  <[EMAIL PROTECTED]>

        * gnu/java/security/OID.java: new field serialVersionUID.
        (clone): Fixed.
-- 
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
### Eclipse Workspace Patch 1.0
#P classpath
Index: gnu/java/security/OID.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/java/security/OID.java,v
retrieving revision 1.7
diff -u -r1.7 OID.java
--- gnu/java/security/OID.java	20 May 2006 03:25:09 -0000	1.7
+++ gnu/java/security/OID.java	12 Jul 2006 18:21:21 -0000
@@ -71,6 +71,9 @@
   // Fields.
   // ------------------------------------------------------------------------
 
+  /* Serial version id for serialization. */
+  static final long serialVersionUID = 5722492029044597779L;
+  
   /**
    * The numeric ID structure.
    */
@@ -325,10 +328,16 @@
    */
   public Object clone()
   {
-    OID oid = new OID();
-    oid.components = this.components;
-    oid.strRep = this.strRep;
-    return oid;
+    try
+    {
+      return super.clone();
+    }
+  catch (CloneNotSupportedException cnse)
+    {
+      InternalError ie = new InternalError();
+      ie.initCause(cnse);
+      throw ie;
+    }
   }
 
   /* Nice idea, but possibly too expensive for whatever benefit it

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

Reply via email to