[
https://issues.apache.org/jira/browse/WICKET-1706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Igor Vaynberg resolved WICKET-1706.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.4-M3
1.3.4
> org.apache.wicket.util.lang.Objects.convertValue returns null if it cannot
> convert the value
> --------------------------------------------------------------------------------------------
>
> Key: WICKET-1706
> URL: https://issues.apache.org/jira/browse/WICKET-1706
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.3, 1.4-M2
> Environment: any
> Reporter: Mika Salminen
> Assignee: Igor Vaynberg
> Priority: Minor
> Fix For: 1.3.4, 1.4-M3
>
>
> In the javadoc comment of the method it says that this method should return
> the value given as parameter if the value cannot be converted to the given
> type, but actually it returns null if it cannot convert the value.
> I had a problem with a TextField which had a model value of type
> java.io.Serializable and I had unfortunately not defined a special converter
> for the text field so it used
> org.apache.wicket.util.convert.ConverterLocator.DefaultConverter.convertToObject
> to convert to the object type. convertToObject uses Objects.convertValue so
> whenever model object was updated it was set to null. When retrieved from the
> model, model object was properly shown in the TextField so I had no idea why
> the value could not be properly setted but only getted.
> In many cases it would probably help if the Objects.convertValue did what it
> promises in javadoc (returns the value unconverted), but how about throwing
> exception (at some method) if the converter does not know how to convert some
> kind of objects? This would make it a lot easier to spot the kind of mistakes
> I had made.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.