svn commit: r803395 - /camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r803395 - /camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java

cmoulliard-2
Author: cmoulliard
Date: Wed Aug 12 07:27:27 2009
New Revision: 803395

URL: http://svn.apache.org/viewvc?rev=803395&view=rev
Log:
Return not null value for primitive types (when csv is generated)

Modified:
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java?rev=803395&r1=803394&r2=803395&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java Wed Aug 12 07:27:27 2009
@@ -184,35 +184,29 @@
     }
     
     public static Object getDefaultValueforPrimitive(Class<?> clazz) throws Exception {
-        if (clazz == byte.class || clazz == Byte.class) {
-            return Byte.MIN_VALUE;
-        } else if (clazz == short.class || clazz == Short.class) {
-            return Short.MIN_VALUE;
-        } else if (clazz == int.class || clazz == Integer.class) {
-            return Integer.MIN_VALUE;
-        } else if (clazz == long.class || clazz == Long.class) {
-            return Long.MIN_VALUE;
-        } else if (clazz == float.class || clazz == Float.class) {
-            return Float.MIN_VALUE;
-        } else if (clazz == double.class || clazz == Double.class) {
-            return Double.MIN_VALUE;
-        } else if (clazz == BigDecimal.class) {
-            return BigDecimal.ZERO;
-        } else if (clazz == BigInteger.class) {
-            return BigInteger.ZERO;
-        } else if (clazz == String.class) {
-            return null;
-        } else if (clazz == Date.class) {
-            return null;
-        } else if (clazz == char.class || clazz == Character.class) {
-            return null;
-        } else if (clazz == boolean.class || clazz == Boolean.class) {
-            return false;
-        } else {
-            throw new IllegalArgumentException("Can not find type corresponding : " + clazz.getCanonicalName());
-        }
+    
+     if (clazz == byte.class ) return Byte.MIN_VALUE;
+
+     else if (clazz == short.class ) return Short.MIN_VALUE;
+
+     else if (clazz == int.class ) return Integer.MIN_VALUE;
+
+     else if (clazz == long.class ) return Long.MIN_VALUE;
+
+     else if (clazz == float.class ) return Float.MIN_VALUE;
+
+     else if (clazz == double.class ) return Double.MIN_VALUE;
+
+     else if (clazz == char.class ) return Character.MIN_VALUE;
+
+     else if (clazz == boolean.class ) return false;
+
+     else return null;
+
     }
 
+
+
     /**
      * Find the carriage return set
      */