geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r424307 - /geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Date Fri, 21 Jul 2006 13:13:05 GMT
Author: sppatel
Date: Fri Jul 21 06:13:05 2006
New Revision: 424307

URL: http://svn.apache.org/viewvc?rev=424307&view=rev
Log:
GERONIMO-2186 fix npe on attributes with null values

Modified:
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=424307&r1=424306&r2=424307&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Fri Jul 21 06:13:05 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