harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r441005 - /incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
Date Thu, 07 Sep 2006 07:26:57 GMT
Author: mloenko
Date: Thu Sep  7 00:26:56 2006
New Revision: 441005

URL: http://svn.apache.org/viewvc?view=rev&rev=441005
Log:
applied the second patch for HARMONY-266
java.security.Signature.getInstance(String,Provider) should match 5.0 reference implementations
behaviour

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java?view=diff&rev=441005&r1=441004&r2=441005
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
Thu Sep  7 00:26:56 2006
@@ -112,6 +112,9 @@
      */
     public static Signature getInstance(String algorithm, String provider)
             throws NoSuchAlgorithmException, NoSuchProviderException {
+        if (algorithm == null) {
+            throw new NullPointerException("Algorithm is null");
+        }
         if ((provider == null) || (provider.length() == 0)) {
             throw new IllegalArgumentException(
                     "Provider is null or empty string");
@@ -121,7 +124,7 @@
             throw new NoSuchProviderException("Provider " + provider
                     + " is not available");
         }
-        return getInstance(algorithm, p);
+        return getSignatureInstance(algorithm, p);
     }
 
     /**
@@ -130,12 +133,17 @@
      */
     public static Signature getInstance(String algorithm, Provider provider)
             throws NoSuchAlgorithmException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
-        }
         if (algorithm == null) {
             throw new NullPointerException("Algorithm is null");
         }
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        return getSignatureInstance(algorithm, provider);
+    }
+    
+    private static Signature getSignatureInstance(String algorithm,
+            Provider provider) throws NoSuchAlgorithmException {
         Signature result;
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);



Mime
View raw message