camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: svn commit: r803395 - /camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java
Date Wed, 12 Aug 2009 08:49:14 GMT
Yes, The profile is broken , I will fix it shortly.

Willem

Claus Ibsen wrote:
> Looks like -Psourcecheck is not invoked on trunk.
> 
> The code is not correct, for instance
>  if (clazz == byte.class ) return Byte.MIN_VALUE;
> 
> Should use { } around the return
> 
> I will contact Willem about the -Psourcecheck as he is the maven master.
> 
> 
> On Wed, Aug 12, 2009 at 9:56 AM, Charles Moulliard<cmoulliard@gmail.com> wrote:
>> Hi Claus,
>>
>> I have formatted the class and done a maven build using the option
>> -PsourceCheck. Is it enough to guaranty that the code follow the checkstyle
>> convention ?
>>
>>
>> On Wed, Aug 12, 2009 at 9:37 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>>
>>> Hi Charles
>>>
>>> Could you ensure the code follows the checkstyle !!!
>>> We are about to build a RC for Camel 2.0 and do not want to have
>>> compile/build errors because you commit to bindy.
>>>
>>>
>>> On Wed, Aug 12, 2009 at 9:27 AM, <cmoulliard@apache.org> wrote:
>>>> 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
>>>>      */
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
> 
> 
> 


Mime
View raw message