>From 10c0c406ab074a3c7aca34ed55eb3d9ba329215b Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Wed, 11 Jul 2012 14:54:32 -0400
Subject: [PATCH]  Misc Fixes Remaining part of the code.

---
 .../src/com/netscape/cmscore/apps/CMSEngine.java   |    2 +-
 .../netscape/cmscore/base/SimpleProperties.java    |    2 +-
 .../com/netscape/cmscore/cert/CertDateCompare.java |    5 ++-
 .../src/com/netscape/cmscore/cert/CertUtils.java   |    2 +-
 .../cmscore/connector/HttpConnFactory.java         |    6 +--
 .../netscape/cmscore/connector/LocalConnector.java |    2 +-
 .../com/netscape/cmscore/security/PWsdrCache.java  |    1 -
 .../src/com/netscape/cmstools/CMCResponse.java     |   15 ++++---
 .../src/com/netscape/kra/KeyRecoveryAuthority.java |    2 +-
 .../security/extensions/GenericASN1Extension.java  |    2 +-
 .../netscape/security/pkcs/PKCS10Attribute.java    |    3 --
 .../netscape/security/util/ByteArrayLexOrder.java  |    4 +-
 .../netscape/security/util/ByteArrayTagOrder.java  |    4 +-
 base/util/src/netscape/security/x509/AlgIdDSA.java |   42 +++++++++-----------
 .../security/x509/CertificateAlgorithmId.java      |    6 +--
 .../security/x509/CertificateExtensions.java       |    6 +--
 .../security/x509/CertificateSubjectName.java      |    6 +--
 .../security/x509/CertificateValidity.java         |   10 ++---
 .../netscape/security/x509/CertificateX509Key.java |   12 +++---
 .../util/src/netscape/security/x509/Extension.java |    3 --
 .../netscape/security/x509/RevokedCertImpl.java    |    6 +--
 base/util/src/netscape/security/x509/X509Cert.java |    8 +---
 .../src/netscape/security/x509/X509CertImpl.java   |    6 +--
 .../src/netscape/security/x509/X509CertInfo.java   |    6 +--
 base/util/src/netscape/security/x509/X509Key.java  |   13 ++----
 25 files changed, 70 insertions(+), 104 deletions(-)

diff --git a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
index 13a8bb6bf9fbf7f7aafb2f2a605ca8b114eb88d3..6c2107036576f44cc9a459e9ed4f09202f09fce3 100644
--- a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
+++ b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
@@ -249,7 +249,7 @@ public class CMSEngine implements ICMSEngine {
     private static final int EE_SSL = 2;
     private static final int EE_NON_SSL = 3;
     private static final int EE_CLIENT_AUTH_SSL = 4;
-    private static String mServerCertNickname = null;
+    private String mServerCertNickname = null;
     private static String info[][] = { { null, null, null },//agent
             { null, null, null },//admin
             { null, null, null },//sslEE
diff --git a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
index c1ec27a8cb8397efb7fedc15309ef2027b67701b..2fa319ffc1a2b505bf39b52ea6aa6ec3f0ee9ae6 100644
--- a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
+++ b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
@@ -365,7 +365,7 @@ public class SimpleProperties extends Hashtable<String, String> {
      * @return the value in this property list with the specified key value.
      * @see java.util.Properties#defaults
      */
-    public String getProperty(String key, String defaultValue) {
+    public synchronized String getProperty(String key, String defaultValue) {
         String val = getProperty(key);
 
         return (val == null) ? defaultValue : val;
diff --git a/base/common/src/com/netscape/cmscore/cert/CertDateCompare.java b/base/common/src/com/netscape/cmscore/cert/CertDateCompare.java
index 30f806ea2f23c7017a07c56d0c2d20e4818527f1..c39db40d0dab4168a0292f08c863688a4344e86d 100644
--- a/base/common/src/com/netscape/cmscore/cert/CertDateCompare.java
+++ b/base/common/src/com/netscape/cmscore/cert/CertDateCompare.java
@@ -28,7 +28,10 @@ import netscape.security.x509.X509CertImpl;
  * @author kanda
  * @version $Revision$, $Date$
  */
-public class CertDateCompare implements Comparator<X509CertImpl> {
+public class CertDateCompare implements Comparator<X509CertImpl>, java.io.Serializable {
+
+    private static final long serialVersionUID = -1784015027375808580L;
+
     public CertDateCompare() {
     }
 
diff --git a/base/common/src/com/netscape/cmscore/cert/CertUtils.java b/base/common/src/com/netscape/cmscore/cert/CertUtils.java
index b7942e5a145017284bbd49453934cb5ccb2ea0df..027205aa714780fab98d502ab2c5068ab8bc8918 100644
--- a/base/common/src/com/netscape/cmscore/cert/CertUtils.java
+++ b/base/common/src/com/netscape/cmscore/cert/CertUtils.java
@@ -842,7 +842,7 @@ public class CertUtils {
             return false;
         }
 
-        if (certusage == "")
+        if (certusage.equals(""))
             CMS.debug("CertUtils: verifySystemCertByNickname(): required certusage not defined, getting current certusage");
         CMS.debug("CertUtils: verifySystemCertByNickname(): calling isCertValid()");
         try {
diff --git a/base/common/src/com/netscape/cmscore/connector/HttpConnFactory.java b/base/common/src/com/netscape/cmscore/connector/HttpConnFactory.java
index c5e3312e14e767b3255a6ee1f00a70546969b23b..a55a186e381b2369222523349ea0beff3ffc7b37 100644
--- a/base/common/src/com/netscape/cmscore/connector/HttpConnFactory.java
+++ b/base/common/src/com/netscape/cmscore/connector/HttpConnFactory.java
@@ -296,8 +296,4 @@ public class HttpConnFactory {
                 "In Http (bound) connection pool to" +
                         msg);
     }
-
-    protected void finalize()
-            throws Exception {
-    }
-}
+}
\ No newline at end of file
diff --git a/base/common/src/com/netscape/cmscore/connector/LocalConnector.java b/base/common/src/com/netscape/cmscore/connector/LocalConnector.java
index ed0d5aa6d3c2d470906ca3a86890690517940dc0..c4eb78625e9fa544db2ebb4de16ec05bc9052ddb 100644
--- a/base/common/src/com/netscape/cmscore/connector/LocalConnector.java
+++ b/base/common/src/com/netscape/cmscore/connector/LocalConnector.java
@@ -183,7 +183,7 @@ public class LocalConnector implements IConnector {
             // are persistent before the servicing.
             // Please see stateEngine() function in
             // ARequestQueue.java for details.
-            r = mSourceReqs.get(rId);
+            r = mSourceReqs.get(rId.toString());
             if (r != null) {
                 if (r.getRequestStatus() != RequestStatus.SVC_PENDING) {
                     mSource.log(ILogger.LL_FAILURE,
diff --git a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
index 810605d4122a426c0e0c662edd24027e18a3face..6a3351ebb6c3b877fb68ad8e4c2ae6e82d621561 100644
--- a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
+++ b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
@@ -128,7 +128,6 @@ public class PWsdrCache {
         cm = CryptoManager.getInstance();
         if (mTokenName != null) {
             mToken = cm.getTokenByName(mTokenName);
-            mToken = cm.getInternalKeyStorageToken();
             debug("PWsdrCache: mToken = " + mTokenName);
         } else {
             mToken = cm.getInternalKeyStorageToken();
diff --git a/base/java-tools/src/com/netscape/cmstools/CMCResponse.java b/base/java-tools/src/com/netscape/cmstools/CMCResponse.java
index 50db485a475d79000db29700defaa19de223ffe7..7bbba87975d4967c662e865d23b5635a273c859e 100644
--- a/base/java-tools/src/com/netscape/cmstools/CMCResponse.java
+++ b/base/java-tools/src/com/netscape/cmstools/CMCResponse.java
@@ -166,9 +166,10 @@ public class CMCResponse {
                             (OCTET_STRING) (ASN1Util.decode(OCTET_STRING.getTemplate(),
                                     ASN1Util.encode(recipientN.elementAt(0))));
                     byte b[] = str.toByteArray();
-                    String s = "   Value: ";
+                    StringBuilder s = new StringBuilder("   Value: ");
                     for (int m = 0; m < b.length; m++) {
-                        s = s + b[m] + " ";
+                        s.append(b[m]);
+                        s.append(" ");
                     }
                     System.out.println(s);
                 } else if (type.equals(OBJECT_IDENTIFIER.id_cmc_senderNonce)) {
@@ -179,9 +180,10 @@ public class CMCResponse {
                             (OCTET_STRING) (ASN1Util.decode(OCTET_STRING.getTemplate(),
                                     ASN1Util.encode(senderN.elementAt(0))));
                     byte b[] = str.toByteArray();
-                    String s = "   Value: ";
+                    StringBuilder s = new StringBuilder("   Value: ");
                     for (int m = 0; m < b.length; m++) {
-                        s = s + b[m] + " ";
+                        s.append(b[m]);
+                        s.append(" ");
                     }
                     System.out.println(s);
                 } else if (type.equals(OBJECT_IDENTIFIER.id_cmc_dataReturn)) {
@@ -192,9 +194,10 @@ public class CMCResponse {
                             (OCTET_STRING) (ASN1Util.decode(OCTET_STRING.getTemplate(),
                                     ASN1Util.encode(dataReturn.elementAt(0))));
                     byte b[] = str.toByteArray();
-                    String s = "   Value: ";
+                    StringBuilder s = new StringBuilder("   Value: ");
                     for (int m = 0; m < b.length; m++) {
-                        s = s + b[m] + " ";
+                        s.append(b[m]);
+                        s.append(" ");
                     }
                     System.out.println(s);
                 }
diff --git a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
index 8aebebad06c2ed21fe3158b2ff2fa06db4253db1..4ba69ef9c7c5f0e9198becc5a40618c5fd03cefb 100644
--- a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
+++ b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
@@ -420,7 +420,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
     /**
      * Clears up system during garbage collection.
      */
-    public void finalize() {
+    protected void finalize() {
         shutdown();
     }
 
diff --git a/base/util/src/netscape/security/extensions/GenericASN1Extension.java b/base/util/src/netscape/security/extensions/GenericASN1Extension.java
index 8b3b03fac70a4f13f82f37b080c869690a8df0e3..a176179244ead5faffdec8b72f0f2195fee2d9ed 100644
--- a/base/util/src/netscape/security/extensions/GenericASN1Extension.java
+++ b/base/util/src/netscape/security/extensions/GenericASN1Extension.java
@@ -74,7 +74,7 @@ public class GenericASN1Extension extends Extension
      */
     private String name;
     public String OID = null;
-    public static Hashtable<String, String> mConfig = null;
+    private Hashtable<String, String> mConfig = null;
     public String pattern = null;
     private int index = 0;
 
diff --git a/base/util/src/netscape/security/pkcs/PKCS10Attribute.java b/base/util/src/netscape/security/pkcs/PKCS10Attribute.java
index 3a2c7b43793cc373a88493bda8fe4cd9b9212d9f..c84df2a375beb1b858fb62e19f2d5988901deafd 100644
--- a/base/util/src/netscape/security/pkcs/PKCS10Attribute.java
+++ b/base/util/src/netscape/security/pkcs/PKCS10Attribute.java
@@ -61,9 +61,6 @@ import netscape.security.x509.OIDMap;
  * @version 1.13
  */
 public class PKCS10Attribute implements DerEncoder, Serializable {
-    /**
-     *
-     */
     private static final long serialVersionUID = 2002480042340316170L;
     protected ObjectIdentifier attributeId = null;
     protected CertAttrSet attributeValue = null;
diff --git a/base/util/src/netscape/security/util/ByteArrayLexOrder.java b/base/util/src/netscape/security/util/ByteArrayLexOrder.java
index 48954850e603599fbb66c955342cbe73a3327f2c..2780e527a509d237d41b2e31a12f5d97ad02f799 100644
--- a/base/util/src/netscape/security/util/ByteArrayLexOrder.java
+++ b/base/util/src/netscape/security/util/ByteArrayLexOrder.java
@@ -25,7 +25,9 @@ import java.util.Comparator;
  * @version 1.4 97/12/10
  * @author D. N. Hoover
  */
-public class ByteArrayLexOrder implements Comparator<byte[]> {
+public class ByteArrayLexOrder implements Comparator<byte[]>, java.io.Serializable {
+
+    private static final long serialVersionUID = 1897537410212918669L;
 
     /**
      * Perform lexicographical comparison of two byte arrays,
diff --git a/base/util/src/netscape/security/util/ByteArrayTagOrder.java b/base/util/src/netscape/security/util/ByteArrayTagOrder.java
index 40a62762726cdd8bf7fecbded5f67d8d02e4edee..267a12eb72bb1a181766044552b053737a77f907 100644
--- a/base/util/src/netscape/security/util/ByteArrayTagOrder.java
+++ b/base/util/src/netscape/security/util/ByteArrayTagOrder.java
@@ -19,7 +19,9 @@ package netscape.security.util;
 
 import java.util.Comparator;
 
-public class ByteArrayTagOrder implements Comparator<byte[]> {
+public class ByteArrayTagOrder implements Comparator<byte[]>, java.io.Serializable {
+
+    private static final long serialVersionUID = -2027007556858126443L;
 
     /**
      * Compare two byte arrays, by the order of their tags,
diff --git a/base/util/src/netscape/security/x509/AlgIdDSA.java b/base/util/src/netscape/security/x509/AlgIdDSA.java
index 1f00b0355d4c3a6aa9dc77553ebb0769acb4aa80..ed2a73de0e362b81e41bb60fcab1f985697470ca 100644
--- a/base/util/src/netscape/security/x509/AlgIdDSA.java
+++ b/base/util/src/netscape/security/x509/AlgIdDSA.java
@@ -186,33 +186,29 @@ public final class AlgIdDSA extends AlgorithmId implements DSAParams {
     }
 
     @Override
-    public boolean equals(Object other) {
-        if (other == null) {
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
             return false;
-        }
-        if (other instanceof AlgIdDSA) {
-            AlgIdDSA rhs = (AlgIdDSA) other;
-            if (this == rhs) {
-                return true;
-            }
-            if (!(bigIntEquals(this.p, rhs.p) && bigIntEquals(this.q, rhs.q) && bigIntEquals(this.g, rhs.g))) {
+        if (getClass() != obj.getClass())
+            return false;
+        AlgIdDSA other = (AlgIdDSA) obj;
+        if (g == null) {
+            if (other.g != null)
                 return false;
-            }
-            return super.equals(rhs);
-        }
-        return false;
-    }
-
-    public boolean bigIntEquals(BigInteger x, BigInteger y) {
-        if (x == null) {
-            if (y != null) {
+        } else if (!g.equals(other.g))
+            return false;
+        if (p == null) {
+            if (other.p != null)
                 return false;
-            }
-        } else {
-            if (!x.equals(y)) {
+        } else if (!p.equals(other.p))
+            return false;
+        if (q == null) {
+            if (other.q != null)
                 return false;
-            }
-        }
+        } else if (!q.equals(other.q))
+            return false;
         return true;
     }
 
diff --git a/base/util/src/netscape/security/x509/CertificateAlgorithmId.java b/base/util/src/netscape/security/x509/CertificateAlgorithmId.java
index b1b14f42b7e0d44adbb84f3f83de0df15d663fd1..8e669b8f91df59f53938b139b47d8b259ffd8957 100644
--- a/base/util/src/netscape/security/x509/CertificateAlgorithmId.java
+++ b/base/util/src/netscape/security/x509/CertificateAlgorithmId.java
@@ -97,13 +97,11 @@ public class CertificateAlgorithmId implements CertAttrSet, Serializable {
                 ", OID = " + (algId.getOID()).toString() + "\n");
     }
 
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws IOException {
+    private void writeObject(ObjectOutputStream stream) throws IOException {
         encode(stream);
     }
 
-    private synchronized void readObject(ObjectInputStream stream)
-            throws IOException {
+    private void readObject(ObjectInputStream stream) throws IOException {
         decode(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/CertificateExtensions.java b/base/util/src/netscape/security/x509/CertificateExtensions.java
index 93be196ab1f8413b7ab98446a407b2228c646b4c..5fdac282426772c9d21abc3982c59a1e788f7ca0 100644
--- a/base/util/src/netscape/security/x509/CertificateExtensions.java
+++ b/base/util/src/netscape/security/x509/CertificateExtensions.java
@@ -170,13 +170,11 @@ public class CertificateExtensions extends Vector<Extension>
         }
     }
 
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws CertificateException, IOException {
+    private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException {
         encode(stream);
     }
 
-    private synchronized void readObject(ObjectInputStream stream)
-            throws CertificateException, IOException {
+    private void readObject(ObjectInputStream stream) throws CertificateException, IOException {
         decodeEx(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/CertificateSubjectName.java b/base/util/src/netscape/security/x509/CertificateSubjectName.java
index 0f4ed7d61d671baadf143642d2a0d0592b92cbaa..f8dfe41f84baa9150473eff37d9ef6055b5d4fd9 100644
--- a/base/util/src/netscape/security/x509/CertificateSubjectName.java
+++ b/base/util/src/netscape/security/x509/CertificateSubjectName.java
@@ -96,13 +96,11 @@ public class CertificateSubjectName implements CertAttrSet, Serializable {
         return (dnName.toString());
     }
 
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws IOException {
+    private void writeObject(ObjectOutputStream stream) throws IOException {
         encode(stream);
     }
 
-    private synchronized void readObject(ObjectInputStream stream)
-            throws IOException {
+    private void readObject(ObjectInputStream stream) throws IOException {
         decodeEx(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/CertificateValidity.java b/base/util/src/netscape/security/x509/CertificateValidity.java
index 511f1b1eb2413742bc4e004211db6cf27cb020e7..ae24979c5d07eb4875d59ca3bb412932e6fb37cd 100644
--- a/base/util/src/netscape/security/x509/CertificateValidity.java
+++ b/base/util/src/netscape/security/x509/CertificateValidity.java
@@ -42,9 +42,7 @@ import netscape.security.util.DerValue;
  * @see CertAttrSet
  */
 public class CertificateValidity implements CertAttrSet, Serializable {
-    /**
-     *
-     */
+
     private static final long serialVersionUID = 8277703278213804194L;
     /**
      * Identifier for this attribute, to be used with the
@@ -156,13 +154,11 @@ public class CertificateValidity implements CertAttrSet, Serializable {
         construct(derVal);
     }
 
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws IOException {
+    private void writeObject(ObjectOutputStream stream) throws IOException {
         encode(stream);
     }
 
-    private synchronized void readObject(ObjectInputStream stream)
-            throws IOException {
+    private void readObject(ObjectInputStream stream) throws IOException {
         decode(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/CertificateX509Key.java b/base/util/src/netscape/security/x509/CertificateX509Key.java
index a77a1e7dde3d3674fa33472ad5ec8f22d9ccb08c..0b6f250d9bdb61567ff26ffb6e803a78ba0075cf 100644
--- a/base/util/src/netscape/security/x509/CertificateX509Key.java
+++ b/base/util/src/netscape/security/x509/CertificateX509Key.java
@@ -108,13 +108,11 @@ public class CertificateX509Key implements CertAttrSet, Serializable {
         key = X509Key.parse(val);
     }
 
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws IOException {
+    private void writeObject(ObjectOutputStream stream) throws IOException {
         encode(stream);
     }
 
-    private synchronized void readObject(ObjectInputStream stream)
-            throws IOException {
+    private void readObject(ObjectInputStream stream) throws IOException {
         decode(stream);
     }
 
@@ -142,7 +140,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable {
             this.key = (X509Key) obj;
         } else {
             throw new IOException("Attribute name not recognized by " +
-                                  "CertAttrSet: CertificateX509Key.");
+                    "CertAttrSet: CertificateX509Key.");
         }
     }
 
@@ -154,7 +152,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable {
             return (key);
         } else {
             throw new IOException("Attribute name not recognized by " +
-                                  "CertAttrSet: CertificateX509Key.");
+                    "CertAttrSet: CertificateX509Key.");
         }
     }
 
@@ -166,7 +164,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable {
             key = null;
         } else {
             throw new IOException("Attribute name not recognized by " +
-                                  "CertAttrSet: CertificateX509Key.");
+                    "CertAttrSet: CertificateX509Key.");
         }
     }
 
diff --git a/base/util/src/netscape/security/x509/Extension.java b/base/util/src/netscape/security/x509/Extension.java
index 8d575606a50cb504b490e0178ed6c7b060fed794..c7b0aa887744c5b39b0391916c56753931bd414f 100644
--- a/base/util/src/netscape/security/x509/Extension.java
+++ b/base/util/src/netscape/security/x509/Extension.java
@@ -51,9 +51,6 @@ import netscape.security.util.ObjectIdentifier;
  * @version 1.9
  */
 public class Extension implements Serializable {
-    /**
-     *
-     */
     private static final long serialVersionUID = -643549610716024753L;
     protected ObjectIdentifier extensionId = null;
     protected boolean critical = false;
diff --git a/base/util/src/netscape/security/x509/RevokedCertImpl.java b/base/util/src/netscape/security/x509/RevokedCertImpl.java
index df3bc37a8debc5411d60702ca739d6616660ea51..eac11f8e3f13e088cd8ebcc9c1e6e37c5772363c 100755
--- a/base/util/src/netscape/security/x509/RevokedCertImpl.java
+++ b/base/util/src/netscape/security/x509/RevokedCertImpl.java
@@ -432,8 +432,7 @@ public class RevokedCertImpl extends RevokedCertificate implements Serializable
      * they're parsed when they get read back. (Actually they serialize as some
      * type data from the serialization subsystem, then the cert data.)
      */
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws CRLException, X509ExtensionException, IOException {
+    private void writeObject(ObjectOutputStream stream) throws CRLException, X509ExtensionException, IOException {
         DerOutputStream dos = new DerOutputStream();
         encode(dos);
         dos.derEncode(stream);
@@ -443,8 +442,7 @@ public class RevokedCertImpl extends RevokedCertificate implements Serializable
      * Serialization read ... X.509 certificates serialize as themselves, and
      * they're parsed when they get read back.
      */
-    private synchronized void readObject(ObjectInputStream stream)
-            throws CRLException, X509ExtensionException, IOException {
+    private void readObject(ObjectInputStream stream) throws CRLException, X509ExtensionException, IOException {
         decode(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/X509Cert.java b/base/util/src/netscape/security/x509/X509Cert.java
index ea1e26debf4cb66fc62de7545b586fbeee87cf02..021cae2070580dd45ce2d290daebe59c8e9d37b3 100644
--- a/base/util/src/netscape/security/x509/X509Cert.java
+++ b/base/util/src/netscape/security/x509/X509Cert.java
@@ -831,9 +831,7 @@ public class X509Cert implements Certificate, Serializable {
      * (Actually they serialize as some type data from the
      * serialization subsystem, then the cert data.)
      */
-    private synchronized void
-            writeObject(java.io.ObjectOutputStream stream)
-                    throws IOException {
+    private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
         encode(stream);
     }
 
@@ -841,9 +839,7 @@ public class X509Cert implements Certificate, Serializable {
      * Serialization read ... X.509 certificates serialize as
      * themselves, and they're parsed when they get read back.
      */
-    private synchronized void
-            readObject(ObjectInputStream stream)
-                    throws IOException {
+    private void readObject(ObjectInputStream stream) throws IOException {
         decode(stream);
     }
 }
diff --git a/base/util/src/netscape/security/x509/X509CertImpl.java b/base/util/src/netscape/security/x509/X509CertImpl.java
index b6d97da3868b659bf615eba623e4868d5b64e4b1..2d24b66590c1957a09665e78c6382a69a8cfe797 100755
--- a/base/util/src/netscape/security/x509/X509CertImpl.java
+++ b/base/util/src/netscape/security/x509/X509CertImpl.java
@@ -1149,8 +1149,7 @@ public class X509CertImpl extends X509Certificate
      * (Actually they serialize as some type data from the
      * serialization subsystem, then the cert data.)
      */
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws CertificateException, IOException {
+    private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException {
         encode(stream);
     }
 
@@ -1158,8 +1157,7 @@ public class X509CertImpl extends X509Certificate
      * Serialization read ... X.509 certificates serialize as
      * themselves, and they're parsed when they get read back.
      */
-    private synchronized void readObject(ObjectInputStream stream)
-            throws CertificateException, IOException {
+    private void readObject(ObjectInputStream stream) throws CertificateException, IOException {
         decode(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/X509CertInfo.java b/base/util/src/netscape/security/x509/X509CertInfo.java
index 6ad4d243fb47a5cf14f1cfe808ba1c023dd80a1d..2ad17ebc023f65d56aae20f94ef859302343135e 100644
--- a/base/util/src/netscape/security/x509/X509CertInfo.java
+++ b/base/util/src/netscape/security/x509/X509CertInfo.java
@@ -796,8 +796,7 @@ public class X509CertInfo implements CertAttrSet, Serializable {
      * (Actually they serialize as some type data from the
      * serialization subsystem, then the cert data.)
      */
-    private synchronized void writeObject(ObjectOutputStream stream)
-            throws CertificateException, IOException {
+    private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException {
         encode(stream);
     }
 
@@ -805,8 +804,7 @@ public class X509CertInfo implements CertAttrSet, Serializable {
      * Serialization read ... X.509 certificates serialize as
      * themselves, and they're parsed when they get read back.
      */
-    private synchronized void readObject(ObjectInputStream stream)
-            throws CertificateException, IOException {
+    private void readObject(ObjectInputStream stream) throws CertificateException, IOException {
         decode(stream);
     }
 
diff --git a/base/util/src/netscape/security/x509/X509Key.java b/base/util/src/netscape/security/x509/X509Key.java
index 5c8ac3a88e4e9a16f83edb649935db487f3d9441..7af1036ea3609172a2fd800248532351d3c56751 100644
--- a/base/util/src/netscape/security/x509/X509Key.java
+++ b/base/util/src/netscape/security/x509/X509Key.java
@@ -354,9 +354,7 @@ public class X509Key implements PublicKey {
      * Serialization write ... X.509 keys serialize as
      * themselves, and they're parsed when they get read back.
      */
-    private synchronized void
-            writeObject(java.io.ObjectOutputStream stream)
-                    throws IOException {
+    private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
         stream.write(getEncoded());
     }
 
@@ -364,17 +362,12 @@ public class X509Key implements PublicKey {
      * Serialization read ... X.509 keys serialize as
      * themselves, and they're parsed when they get read back.
      */
-    private synchronized void
-            readObject(ObjectInputStream stream)
-                    throws IOException {
-
+    private void readObject(ObjectInputStream stream) throws IOException {
         try {
             decode(stream);
-
         } catch (InvalidKeyException e) {
             e.printStackTrace();
-            throw new IOException("deserialized key is invalid: " +
-                    e.getMessage());
+            throw new IOException("deserialized key is invalid: " + e.getMessage());
         }
     }
 
-- 
1.7.10.2

