geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r643444 - /geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Date Tue, 01 Apr 2008 15:23:31 GMT
Author: dwoods
Date: Tue Apr  1 08:23:29 2008
New Revision: 643444

URL: http://svn.apache.org/viewvc?rev=643444&view=rev
Log:
GERONIMO-3814 NPE in GBeanOverride.  Merged in relevant changes from branches/2.1.

Modified:
    geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java

Modified: geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=643444&r1=643443&r2=643444&view=diff
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Tue Apr  1 08:23:29 2008
@@ -436,19 +436,18 @@
             return null;
         }
         value = substituteVariables(attribute.getName(), value);
+        PropertyEditor editor;
         try {
-            PropertyEditor editor = PropertyEditors.findEditor(attribute.getType(), classLoader);
-            if (editor == null) {
-                log.debug("Unable to parse attribute of type " + attribute.getType() + ";
no editor found");
-                return null;
-            }
-            editor.setAsText(value);
-            log.debug("Setting value for " + configurationName + "/" + gbeanName + "/" +
attribute.getName() + " to value " + value);
-            return editor.getValue();
+            editor = PropertyEditors.findEditor(attribute.getType(), classLoader);
         } catch (ClassNotFoundException e) {
-            log.error("Unable to load attribute type " + attribute.getType());
-            return null;
+            throw new IllegalStateException("Unable to load property editor for attribute
type: " + attribute.getType());
         }
+        if (editor == null) {
+            throw new IllegalStateException("Unable to parse attribute of type " + attribute.getType()
+ "; no editor found");
+        }
+        editor.setAsText(value);
+        log.debug("Setting value for " + configurationName + "/" + gbeanName + "/" + attribute.getName()
+ " to value " + value);
+        return editor.getValue();
     }
 
     public String substituteVariables(String attributeName, String input) {



Mime
View raw message