felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1799447 - /felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
Date Wed, 21 Jun 2017 14:01:20 GMT
Author: davidb
Date: Wed Jun 21 14:01:20 2017
New Revision: 1799447

URL: http://svn.apache.org/viewvc?rev=1799447&view=rev
Log:
Felix Converter - better handling of null values

Modified:
    felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java

Modified: felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java?rev=1799447&r1=1799446&r2=1799447&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
Wed Jun 21 14:01:20 2017
@@ -577,15 +577,8 @@ public class ConvertingImpl implements C
             // This is not a primitive, just return null
             return null;
         }
-        if (cls.equals(boolean.class)) {
-            return false;
-        } else if (cls.equals(long.class) ) {
-            return 0L;
-        } else if (cls.equals(double.class) ) {
-            return 0.0;
-        }
 
-        return 0;
+        return converter.convert(0).to(cls);
     }
 
     private static boolean isMapType(Class<?> cls, boolean asJavaBean) {



Mime
View raw message