geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1833154 - in /geronimo/components/config/trunk: impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java pom.xml
Date Fri, 08 Jun 2018 09:12:43 GMT
Author: struberg
Date: Fri Jun  8 09:12:42 2018
New Revision: 1833154

URL: http://svn.apache.org/viewvc?rev=1833154&view=rev
Log:
fix implicit converter rules and upgrade to mp-config-1.3

Modified:
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java
    geronimo/components/config/trunk/pom.xml

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java?rev=1833154&r1=1833153&r2=1833154&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java
(original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/ImplicitConverter.java
Fri Jun  8 09:12:42 2018
@@ -35,9 +35,12 @@ public abstract class ImplicitConverter
 
     public static Converter getImplicitConverter(Class<?> clazz) {
         // handle ct with String param
-        Converter converter = hasConverterCt(clazz, String.class);
+        Converter converter = null;
         if (converter == null) {
-            converter = hasConverterCt(clazz, CharSequence.class);
+            converter = hasConverterMethod(clazz, "of", String.class);
+        }
+        if (converter == null) {
+            converter = hasConverterMethod(clazz, "of", CharSequence.class);
         }
         if (converter == null) {
             converter = hasConverterMethod(clazz, "valueOf", String.class);
@@ -46,6 +49,12 @@ public abstract class ImplicitConverter
             converter = hasConverterMethod(clazz, "valueOf", CharSequence.class);
         }
         if (converter == null) {
+            converter = hasConverterCt(clazz, String.class);
+        }
+        if (converter == null) {
+            converter = hasConverterCt(clazz, CharSequence.class);
+        }
+        if (converter == null) {
             converter = hasConverterMethod(clazz, "parse", String.class);
         }
         if (converter == null) {
@@ -66,7 +75,7 @@ public abstract class ImplicitConverter
                     try {
                         return declaredConstructor.newInstance(value);
                     } catch (Exception e) {
-                        throw new RuntimeException(e);
+                        throw new IllegalArgumentException(e);
                     }
                 }
             };

Modified: geronimo/components/config/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/pom.xml?rev=1833154&r1=1833153&r2=1833154&view=diff
==============================================================================
--- geronimo/components/config/trunk/pom.xml (original)
+++ geronimo/components/config/trunk/pom.xml Fri Jun  8 09:12:42 2018
@@ -50,7 +50,7 @@
     <properties>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
-        <microprofile-config.version>1.2.1</microprofile-config.version>
+        <microprofile-config.version>1.3</microprofile-config.version>
         <arquillian.version>1.1.14.Final</arquillian.version>
         <arquillian-weld-embedded.version>2.0.0.Final</arquillian-weld-embedded.version>
 



Mime
View raw message