You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Thomas Dudziak (JIRA)" <ji...@apache.org> on 2006/07/13 08:23:32 UTC

[jira] Updated: (DDLUTILS-57) Replace DateConverter's and TimeConverter's use of deprecated constructors

     [ http://issues.apache.org/jira/browse/DDLUTILS-57?page=all ]

Thomas Dudziak updated DDLUTILS-57:
-----------------------------------

    Fix Version: 1.0

> Replace DateConverter's and TimeConverter's use of deprecated constructors
> --------------------------------------------------------------------------
>
>          Key: DDLUTILS-57
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-57
>      Project: DdlUtils
>         Type: Improvement

>     Reporter: Ken Weiner
>     Assignee: Thomas Dudziak
>      Fix For: 1.0
>  Attachments: Converters-patch.txt
>
> Both DateConverter and TimeConverter use deprecated constructors of java.sql.Date and java.sql.Time respectively.  This request is to replace the use of those constructors with a non-deprecated one.
> I am attaching a patch file that fixes both the DateConverter and TimeConverter to make use of the Calendar object to contruct the dates and times.
> This patch also adds a check to the convertToString methods to check the type of the object, throwing an exception if the object is not of the expected type.
> I also wrote some unit tests, DateConverterTest and TimeConverterTest  to accompany these changes.
> Note: Before applying this patch, you could have called the convertFromString() methods with invalid text representations and the methods would have returned an unexpected date.  Now with the use of Calendar, this won't happen since the Calendar instance has been set to not be "lenient".  See DateConverterTest.testConvertFromStringWithInvalidTextRep() and TimeConverter.testConvertFromStringWithInvalidTextRep().  These test methods do not pass with the current code, but do pass after applying this patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira