db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Weiner (JIRA)" <j...@apache.org>
Subject [jira] Created: (DDLUTILS-57) Replace DateConverter's and TimeConverter's use of deprecated constructors
Date Tue, 20 Dec 2005 08:27:30 GMT
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
 Assigned to: Thomas Dudziak 

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

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

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:
For more information on JIRA, see:

View raw message