You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org> on 2012/01/04 11:17:38 UTC
[jira] [Resolved] (WICKET-4309) StringValueConversionException for
correct situation
[ https://issues.apache.org/jira/browse/WICKET-4309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-4309.
-------------------------------------
Resolution: Fixed
Fix Version/s: 6.0.0
1.5.4
Assignee: Martin Grigorov
Patch applied.
Thanks, Andrea!
> StringValueConversionException for correct situation
> ----------------------------------------------------
>
> Key: WICKET-4309
> URL: https://issues.apache.org/jira/browse/WICKET-4309
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.3
> Environment: Java 1.6, Jboss
> Reporter: Ilia Naryzhny
> Assignee: Martin Grigorov
> Labels: StringValue, StringValueConversionException
> Fix For: 1.5.4, 6.0.0
>
> Attachments: WICKET-4309.patch
>
>
> StringValue.toOptionalLong() produces org.apache.wicket.util.string.StringValueConversionException if empty string was passed.
> Let me suggest, that this behavior should be changes for all toOptionalXXX methods except getOptionalString method.
> The problem in inner code:
> The problem in following code:
> public final Long toOptionalLong() throws StringValueConversionException
> {
> return (text == null) ? null : toLongObject();
> }
> Should be something like this:
> The problem in following code:
> public final Long toOptionalLong() throws StringValueConversionException
> {
> return Strings.isEmpty() ? null : toLongObject();
> }
> But there is another problem: what to do if incorrect param was passed - for example "abc" for parameter of Long type?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira