You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Matej Knopp (JIRA)" <ji...@apache.org> on 2007/08/26 19:35:30 UTC

[jira] Commented: (WICKET-735) SqlTimestampConverter and it's Date and Time friends die on null and other breakage.

    [ https://issues.apache.org/jira/browse/WICKET-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522864 ] 

Matej Knopp commented on WICKET-735:
------------------------------------

Looks good to me, will commit it.

> SqlTimestampConverter and it's Date and Time friends die on null and other breakage.
> ------------------------------------------------------------------------------------
>
>                 Key: WICKET-735
>                 URL: https://issues.apache.org/jira/browse/WICKET-735
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.0-beta2
>            Reporter: Logi Ragnarsson
>             Fix For: 1.3.0-beta4
>
>         Attachments: SqlTimeConverter.java
>
>
> For a null value the following method in SqlTimestampConverter and similar for Date and Time will get a null from the superclass and throw an NPE.
> public Object convertToObject(String value, Locale locale)
> {
> 	return new Timestamp(((Date)super.convertToObject(value, locale)).getTime());
> }
> Also, the superclass will use the locale's default formating for a java.util.Date object, which may be suitable for one of java.sql.Date, java.sql.Time and java.sql.Timestamp, but never for all three. In my locale it is appropriate for java.sql.Date and any java.sql.Time will return a string of "1.1.1"

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