geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r613820 - in /geronimo/server/trunk/framework/modules/geronimo-system/src: main/java/org/apache/geronimo/system/configuration/GBeanOverride.java test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java
Date Mon, 21 Jan 2008 09:53:20 GMT
Author: gdamour
Date: Mon Jan 21 01:53:15 2008
New Revision: 613820

URL: http://svn.apache.org/viewvc?rev=613820&view=rev
Log:
No need to explicitly define a PropertyEditor for Collection sub-classes as
Geronimo already has in-build support for the main Collection types.

Fixes GERONIMO-3772 - Start failed, Cannot load property editor 
[org.apache.xbean.propertyeditor.ArrayListEditor].

Modified:
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=613820&r1=613819&r2=613820&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
Mon Jan 21 01:53:15 2008
@@ -21,6 +21,7 @@
 import java.io.Serializable;
 import java.io.StringReader;
 import java.net.URI;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -567,7 +568,9 @@
                 }
             }
             
-            if (!type.equals(value.getClass().getName()) && !typeClass.isPrimitive())
{
+            if (!type.equals(value.getClass().getName())
+                    && !typeClass.isPrimitive()
+                    && !Collection.class.isAssignableFrom(typeClass)) {
                 propertyEditors.put(attributeName, editor.getClass().getName());
             }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java?rev=613820&r1=613819&r2=613820&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/GBeanOverrideTest.java
Mon Jan 21 01:53:15 2008
@@ -20,6 +20,8 @@
 package org.apache.geronimo.system.configuration;
 
 import java.beans.PropertyEditorSupport;
+import java.util.Collection;
+import java.util.Collections;
 
 import junit.framework.TestCase;
 
@@ -93,6 +95,16 @@
     public void testPropertyEditorIsNotDefinedForPrimitives() throws Exception {
         GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
         override.setAttribute(attributeName, new Integer(1), int.class.getName(), getClass().getClassLoader());
+        
+        GbeanType copiedGBeanType = override.writeXml();
+        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
+        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
+        assertNull(attributeType.getPropertyEditor());
+    }
+    
+    public void testPropertyEditorIsNotDefinedForCollectionSubClasses() throws Exception
{
+        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
+        override.setAttribute(attributeName, Collections.singleton("test"), Collection.class.getName(),
getClass().getClassLoader());
         
         GbeanType copiedGBeanType = override.writeXml();
         assertEquals(1, copiedGBeanType.getAttributeOrReference().size());



Mime
View raw message