harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r392202 [2/5] - in /incubator/harmony/enhanced/classlib/trunk/modules: crypto/src/main/java/javax/crypto/spec/ security/src/main/java/common/java/security/ security/src/main/java/common/java/security/cert/ security/src/main/java/common/java...
Date Fri, 07 Apr 2006 06:53:12 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/EDIPartyName.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/EDIPartyName.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/EDIPartyName.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/EDIPartyName.java Thu Apr  6 23:52:51 2006
@@ -21,14 +21,10 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
-
 import org.apache.harmony.security.asn1.ASN1Explicit;
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
-
-import org.apache.harmony.security.asn1.*;
 import org.apache.harmony.security.x501.DirectoryString;
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extension.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extension.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extension.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extension.java Thu Apr  6 23:52:51 2006
@@ -29,6 +29,7 @@
 
 import javax.security.auth.x500.X500Principal;
 
+import org.apache.harmony.security.asn1.ASN1BitString;
 import org.apache.harmony.security.asn1.ASN1Boolean;
 import org.apache.harmony.security.asn1.ASN1Enumerated;
 import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
@@ -41,8 +42,6 @@
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.BitString;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
-
-import org.apache.harmony.security.asn1.ASN1BitString;
 import org.apache.harmony.security.x501.Name;
 
 /**
@@ -139,20 +138,6 @@
 
     // 
     // TODO
-    // @param   extnID: String
-    // @param   critical:   boolean
-    // @param   extnValue:  byte[]
-    // @param   encoding:   byte[]
-    // 
-    private Extension(String extnID, boolean critical, byte[] extnValue,
-            byte[] rawExtnValue, byte[] encoding) {
-        this(extnID, critical, extnValue);
-        this.rawExtnValue = rawExtnValue;
-        this.encoding = encoding;
-    }
-    
-    // 
-    // TODO
     // @param   extnID: int[]
     // @param   critical:   boolean
     // @param   extnValue:  byte[]
@@ -301,13 +286,6 @@
             this.keys = keys;
         }
 
-        private ExtendedKeyUsage(boolean critical, byte[] extnValue, 
-                byte[] rawExtnValue, byte[] encoding) throws IOException {
-            super(EXTENDED_KEY_USAGE, critical, 
-                    extnValue, rawExtnValue, encoding);
-            this.keys = (List) ASN1.decode(extnValue);
-        }
-
         public List getExtendedKeyUsage() {
             return keys;
         }
@@ -485,11 +463,8 @@
      */
     public static class AuthKeyId extends Extension {
 
-        private final AuthorityKeyIdentifier authKeyID;
-        
         public AuthKeyId(AuthorityKeyIdentifier authKeyID) {
             super(AUTH_KEY_ID, NON_CRITICAL, authKeyID.getEncoded());
-            this.authKeyID = authKeyID;
         }
     }
    
@@ -508,11 +483,8 @@
      */
     public static class CertificateIssuer extends Extension {
 
-        private final GeneralName issuer;
-        
         public CertificateIssuer(GeneralName issuer) {
             super(CERTIFICATE_ISSUER, CRITICAL, ASN1.encode(issuer));
-            this.issuer = issuer;
         }
         
         public static ASN1Type ASN1 = new ASN1Sequence(new ASN1Type[] {
@@ -542,11 +514,8 @@
      */
     public static class InvalidityDate extends Extension {
 
-        private final Date date;
-        
         public InvalidityDate(Date date) {
             super(INVALIDITY_DATE, NON_CRITICAL, ASN1.encode(date));
-            this.date = date;
         }
         
         public static ASN1Type ASN1 = ASN1GeneralizedTime.getInstance();
@@ -575,12 +544,9 @@
      */
     public static class ReasonCode extends Extension {
 
-        private final int code;
-        
         public ReasonCode(int code) {
             super(REASON_CODE, NON_CRITICAL, 
                     ASN1.encode(new byte[] {(byte) code}));
-            this.code = code;
         }
         
         public static ASN1Type ASN1 = ASN1Enumerated.getInstance();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extensions.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extensions.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extensions.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extensions.java Thu Apr  6 23:52:51 2006
@@ -22,14 +22,15 @@
 package org.apache.harmony.security.x509;
 
 import java.io.IOException;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Arrays;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 import javax.security.auth.x500.X500Principal;
 
 import org.apache.harmony.security.asn1.ASN1SequenceOf;
@@ -82,17 +83,6 @@
         this.extensions = extensions;
     }
     
-    // 
-    // TODO
-    // @param   extensions: List
-    // @param   encoding:   byte[]
-    // 
-    private Extensions(List extensions, byte[] encoding) {
-        this.extensions = extensions;
-        this.encoding = new byte[encoding.length];
-        System.arraycopy(encoding, 0, this.encoding, 0, encoding.length);
-    }
-
     /**
      * Returns the values of extensions.
      * @return  extensions

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java Thu Apr  6 23:52:51 2006
@@ -38,8 +38,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
-
-import org.apache.harmony.security.asn1.*;
 import org.apache.harmony.security.x501.Name;
 
 /**
@@ -158,7 +156,7 @@
                 this.name = name;
                 break;
             case REG_ID:
-                this.name = ObjectIdentifier.toIntArray((String) name);
+                this.name = ObjectIdentifier.toIntArray(name);
                 break;
             case DIR_NAME :
                 try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralNames.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralNames.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralNames.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralNames.java Thu Apr  6 23:52:51 2006
@@ -21,10 +21,9 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.harmony.security.asn1.ASN1SequenceOf;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtree.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtree.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtree.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtree.java Thu Apr  6 23:52:51 2006
@@ -27,8 +27,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with the GeneralSubtree structure which is a part of X.509 certificate:
@@ -91,22 +89,6 @@
         this.maximum = maximum;
     }
     
-    // 
-    // TODO
-    // @param   base:   GeneralName
-    // @param   minimum:    int
-    // @param   maximum:    int
-    // @param   encoding:   byte[]
-    // 
-    private GeneralSubtree(GeneralName base, int minimum, int maximum, 
-                           byte[] encoding) {
-        this.base = base;
-        this.minimum = minimum;
-        this.maximum = maximum;
-        this.encoding = new byte[encoding.length];
-        System.arraycopy(encoding, 0, this.encoding, 0, encoding.length);
-    }
-
     /**
      * Returns the value of base field of the structure.
      * @return  base
@@ -158,10 +140,10 @@
             Object[] values = (Object[]) in.content;
             int maximum = -1; // is optional maximum missing?
             if (values[2] != null) {
-                maximum = ASN1Integer.toIntValue((byte[]) values[2]); // no!
+                maximum = ASN1Integer.toIntValue(values[2]); // no!
             }
             return new GeneralSubtree((GeneralName) values[0],
-                    ASN1Integer.toIntValue((byte[]) values[1]),
+                    ASN1Integer.toIntValue(values[1]),
                     maximum);
         }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtrees.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtrees.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtrees.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralSubtrees.java Thu Apr  6 23:52:51 2006
@@ -21,9 +21,7 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Collection;
 import java.util.List;
 
@@ -31,8 +29,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with the GeneralSubtrees structure which is a part of X.509 certificate:
@@ -70,16 +66,6 @@
         this.generalSubtrees = generalSubtrees;
     }
     
-    // 
-    // TODO
-    // @param   generalSubtrees:    List
-    // @param   encoding:   byte[]
-    // 
-    private GeneralSubtrees(List generalSubtrees, byte[] encoding) {
-        this.generalSubtrees = generalSubtrees;
-        this.encoding = encoding;
-    }
-
     /**
      * Returns the list of values of subtrees.
      * @return  subtrees

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/NameConstraints.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/NameConstraints.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/NameConstraints.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/NameConstraints.java Thu Apr  6 23:52:51 2006
@@ -33,8 +33,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with the following structure which is a part of X.509 certificate
@@ -75,7 +73,7 @@
      */
     public NameConstraints() {
         this(null, null);
-    };
+    }
     
     /**
      * Constructs <code>NameConstrains</code> object
@@ -100,7 +98,7 @@
         }
         this.permittedSubtrees = permittedSubtrees;
         this.excludedSubtrees = excludedSubtrees;
-    };
+    }
 
     //
     // Constructs NameConstrains object

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ORAddress.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ORAddress.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ORAddress.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ORAddress.java Thu Apr  6 23:52:51 2006
@@ -21,14 +21,10 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
-
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with the ORAddress structure which is a part of X.509 certificate:
@@ -57,14 +53,6 @@
      * TODO
      */
     public ORAddress() {}
-    
-    // 
-    // TODO
-    // @param   encoding:   byte[]
-    // 
-    private ORAddress(byte[] encoding) {
-        this.encoding = encoding;
-    }
     
     /**
      * Returns ASN.1 encoded form of this X.509 ORAddress value.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/OtherName.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/OtherName.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/OtherName.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/OtherName.java Thu Apr  6 23:52:51 2006
@@ -29,8 +29,6 @@
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with OtherName structure which is a subpart of GeneralName

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyConstraints.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyConstraints.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyConstraints.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyConstraints.java Thu Apr  6 23:52:51 2006
@@ -21,12 +21,7 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
-import java.security.cert.X509Certificate;
 import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
 
 import org.apache.harmony.security.asn1.ASN1Implicit;
 import org.apache.harmony.security.asn1.ASN1Integer;
@@ -34,8 +29,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with PolicyConstraints structure which is a part of X.509 certificate
@@ -73,7 +66,7 @@
      */
     public PolicyConstraints() {
         this(null, null);
-    };
+    }
     
     /**
      * TODO
@@ -84,7 +77,7 @@
             BigInteger inhibitPolicyMapping) {
         this.requireExplicitPolicy = requireExplicitPolicy;
         this.inhibitPolicyMapping = inhibitPolicyMapping;
-    };
+    }
 
     //
     // TODO

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyInformation.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyInformation.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyInformation.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PolicyInformation.java Thu Apr  6 23:52:51 2006
@@ -27,8 +27,6 @@
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with PolicyInformation structure which is a subpart of certificatePolicies
@@ -64,16 +62,6 @@
         this.policyIdentifier = policyIdentifier;
     }
 
-    // 
-    // TODO
-    // @param   policyIdentifier:   String
-    // @param   encoding:   byte[]
-    // 
-    private PolicyInformation(String policyIdentifier, byte[] encoding) {
-        this.policyIdentifier = policyIdentifier;
-        this.encoding = encoding;
-    }
-        
     /**
      * Returns the value of policyIdentifier field of the structure.
      * @return  policyIdentifier

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java Thu Apr  6 23:52:51 2006
@@ -21,7 +21,6 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
 import java.util.Date;
 
 import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
@@ -29,8 +28,6 @@
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
-
-import org.apache.harmony.security.asn1.*;
 
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ReasonFlags.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ReasonFlags.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ReasonFlags.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/ReasonFlags.java Thu Apr  6 23:52:51 2006
@@ -23,10 +23,9 @@
 
 import java.io.IOException;
 
+import org.apache.harmony.security.asn1.ASN1BitString;
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.BerOutputStream;
-
-import org.apache.harmony.security.asn1.ASN1BitString;
 
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java Thu Apr  6 23:52:51 2006
@@ -21,20 +21,16 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
 import java.security.KeyFactory;
 import java.security.PublicKey;
 import java.security.spec.X509EncodedKeySpec;
 
 import org.apache.harmony.crypto.utils.AlgNameMapper;
-import org.apache.harmony.security.PublicKeyImpl;
+import org.apache.harmony.security.asn1.ASN1BitString;
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.BitString;
-
-
-import org.apache.harmony.security.asn1.*;
 
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertList.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertList.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertList.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertList.java Thu Apr  6 23:52:51 2006
@@ -25,8 +25,9 @@
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.Date;
+import java.util.List;
+
 import javax.security.auth.x500.X500Principal;
 
 import org.apache.harmony.security.asn1.ASN1Explicit;
@@ -100,15 +101,6 @@
             this.crlEntryExtensions = crlEntryExtensions;
         }
 
-        private RevokedCertificate(BigInteger userCertificate,
-                Date revocationDate, Extensions crlEntryExtensions,
-                byte[] encoding) {
-            this.userCertificate = userCertificate;
-            this.revocationDate = revocationDate;
-            this.crlEntryExtensions = crlEntryExtensions;
-            this.encoding = encoding;
-        }
-       
         public Extensions getCrlEntryExtensions() {
             return crlEntryExtensions;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertificate.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertificate.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertificate.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/TBSCertificate.java Thu Apr  6 23:52:51 2006
@@ -23,6 +23,7 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.asn1.ASN1BitString;
 import org.apache.harmony.security.asn1.ASN1Explicit;
 import org.apache.harmony.security.asn1.ASN1Implicit;
 import org.apache.harmony.security.asn1.ASN1Integer;
@@ -30,8 +31,6 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.BitString;
-
-import org.apache.harmony.security.asn1.*;
 import org.apache.harmony.security.x501.Name;
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Time.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Time.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Time.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Time.java Thu Apr  6 23:52:51 2006
@@ -21,15 +21,10 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
-import java.util.Date;
-
 import org.apache.harmony.security.asn1.ASN1Choice;
 import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.ASN1UTCTime;
-
-import org.apache.harmony.security.asn1.*;
 
 /**
  * Class represents the work with the following X.509 structure:

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Validity.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Validity.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Validity.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Validity.java Thu Apr  6 23:52:51 2006
@@ -21,15 +21,12 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.IOException;
 import java.util.Date;
 
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 
-import org.apache.harmony.security.asn1.*;
-
 /**
  * The class incapsulates the ASN.1 DER encoding/decoding work 
  * with Validity structure which is the part of X.509 certificate
@@ -63,17 +60,6 @@
         this.notAfter = notAfter;
     }
 
-    // 
-    // TODO
-    // @param   notBefore:  Date
-    // @param   notAfter:   Date
-    // @param   encoding:   byte[]
-    // 
-    private Validity(Date notBefore, Date notAfter, byte[] encoding) {
-        this(notBefore, notAfter); 
-        this.encoding = encoding;
-    }
-        
     /**
      * Returns the value of notBefore field of the structure.
      * @return  notBefore

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AccessControlExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AccessControlExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AccessControlExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AccessControlExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -50,7 +50,7 @@
      */
     public void testAccessControlExceptionStringPermission() {
         Permission perm = new AllPermission();
-        AccessControlException ex = new AccessControlException("001", perm);
+        new AccessControlException("001", perm);
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGenerator1Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGenerator1Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGenerator1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGenerator1Test.java Thu Apr  6 23:52:51 2006
@@ -53,7 +53,7 @@
 
     private static String validProviderName = null;
 
-    private static Provider validProvider = null;;
+    private static Provider validProvider = null;
 
     private static boolean DSASupported = false;
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGeneratorSpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGeneratorSpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGeneratorSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParameterGeneratorSpiTest.java Thu Apr  6 23:52:51 2006
@@ -50,10 +50,7 @@
      */
     public void testAlgorithmParameterGeneratorSpi01()
             throws InvalidAlgorithmParameterException {
-        AlgorithmParameterGeneratorSpi algParGen = 
-            (AlgorithmParameterGeneratorSpi) new MyAlgorithmParameterGeneratorSpi();
-        assertTrue("Not AlgorithmParameterGeneratorSpi object",
-                algParGen instanceof AlgorithmParameterGeneratorSpi);
+        AlgorithmParameterGeneratorSpi algParGen = new MyAlgorithmParameterGeneratorSpi();
         AlgorithmParameters param = algParGen.engineGenerateParameters();
         assertNull("Not null parameters", param);
         AlgorithmParameterSpec pp = null;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParametersTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParametersTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/AlgorithmParametersTest.java Thu Apr  6 23:52:51 2006
@@ -189,9 +189,6 @@
 	}
 	
 	private void checkAP(AlgorithmParameters ap, Provider p) {	
-		if (!(ap instanceof AlgorithmParameters)) {
-			fail("getInstance() failed");
-		}
 		if (ap.getProvider() != p) {
 			fail("getProvider() failed");
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/BasicPermissionCollectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/BasicPermissionCollectionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/BasicPermissionCollectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/BasicPermissionCollectionTest.java Thu Apr  6 23:52:51 2006
@@ -170,8 +170,7 @@
         ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(
             baos.toByteArray()));
         try {
-            BasicPermissionCollection b = (BasicPermissionCollection)in
-                .readObject();
+            in.readObject();
             fail("should throw InvalidObjectException");
         } catch (java.io.InvalidObjectException e) {
         } finally {
@@ -198,8 +197,7 @@
         ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(
             baos.toByteArray()));
         try {
-            BasicPermissionCollection b = (BasicPermissionCollection)in
-                .readObject();
+            in.readObject();
             fail("should throw InvalidObjectException");
         } catch (java.io.InvalidObjectException e) {
         } finally {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/CodeSourceTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/CodeSourceTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/CodeSourceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/CodeSourceTest.java Thu Apr  6 23:52:51 2006
@@ -549,7 +549,7 @@
             return false;
         }
         return true;
-    };
+    }
 
     /**
      * must not imply null CodeSource
@@ -748,8 +748,8 @@
         Certificate[] thizCerts = { c0, c1 };
         Certificate[] thatCerts = { c1, c0, c2 };
 
-        CodeSource thiz = new CodeSource(urlSite, (Certificate[]) thizCerts);
-        CodeSource that = new CodeSource(urlSite, (Certificate[]) thatCerts);
+        CodeSource thiz = new CodeSource(urlSite, thizCerts);
+        CodeSource that = new CodeSource(urlSite, thatCerts);
         // two CodeSource-s with different set of certificates
         assertTrue(thiz.implies(that));
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/DigestExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/DigestExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/DigestExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/DigestExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not DigestException";
-
     static String createErr(Exception tE, Exception eE) {
         return "DigestException:  ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/GeneralSecurityExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/GeneralSecurityExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/GeneralSecurityExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/GeneralSecurityExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not GeneralSecurityException";
-
     static String createErr(Exception tE, Exception eE) {
         return "GeneralSecurityException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/IdentityTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/IdentityTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/IdentityTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/IdentityTest.java Thu Apr  6 23:52:51 2006
@@ -163,7 +163,7 @@
         try {
             i.addCertificate(new CertificateStub("ccc", null, null, new PublicKeyStub("k2", "fff", new byte[]{6,7,8,9,0})));
             fail("KeyManagementException should be thrown");
-        } catch (KeyManagementException ok) {};        
+        } catch (KeyManagementException ok) {}        
     }
 
     /**
@@ -353,7 +353,7 @@
         try {
             i2.setPublicKey(null);
             //fail("KeyManagementException should be thrown - key is null");            
-        } catch (KeyManagementException ok) {};
+        } catch (KeyManagementException ok) {}
     }
     
 //

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidAlgorithmParameterExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidAlgorithmParameterExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidAlgorithmParameterExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidAlgorithmParameterExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not InvalidAlgorithmParameterException";
-
     static String createErr(Exception tE, Exception eE) {
         return "InvalidAlgorithmParameterException: ".concat(tE.toString())
                 .concat(" is not equal to caught exception: ").concat(

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidKeyExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidKeyExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidKeyExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidKeyExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not InvalidKeyException";
-
     static String createErr(Exception tE, Exception eE) {
         return "InvalidKeyException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidParameterExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidParameterExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidParameterExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/InvalidParameterExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not InvalidParameterException";
-
     static String createErr(Exception tE, Exception eE) {
         return "InvalidParameterException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSBuilderTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSBuilderTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSBuilderTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSBuilderTest.java Thu Apr  6 23:52:51 2006
@@ -280,7 +280,7 @@
         KeyStore.Builder ksB1;
         KeyStore ks = null;
         KeyStore ks1 = null;
-        ;
+
         myProtectionParameter myPP = new myProtectionParameter(new byte[5]);
         // check exceptions
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSCallbackHandlerProtectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSCallbackHandlerProtectionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSCallbackHandlerProtectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSCallbackHandlerProtectionTest.java Thu Apr  6 23:52:51 2006
@@ -62,8 +62,6 @@
     public void testGetCallBackHandler() {
         CallbackHandler cbh = new tmpCallbackHandler();
         KeyStore.CallbackHandlerProtection ksCBH = new KeyStore.CallbackHandlerProtection(cbh);
-        assertTrue("Not KeyStore.CallbackHandlerProtection object",
-                ksCBH instanceof KeyStore.CallbackHandlerProtection);
         assertEquals("Incorrect CallbackHandler", cbh,
                 ksCBH.getCallbackHandler());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSPasswordProtectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSPasswordProtectionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSPasswordProtectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KSPasswordProtectionTest.java Thu Apr  6 23:52:51 2006
@@ -54,8 +54,6 @@
     public void testGetPassword() throws DestroyFailedException {
         char [] pass = {'a', 'b', 'c'};
         KeyStore.PasswordProtection ksPWP = new KeyStore.PasswordProtection(pass);
-        assertTrue("Not KeyStore.PasswordProtection object",
-                ksPWP instanceof KeyStore.PasswordProtection);
         char [] rPass = ksPWP.getPassword();
         assertFalse("PasswordProtection Should not be descroyed", ksPWP.isDestroyed());        
         assertEquals("Incorrect password length", pass.length, rPass.length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not KeyException";
-
     static String createErr(Exception tE, Exception eE) {
         return "KeyException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyManagementExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyManagementExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyManagementExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyManagementExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not KeyManagementException";
-
     static String createErr(Exception tE, Exception eE) {
         return "KeyManagementException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyPairGeneratorSpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyPairGeneratorSpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyPairGeneratorSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyPairGeneratorSpiTest.java Thu Apr  6 23:52:51 2006
@@ -50,8 +50,6 @@
             throws InvalidAlgorithmParameterException,
             InvalidParameterException {
         KeyPairGeneratorSpi keyPairGen = new MyKeyPairGeneratorSpi();
-        assertTrue("Not KeyPairGeneratorSpi object",
-                keyPairGen instanceof KeyPairGeneratorSpi);
 
         AlgorithmParameterSpec pp = null;
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyStoreExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyStoreExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyStoreExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/KeyStoreExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not KeyStoreException";
-
     static String createErr(Exception tE, Exception eE) {
         return "KeyStoreException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MessageDigestTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MessageDigestTest2.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MessageDigestTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MessageDigestTest2.java Thu Apr  6 23:52:51 2006
@@ -187,9 +187,6 @@
 	private void checkMD2(MessageDigest md2, Provider p) {
 		byte[] b = {1, 2, 3, 4, 5};
 		
-		if (!(md2 instanceof MessageDigestSpi)) {
-			fail("getInstance() failed");
-		}
 		if (md2.getProvider() != p) {
 			fail("getProvider() failed");
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MyKeyStore.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MyKeyStore.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MyKeyStore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/MyKeyStore.java Thu Apr  6 23:52:51 2006
@@ -177,17 +177,17 @@
         Enumeration e = Keys.keys();
         while (e.hasMoreElements()) {
             alias = (String) e.nextElement();
-            KeysSL.put(alias, (Key) Keys.get(alias));
-            DatesSL.put(alias, (Date) Dates.get(alias));
+            KeysSL.put(alias, Keys.get(alias));
+            DatesSL.put(alias, Dates.get(alias));
             if (Chain.containsKey(alias)) {
-                ChainSL.put(alias, (Certificate[]) Chain.get(alias));
+                ChainSL.put(alias, Chain.get(alias));
             }
         }
         e = Cert.keys();
         while (e.hasMoreElements()) {
             alias = (String) e.nextElement();
-            CertSL.put(alias, (Certificate) Cert.get(alias));
-            DatesSL.put(alias, (Date) Dates.get(alias));
+            CertSL.put(alias, Cert.get(alias));
+            DatesSL.put(alias, Dates.get(alias));
         }
     }
 
@@ -201,17 +201,17 @@
         Enumeration e = KeysSL.keys();
         while (e.hasMoreElements()) {
             alias = (String) e.nextElement();
-            Keys.put(alias, (Key) KeysSL.get(alias));
-            Dates.put(alias, (Date) DatesSL.get(alias));
+            Keys.put(alias, KeysSL.get(alias));
+            Dates.put(alias, DatesSL.get(alias));
             if (ChainSL.containsKey(alias)) {
-                Chain.put(alias, (Certificate[]) ChainSL.get(alias));
+                Chain.put(alias, ChainSL.get(alias));
             }
         }
         e = CertSL.keys();
         while (e.hasMoreElements()) {
             alias = (String) e.nextElement();
-            Cert.put(alias, (Certificate) CertSL.get(alias));
-            Dates.put(alias, (Date) DatesSL.get(alias));
+            Cert.put(alias, CertSL.get(alias));
+            Dates.put(alias, DatesSL.get(alias));
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/NoSuchAlgorithmExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/NoSuchAlgorithmExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/NoSuchAlgorithmExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/NoSuchAlgorithmExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not NoSuchAlgorithmException";
-
     static String createErr(Exception tE, Exception eE) {
         return "NoSuchAlgorithmException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PermissionsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PermissionsTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PermissionsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PermissionsTest.java Thu Apr  6 23:52:51 2006
@@ -190,7 +190,6 @@
      */
     public void testNull(){
     	Permissions ps = new Permissions();
-    	Permissions ps1 = new Permissions();
     	try {
     		ps.elements().nextElement();
     		fail("should throw NoSuchElementException");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PolicyTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PolicyTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PolicyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/PolicyTest.java Thu Apr  6 23:52:51 2006
@@ -25,7 +25,6 @@
 import java.util.Enumeration;
 import java.util.HashSet;
 
-import org.apache.harmony.security.fortress.DefaultPolicy;
 import junit.framework.TestCase;
 import org.apache.harmony.security.test.SecurityChecker;
 
@@ -185,14 +184,18 @@
         pc4pd = policy.getPermissions(pd);
         assertNotNull(pc4pd);
         Collection c = new HashSet();
-        for (en = pc4pd.elements();en.hasMoreElements(); c.add(en.nextElement()));
+        for (en = pc4pd.elements();en.hasMoreElements(); c.add(en.nextElement())) {
+        }
+
         assertTrue(c.contains(sp));
         
         //case4: non-empty policy, some static permissions in PD
         pc4pd = policy.getPermissions(pd2);
         assertNotNull(pc4pd);
         c = new HashSet();
-        for (en = pc4pd.elements();en.hasMoreElements(); c.add(en.nextElement()));
+        for (en = pc4pd.elements();en.hasMoreElements(); c.add(en.nextElement())) {
+        }
+
         assertTrue(c.contains(sp));
         //no check for static permissions
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProtectionDomainTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProtectionDomainTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProtectionDomainTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProtectionDomainTest.java Thu Apr  6 23:52:51 2006
@@ -251,7 +251,7 @@
 
         boolean getPdTracked() {
             return pdTracked;
-        };
+        }
 
         public PermissionCollection getPermissions(CodeSource cs) {
             return new Permissions();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProviderExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProviderExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProviderExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/ProviderExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not ProviderException";
-
     static String createErr(Exception tE, Exception eE) {
         return "ProviderException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest1.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest1.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest1.java Thu Apr  6 23:52:51 2006
@@ -96,7 +96,7 @@
 	 */
 	public final void testSecureRandombyteArray() {
 		byte[] b = {1,2,3};
-		SecureRandom sr = new SecureRandom(b);
+		new SecureRandom(b);
 		if (!RandomImpl.runEngineSetSeed) {
 			fail("No setSeed");
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest2.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SecureRandomTest2.java Thu Apr  6 23:52:51 2006
@@ -1,183 +1,186 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package java.security;
-
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-
-/**
- *
- * Tests for internal Secure Random implementation based on Random
- * 
- */
-public class SecureRandomTest2 extends TestCase {
-	
-	/**
-	 * Registered providers
-	 */
-	Provider providers[] = Security.getProviders();
-	
-	/*
-	 * @see TestCase#setUp()
-	 */
-	protected void setUp() throws Exception {
-		super.setUp();
-		// remove all registerd providers
-		for (int i = 0; i < providers.length; i++) {
-			Security.removeProvider(providers[i].getName());
-		}
-	}
-
-	/*
-	 * @see TestCase#tearDown()
-	 */
-	protected void tearDown() throws Exception {
-		super.tearDown();
-		// restore all registerd providers
-		for (int i = 0; i < providers.length; i++) {
-			Security.addProvider(providers[i]);
-		}
-	}
-
-	/*
-	 * Class under test for void setSeed(long)
-	 */
-	public final void testSetSeedlong() {
-		SecureRandom sr = new SecureRandom();
-		sr.setSeed(0);
-		sr.setSeed(-1);
-		sr.setSeed(11111111111L);
-	}
-
-	public final void testNextBytes() {
-		SecureRandom sr = new SecureRandom();
-		sr.nextBytes(new byte[20]);
-		sr.nextBytes(new byte[1]);
-		
-		//Not specified behavior: throws NullPointerException if bytes is null
-		try {
-			sr.nextBytes(null);
-		} catch (NullPointerException e) {	
-		}
-		sr.nextBytes(new byte[5]);
-	}
-
-	/*
-	 * Class under test for void SecureRandom()
-	 */
-	public final void testSecureRandom() {
-		SecureRandom sr = new SecureRandom();
-		Random r = new Random(0);
-		sr.setSeed(0);
-		byte[] b1 = new byte[8];
-		sr.nextBytes(b1);			
-	}
-
-	/*
-	 * Class under test for void SecureRandom(byte[])
-	 */
-	public final void testSecureRandombyteArray() {
-		byte[] seed = {1,2,3,4,5,6,7,8};
-		SecureRandom sr = new SecureRandom(seed);
-
-		long l = 0;
-		for (int i = 0; i < seed.length; i++) {
-			l = (l << 8) | (seed[i] & 0xFF);
-		}
-		Random r = new Random(l);
-		byte[] b1 = new byte[8];
-		byte[] b2 = new byte[8];
-		sr.nextBytes(b1);
-		r.nextBytes(b2);
-		for (int i = 0; i < b1.length; i++) {
-			if (b1[i] != b2[i]) {
-				fail("incorrect random bytes");
-			}
-		}
-	}
-
-
-	/*
-	 * Class under test for SecureRandom getInstance(String)
-	 */
-	public final void testGetInstanceString() {
-		try {
-			SecureRandom.getInstance("SHA1PRNG");
-			fail("No expected NoSuchAlgorithmException");
-		} catch (NoSuchAlgorithmException e) {	
-		}
-	}
-
-	
-	public final void testGetProvider() {
-		if (new SecureRandom().getProvider() != null) {
-			fail("Non null provider");
-		}
-	}
-	
-	public final void testGetAlgorithm() {
-		SecureRandom sr = new SecureRandom();
-		if (!sr.getAlgorithm().equals("java.util.Random")) {
-			fail("Incorrect algorithm");
-		}
-	}
-	
-	/*
-	 * Class under test for void setSeed(byte[])
-	 */
-	public final void testSetSeedbyteArray() {
-		SecureRandom sr = new SecureRandom();
-
-		//Not specified behavior: throws NullPointerException if bytes is null
-		try {
-			sr.setSeed(null);
-		} catch (NullPointerException e) {	
-		}
-		
-		byte[] seed = {1,2,3,4};
-		sr.setSeed(seed);
-		
-		byte[] seed1 = {1,2,3,4, -2, 100, 9, 111};
-		sr.setSeed(seed1);
-	}
-
-	/**
-	 * 
-	 *
-	 */
-	public final void testGetSeed() {
-		byte[] seed = SecureRandom.getSeed(5);
-		new SecureRandom(seed).nextBytes(new byte[20]);
-	}
-
-	/**
-	 * 
-	 *
-	 */
-	public final void testGenerateSeed() {
-		SecureRandom sr = new SecureRandom();
-		byte[] seed = sr.generateSeed(5);
-		new SecureRandom(seed).nextBytes(new byte[20]);
-	}
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import java.util.Arrays;
+import java.util.Random;
+
+import junit.framework.TestCase;
+
+
+/**
+ *
+ * Tests for internal Secure Random implementation based on Random
+ * 
+ */
+public class SecureRandomTest2 extends TestCase {
+	
+	/**
+	 * Registered providers
+	 */
+	Provider providers[] = Security.getProviders();
+	
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+		// remove all registerd providers
+		for (int i = 0; i < providers.length; i++) {
+			Security.removeProvider(providers[i].getName());
+		}
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		// restore all registerd providers
+		for (int i = 0; i < providers.length; i++) {
+			Security.addProvider(providers[i]);
+		}
+	}
+
+	/*
+	 * Class under test for void setSeed(long)
+	 */
+	public final void testSetSeedlong() {
+		SecureRandom sr = new SecureRandom();
+		sr.setSeed(0);
+		sr.setSeed(-1);
+		sr.setSeed(11111111111L);
+	}
+
+	public final void testNextBytes() {
+		SecureRandom sr = new SecureRandom();
+		sr.nextBytes(new byte[20]);
+		sr.nextBytes(new byte[1]);
+		
+		//Not specified behavior: throws NullPointerException if bytes is null
+		try {
+			sr.nextBytes(null);
+		} catch (NullPointerException e) {	
+		}
+		sr.nextBytes(new byte[5]);
+	}
+
+	/*
+	 * Class under test for void SecureRandom()
+	 */
+	public final void testSecureRandom() {
+        SecureRandom sr = new SecureRandom();
+        Random r = new Random();
+        byte[] b1 = new byte[8];
+        byte[] b2 = new byte[8];
+        sr.nextBytes(b1);
+        r.nextBytes(b2);
+        if (!Arrays.equals(b1, b2)) {
+            fail("incorrect random bytes");
+        }
+	}
+
+	/*
+	 * Class under test for void SecureRandom(byte[])
+	 */
+	public final void testSecureRandombyteArray() {
+		byte[] seed = {1,2,3,4,5,6,7,8};
+		SecureRandom sr = new SecureRandom(seed);
+
+		long l = 0;
+		for (int i = 0; i < seed.length; i++) {
+			l = (l << 8) | (seed[i] & 0xFF);
+		}
+		Random r = new Random(l);
+		byte[] b1 = new byte[8];
+		byte[] b2 = new byte[8];
+		sr.nextBytes(b1);
+		r.nextBytes(b2);
+        if (!Arrays.equals(b1, b2)) {
+            fail("incorrect random bytes");
+        }
+	}
+
+
+	/*
+	 * Class under test for SecureRandom getInstance(String)
+	 */
+	public final void testGetInstanceString() {
+		try {
+			SecureRandom.getInstance("SHA1PRNG");
+			fail("No expected NoSuchAlgorithmException");
+		} catch (NoSuchAlgorithmException e) {	
+		}
+	}
+
+	
+	public final void testGetProvider() {
+		if (new SecureRandom().getProvider() != null) {
+			fail("Non null provider");
+		}
+	}
+	
+	public final void testGetAlgorithm() {
+		SecureRandom sr = new SecureRandom();
+		if (!sr.getAlgorithm().equals("java.util.Random")) {
+			fail("Incorrect algorithm");
+		}
+	}
+	
+	/*
+	 * Class under test for void setSeed(byte[])
+	 */
+	public final void testSetSeedbyteArray() {
+		SecureRandom sr = new SecureRandom();
+
+		//Not specified behavior: throws NullPointerException if bytes is null
+		try {
+			sr.setSeed(null);
+		} catch (NullPointerException e) {	
+		}
+		
+		byte[] seed = {1,2,3,4};
+		sr.setSeed(seed);
+		
+		byte[] seed1 = {1,2,3,4, -2, 100, 9, 111};
+		sr.setSeed(seed1);
+	}
+
+	/**
+	 * 
+	 *
+	 */
+	public final void testGetSeed() {
+		byte[] seed = SecureRandom.getSeed(5);
+		new SecureRandom(seed).nextBytes(new byte[20]);
+	}
+
+	/**
+	 * 
+	 *
+	 */
+	public final void testGenerateSeed() {
+		SecureRandom sr = new SecureRandom();
+		byte[] seed = sr.generateSeed(5);
+		new SecureRandom(seed).nextBytes(new byte[20]);
+	}
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not SignatureException";
-
     static String createErr(Exception tE, Exception eE) {
         return "SignatureException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureTest2.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignatureTest2.java Thu Apr  6 23:52:51 2006
@@ -255,9 +255,6 @@
 	
 	private void checkSig2(Signature s, Provider p) {
 		byte[] b = {1, 2, 3, 4};
-		if (!(s instanceof SignatureSpi)) {
-			fail("getInstance() failed");
-		}
 		if (s.getProvider() != p) {
 			fail("getProvider() failed");
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignedObjectTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignedObjectTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignedObjectTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/SignedObjectTest.java Thu Apr  6 23:52:51 2006
@@ -70,7 +70,7 @@
     	assertEquals("SHA1withDSA", so.getAlgorithm());
  
         try {
-            assertEquals((Properties)so.getObject(), prop);      	
+            assertEquals(so.getObject(), prop);      	
         } catch (ClassNotFoundException e) {
            	fail(e.toString());  
         } catch (IOException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableEntryExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableEntryExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableEntryExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableEntryExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -56,7 +56,6 @@
      */
     public void testUnrecoverableEntryException() {
         UnrecoverableEntryException tE = new UnrecoverableEntryException();
-        assertTrue(errNotExc, tE instanceof UnrecoverableEntryException);
         assertNull("getMessage() must return null.", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
         try {
@@ -73,8 +72,6 @@
         UnrecoverableEntryException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new UnrecoverableEntryException(msgs[i]);
-            assertTrue(errNotExc.concat(" (msg: ").concat(msgs[i]).concat(")"),
-                    tE instanceof UnrecoverableEntryException);
             assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                     .getMessage(), msgs[i]);
             assertNull("getCause() must return null", tE.getCause());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableKeyExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableKeyExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableKeyExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/UnrecoverableKeyExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not UnrecoverableKeyException";
-
     static String createErr(Exception tE, Exception eE) {
         return "UnrecoverableKeyException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CRLExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CRLExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CRLExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CRLExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CRLException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CRLException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder1Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder1Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder1Test.java Thu Apr  6 23:52:51 2006
@@ -151,7 +151,6 @@
         }
         for (int i = 0; i < validValues.length; i++) {
             CertPathBuilder cpb = CertPathBuilder.getInstance(validValues[i]);
-            assertTrue("Not CertPathBuilder object", cpb instanceof CertPathBuilder);
             assertEquals("Incorrect algorithm", cpb.getAlgorithm(), validValues[i]);
         }
     }
@@ -243,7 +242,6 @@
         CertPathBuilder certPB;
         for (int i = 0; i < validValues.length; i++) {
             certPB = CertPathBuilder.getInstance(validValues[i], defaultProviderName);
-            assertTrue("Not CertPathBuilder object", certPB instanceof CertPathBuilder);
             assertEquals("Incorrect algorithm", certPB.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider name", certPB.getProvider().getName(), defaultProviderName);
         }        
@@ -308,7 +306,6 @@
         CertPathBuilder certPB;
         for (int i = 0; i < invalidValues.length; i++) {
             certPB = CertPathBuilder.getInstance(validValues[i], defaultProvider);
-            assertTrue("Not CertPathBuilder object", certPB instanceof CertPathBuilder);
             assertEquals("Incorrect algorithm", certPB.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider name", certPB.getProvider(), defaultProvider);
         }        
@@ -350,7 +347,6 @@
         CertPathBuilderSpi spi = new MyCertPathBuilderSpi();
         CertPathBuilder certPB = new myCertPathBuilder(spi, 
                     defaultProvider, defaultType);
-        assertTrue("Not CertPathBuilder object", certPB instanceof CertPathBuilder);
         assertEquals("Incorrect algorithm", certPB.getAlgorithm(), defaultType);
         assertEquals("Incorrect provider", certPB.getProvider(), defaultProvider);
         try {
@@ -359,7 +355,6 @@
         } catch (CertPathBuilderException e) {            
         }
         certPB = new myCertPathBuilder(null, null, null);
-        assertTrue("Not CertPathBuilder object", certPB instanceof CertPathBuilder);
         assertNull("Incorrect algorithm", certPB.getAlgorithm());
         assertNull("Incorrect provider", certPB.getProvider());            
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder2Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder2Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilder2Test.java Thu Apr  6 23:52:51 2006
@@ -132,8 +132,6 @@
         CertPathBuilder cerPB;
         for (int i = 0; i < validValues.length; i++) {
             cerPB = CertPathBuilder.getInstance(validValues[i]);
-            assertTrue("Not instanceof CertPathBuilder object",
-                    cerPB instanceof CertPathBuilder);
             assertEquals("Incorrect type", cerPB.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPB.getProvider(), mProv);
             checkResult(cerPB);
@@ -198,8 +196,6 @@
         for (int i = 0; i < validValues.length; i++) {
             cerPB = CertPathBuilder.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof CertPathBuilder object",
-                    cerPB instanceof CertPathBuilder);
             assertEquals("Incorrect type", cerPB.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPB.getProvider().getName(),
                     mProv.getName());
@@ -244,8 +240,6 @@
         CertPathBuilder cerPB;
         for (int i = 0; i < validValues.length; i++) {
             cerPB = CertPathBuilder.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof CertPathBuilder object",
-                    cerPB instanceof CertPathBuilder);
             assertEquals("Incorrect type", cerPB.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPB.getProvider(), mProv);
             checkResult(cerPB);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertPathBuilderException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertPathBuilderException ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderSpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderSpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathBuilderSpiTest.java Thu Apr  6 23:52:51 2006
@@ -46,8 +46,7 @@
      */
     public void testCertPathBuilderSpi01() throws CertPathBuilderException,
             InvalidAlgorithmParameterException {
-        CertPathBuilderSpi certPathBuilder = (CertPathBuilderSpi) new MyCertPathBuilderSpi();
-        assertTrue(certPathBuilder instanceof CertPathBuilderSpi);
+        CertPathBuilderSpi certPathBuilder = new MyCertPathBuilderSpi();
         CertPathParameters cpp = null;
         try {
             certPathBuilder.engineBuild(cpp);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator1Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator1Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator1Test.java Thu Apr  6 23:52:51 2006
@@ -156,7 +156,6 @@
         CertPathValidator certPV;
         for (int i = 0; i < validValues.length; i++) {
             certPV = CertPathValidator.getInstance(validValues[i]);
-            assertTrue("Not CertPathValidator object", certPV instanceof CertPathValidator);
             assertEquals("Incorrect algorithm", certPV.getAlgorithm(), validValues[i]);
         }
     }
@@ -248,8 +247,6 @@
         for (int i = 0; i < validValues.length; i++) {
             certPV = CertPathValidator.getInstance(validValues[i],
                     defaultProviderName);
-            assertTrue("Not CertPathValidator object",
-                    certPV instanceof CertPathValidator);
             assertEquals("Incorrect algorithm", certPV.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider name", certPV.getProvider()
@@ -317,8 +314,6 @@
         for (int i = 0; i < invalidValues.length; i++) {
             certPV = CertPathValidator.getInstance(validValues[i],
                     defaultProvider);
-            assertTrue("Not CertPathValidator object",
-                    certPV instanceof CertPathValidator);
             assertEquals("Incorrect algorithm", certPV.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider name", certPV.getProvider(),
@@ -370,7 +365,6 @@
         CertPathValidatorSpi spi = new MyCertPathValidatorSpi();
         CertPathValidator certPV = new myCertPathValidator(spi, 
                     defaultProvider, defaultType);
-        assertTrue("Not CertPathValidator object", certPV instanceof CertPathValidator);
         assertEquals("Incorrect algorithm", certPV.getAlgorithm(), defaultType);
         assertEquals("Incorrect provider", certPV.getProvider(), defaultProvider);
         certPV.validate(null, null);
@@ -380,7 +374,6 @@
         } catch (CertPathValidatorException e) {
         }        
         certPV = new myCertPathValidator(null, null, null);
-        assertTrue("Not CertPathValidator object", certPV instanceof CertPathValidator);
         assertEquals("Incorrect algorithm", certPV.getAlgorithm(), null);
         assertEquals("Incorrect provider", certPV.getProvider(), null);
         try {



Mime
View raw message