geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r424405 - in /geronimo/sandbox/svkmerge/trunk: ./ modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Date Fri, 21 Jul 2006 18:17:56 GMT
Author: jdillon
Date: Fri Jul 21 11:17:56 2006
New Revision: 424405

URL: http://svn.apache.org/viewvc?rev=424405&view=rev
Log:
 r519@Bliss (orig r424307):  sppatel | 2006-07-21 06:13:05 -0700
 GERONIMO-2186 fix npe on attributes with null values
 

Modified:
    geronimo/sandbox/svkmerge/trunk/   (props changed)
    geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java

Propchange: geronimo/sandbox/svkmerge/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Jul 21 11:17:56 2006
@@ -1,2 +1,2 @@
 13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/m2migration:419395
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:424019
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:424307

Modified: geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=424405&r1=424404&r2=424405&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
(original)
+++ geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Fri Jul 21 11:17:56 2006
@@ -348,16 +348,21 @@
             Map.Entry entry = (Map.Entry) iterator.next();
             String name = (String) entry.getKey();
             String value = (String) entry.getValue();
-            if(name.toLowerCase().indexOf("password") > -1) {
-                value = EncryptionManager.encrypt(value);
+            if (value==null) {
+            	setNullAttribute(name);
+            }
+            else {
+                if(name.toLowerCase().indexOf("password") > -1) {
+                    value = EncryptionManager.encrypt(value);
+                }
+                Element attribute = doc.createElement("attribute");
+                attribute.setAttribute("name", name);
+                gbean.appendChild(attribute);
+                if (value.length() == 0)
+                    attribute.setAttribute("value", "");
+                else
+                    attribute.appendChild(doc.createTextNode(value));
             }
-            Element attribute = doc.createElement("attribute");
-            gbean.appendChild(attribute);
-            attribute.setAttribute("name", name);
-            if (value.length() == 0)
-                attribute.setAttribute("value", "");
-            else
-                attribute.appendChild(doc.createTextNode(value));
         }
 
         // cleared attributes



Mime
View raw message