harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r548596 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/java/security/ test/api/java/org/apache/harmony/security/tests/java/security/ test/impl/java/org/apache/harmony/security/tests/java/security/
Date Tue, 19 Jun 2007 05:44:13 GMT
Author: leoli
Date: Mon Jun 18 22:44:12 2007
New Revision: 548596

URL: http://svn.apache.org/viewvc?view=rev&rev=548596
Log:
java.security.KeyStore.store(null, null) is allowed.

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java?view=diff&rev=548596&r1=548595&r2=548596
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
Mon Jun 18 22:44:12 2007
@@ -380,12 +380,8 @@
         if (!isInit) {
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
-        if (stream == null) {
-            throw new IOException(Messages.getString("security.51")); //$NON-NLS-1$
-        }
-        if (password == null) {
-            throw new IOException(Messages.getString("security.50")); //$NON-NLS-1$
-        }
+
+        //Just delegate stream and password to implSpi
         implSpi.engineStore(stream, password);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java?view=diff&rev=548596&r1=548595&r2=548596
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
Mon Jun 18 22:44:12 2007
@@ -143,6 +143,11 @@
         mockKeyStore.setCertificateEntry("Alias", null);
     }
     
+    public void test_store_null() throws Exception {
+        mockKeyStore.load(null, null);
+        mockKeyStore.store(null, null);
+    }
+    
     protected void setUp() throws Exception {
         super.setUp();
         mockKeyStore = new MyKeyStore(new MyKeyStoreSpi(), null, "MyKeyStore");

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java?view=diff&rev=548596&r1=548595&r2=548596
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java
Mon Jun 18 22:44:12 2007
@@ -142,11 +142,8 @@
             } catch (NullPointerException e) {
             }
 
-            try {
-                kss[i].store(bos, null);
-                fail("store(...) does not throw any exception when password is null");
-            } catch (IOException e) {
-            }
+            //RI does not throw exception while password is null.
+            kss[i].store(bos, null);
 
             kss[i].store(bos, pwd);
             ByteArrayInputStream bis = new ByteArrayInputStream(bos



Mime
View raw message