geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r701925 - /geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java
Date Mon, 06 Oct 2008 03:33:54 GMT
Author: jdillon
Date: Sun Oct  5 20:33:53 2008
New Revision: 701925

URL: http://svn.apache.org/viewvc?rev=701925&view=rev
Log:
Try a wee bit harder to get a collection instance

Modified:
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java?rev=701925&r1=701924&r2=701925&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/CollectionFieldSetter.java
Sun Oct  5 20:33:53 2008
@@ -22,9 +22,9 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.LinkedHashSet;
@@ -85,7 +85,12 @@
                 obj = new ArrayList();
             }
             else {
-                throw new IllegalAnnotationError("Unsupported collection type: " + field.getType());
+                try {
+                    obj = type.newInstance();
+                }
+                catch (Exception e) {
+                    throw new IllegalAnnotationError("Unsupported collection type: " + field.getType(),
e);
+                }
             }
 
             field.set(bean, obj);



Mime
View raw message