db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Eade (JIRA)" <j...@apache.org>
Subject [jira] Closed: (TORQUE-133) DataSetException/IllegalArgumentException when saving a java.util.Date with jre1.6.0_18
Date Tue, 09 Feb 2010 12:34:28 GMT

     [ https://issues.apache.org/jira/browse/TORQUE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Scott Eade closed TORQUE-133.
-----------------------------

    Resolution: Fixed
      Assignee: Scott Eade

Fixed in revision 908012.

Will require someone to step forward and produce a 3.3.1 release.

> DataSetException/IllegalArgumentException when saving a java.util.Date with jre1.6.0_18
> ---------------------------------------------------------------------------------------
>
>                 Key: TORQUE-133
>                 URL: https://issues.apache.org/jira/browse/TORQUE-133
>             Project: Torque
>          Issue Type: Bug
>          Components: Village
>    Affects Versions: 3.3
>         Environment: OS: Windows XP / Windows 7
> Java SE 6 Update 18 (1.6.0_18-b07)
> Torque 3.3, Village 3.3
> JDBC: postgresql-8.4-701.jdbc4.jar
>            Reporter: Georg Marx
>            Assignee: Scott Eade
>
> When I try to save a java.util.Date I get an IllegalArgumentException in class com.workingdogs.village.Value.java(1256).
> Because in jre1.6.0_18 the month/day-check in java.sql.Date.valueOf() has changed. (Version
jre1.6.0_13 is working. Update 14 to 17 I have not tested)
> In this version java.sql.Date.valueOf() checks if the month and day part of a date-string
(2010-1-25) has a charlength of 2.
> But in Value.java it generates a date-string like "1010-2-1". Correct is "2010-02-01".
> Affected code:
> cal.setTime((java.util.Date) valueObject);
> return java.sql.Date.valueOf(cal.get(Calendar.YEAR) + "-" + 
>           (cal.get(Calendar.MONTH) + 1) + "-"
>           + cal.get(Calendar.DAY_OF_MONTH));
> Patch:
> return new java.sql.Date(((java.util.Date) valueObject).getTime());
> This Patch worked for me in jre1.6.0_13 and jre1.6.0_18
> I think the lines 1248-1250, 1315-1317 and 1323-1325 are also affected.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message