harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r488120 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/java/security/Provider.java test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
Date Mon, 18 Dec 2006 04:53:49 GMT
Author: pyang
Date: Sun Dec 17 20:53:49 2006
New Revision: 488120

URL: http://svn.apache.org/viewvc?view=rev&rev=488120
Log:
Apply patch for HARMONY-2760 ([classlib][security]Provider.constructor throws NullPointerException
while name or info is null while RI does not.)

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java?view=diff&rev=488120&r1=488119&r2=488120
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
Sun Dec 17 20:53:49 2006
@@ -720,9 +720,9 @@
     // Provider.id name, Provider.id version, Provider.id info, 
     // Provider.id className
     private void putProviderInfo() {
-        super.put("Provider.id name", name); //$NON-NLS-1$
-        super.put("Provider.id version", versionString); //$NON-NLS-1$
-        super.put("Provider.id info", info); //$NON-NLS-1$
+        super.put("Provider.id name", null != name ? name : "null"); //$NON-NLS-1$
+		super.put("Provider.id version", versionString); //$NON-NLS-1$
+		super.put("Provider.id info", null != info ? info : "null"); //$NON-NLS-1$
         super.put("Provider.id className", this.getClass().getName()); //$NON-NLS-1$
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java?view=diff&rev=488120&r1=488119&r2=488120
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
Sun Dec 17 20:53:49 2006
@@ -311,7 +311,15 @@
         }
     }
 */
-
+    //Regression for HARMONY-2760.
+    public void testConstructor() {
+		MyProvider myProvider = new MyProvider(null, 1, null);
+		assertNull(myProvider.getName());
+		assertNull(myProvider.getInfo());
+		assertEquals("null", myProvider.getProperty("Provider.id name"));
+		assertEquals("null", myProvider.getProperty("Provider.id info"));
+	}
+    
     class MyProvider extends Provider {
         MyProvider() {
             super("MyProvider", 1.0, "Provider for testing");



Mime
View raw message