Re: svn commit: r883807 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: Converters.java MiscConverters.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r883807 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: Converters.java MiscConverters.java

Adam Heath-2
[hidden email] wrote:

> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java?rev=883807&r1=883806&r2=883807&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java (original)
> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java Tue Nov 24 18:37:09 2009
> @@ -92,6 +92,11 @@
>                              return (Converter<S, T>) value;
>                          }
>                      }
> +                    // Null converter must be checked last
> +                    if (nullConverter.canConvert(sourceClass, targetClass)) {
> +                        converterMap.put(key, nullConverter);
> +                        return (Converter<S, T>) nullConverter;
> +                    }

Why aren't you using UtilGenerics.cast()?
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r883807 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: Converters.java MiscConverters.java

Adrian Crum
Adam Heath wrote:

> [hidden email] wrote:
>> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java?rev=883807&r1=883806&r2=883807&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java (original)
>> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java Tue Nov 24 18:37:09 2009
>> @@ -92,6 +92,11 @@
>>                              return (Converter<S, T>) value;
>>                          }
>>                      }
>> +                    // Null converter must be checked last
>> +                    if (nullConverter.canConvert(sourceClass, targetClass)) {
>> +                        converterMap.put(key, nullConverter);
>> +                        return (Converter<S, T>) nullConverter;
>> +                    }
>
> Why aren't you using UtilGenerics.cast()?

Force of habit - much like inertia - can be difficult to overcome.