geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1832152 - in /geronimo/components/config/trunk/impl/src: main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java test/java/org/apache/geronimo/config/test/internal/ProxyTest.java
Date Thu, 24 May 2018 09:30:37 GMT
Author: rmannibucau
Date: Thu May 24 09:30:37 2018
New Revision: 1832152

URL: http://svn.apache.org/viewvc?rev=1832152&view=rev
Log:
erase generics for proxy impl until we support multiple levels

Modified:
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java
    geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProxyTest.java

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java?rev=1832152&r1=1832151&r2=1832152&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java
(original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigurationHandler.java
Thu May 24 09:30:37 2018
@@ -100,7 +100,10 @@ public class ConfigurationHandler implem
 
                 final Class<?> clazz = Class.class.cast(pt.getRawType());
                 if (Collection.class.isAssignableFrom(clazz)) {
-                    collectionConversionType = Class.class.cast(pt.getActualTypeArguments()[0]);
+                    final Type arg0 = pt.getActualTypeArguments()[0];
+                    collectionConversionType = Class.class.cast(ParameterizedType.class.isInstance(arg0)
?
+                            // mainly to tolerate Class<?> as an arg
+                            ParameterizedType.class.cast(arg0).getRawType() : Class.class.cast(arg0));
                     lookupType = String.class;
                     if (Set.class.isAssignableFrom(clazz)) {
                         collectionCollector = toSet();

Modified: geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProxyTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProxyTest.java?rev=1832152&r1=1832151&r2=1832152&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProxyTest.java
(original)
+++ geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProxyTest.java
Thu May 24 09:30:37 2018
@@ -67,6 +67,7 @@ public class ProxyTest extends Arquillia
         assertEquals(proxy.key3(), "def");
         assertEquals(proxy.list(), asList("a", "b", "1"));
         assertEquals(proxy.listDefaults(), asList(1, 2, 1));
+        assertEquals(proxy.listClasses(), asList(String.class, Integer.class));
     }
 
     @Test
@@ -96,6 +97,9 @@ public class ProxyTest extends Arquillia
         @ConfigProperty
         Collection<String> list();
 
+        @ConfigProperty(defaultValue = "java.lang.String,java.lang.Integer")
+        Collection<Class<?>> listClasses();
+
         @ConfigProperty(defaultValue = "1,2,1")
         Collection<Integer> listDefaults();
     }



Mime
View raw message