commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Hauser (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-41) Provide better error message for "No value specified"
Date Fri, 11 Sep 2009 14:00:57 GMT

    [ https://issues.apache.org/jira/browse/BEANUTILS-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754137#action_12754137
] 

Ralf Hauser commented on BEANUTILS-41:
--------------------------------------

Daemon Thread [Thread-122] (Suspended (breakpoint at line 310 in AbstractConverter))	
*	DateConverter(AbstractConverter).handleMissing(Class) line: 310	
*	DateConverter(AbstractConverter).convert(Class, Object) line: 136	
*	ConverterFacade.convert(Class, Object) line: 60	
*	BeanUtilsBean.convert(Object, Class) line: 1074	
	BeanUtilsBean.copyProperty(Object, String, Object) line: 437	("propName" is available here!)

All the interfaces marked with * should have an extra argument
   String propNameForErrorMessage 
the could be cited on AbstractConverter line 310 and in parallel mention to rather use PropertyUtils.copyProperties(dest,
orig) if null values are ok

> Provide better error message for "No value specified"
> -----------------------------------------------------
>
>                 Key: BEANUTILS-41
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-41
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: ConvertUtils & Converters
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Ralf Hauser
>             Fix For: LATER THAN 1.8.1
>
>
> Got <<org.apache.commons.beanutils.ConversionException: No value specified
>         at
> org.apache.commons.beanutils.converters.SqlDateConverter.convert(SqlDateConverter.java:103)
>         at
> org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:444)
>         at
> org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:261)
>         at
> org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:114)>>
>  
> Suggestion:
> 1) cite the propName and the bean className
>    this probably implies that the interface
>      org.apache.commons.beanutils.Converter.convert(Class type, Object value)
>    is extended to 
>      org.apache.commons.beanutils.Converter.convert(Class type, Object value,
>                                         String propName, String beanClassName)
> 2) also cite the concerned class name (probably java.sql.Date) 
> 3) mention that there is the possibility to use a default value

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message