Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.3
-
Java 1.6, Jboss
Description
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?