db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5840) Clean up compiler warnings introduced by using Java 5 language features
Date Mon, 13 May 2013 21:21:16 GMT

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

Knut Anders Hatlen updated DERBY-5840:

    Attachment: derby-5840-09-aa-test-deprecation-and-unchecked.diff

Attaching derby-5840-09-aa-test-deprecation-and-unchecked.diff which cleans up some deprecation
warnings in the tests, and also fixes unchecked conversion warnings in the org.apache.derbyTesting.junit

In case someone thinks the changes in ManyMethods.java look suspicious, for example this one:

 	public static Date staticDateMethod()
-		/* July 2, 1997 */
-		return new Date(97, 7, 2);
+        /* August 2, 1997 */
+        Calendar cal = Calendar.getInstance();
+        cal.clear();
+        cal.set(1997, Calendar.AUGUST, 2, 0, 0, 0);
+        return new Date(cal.getTimeInMillis());

The patch does not actually change the date returned by this method from July 2 to August
2. The original code comment was wrong. Since the month argument in Date's deprecated constructor
starts counting on 0, 7 means August not July.

All tests ran cleanly with an earlier version of the patch. I had to make some small changes
because of conflicts with the latest changes in DERBY-6213, so I'm rerunning the tests.
> Clean up compiler warnings introduced by using Java 5 language features
> -----------------------------------------------------------------------
>                 Key: DERBY-5840
>                 URL: https://issues.apache.org/jira/browse/DERBY-5840
>             Project: Derby
>          Issue Type: Improvement
>          Components: Miscellaneous
>    Affects Versions:
>            Reporter: Rick Hillegas
>         Attachments: derby-5840-01-aa-compatibilityTests.diff, derby-5840-02-aa-compatibilityTests-again.diff.txt,
derby-5840-03-aa-drda.diff, derby-5840-03-ab-drda.diff, derby-5840-04-aa-client-level.diff,
derby-5840-05-aa-client-deprecation.diff, derby-5840-06-aa-jdbc3-stubs.diff, derby-5840-07-aa-drda-for-each.diff,
derby-5840-08-aa-jdbc3-embedded.diff, derby-5840-09-aa-test-deprecation-and-unchecked.diff
> Using Java 5 language features forces us to compile code at level 5 or higher. At this
level, the compiler raises warnings not seen at lower levels. This issue is a place to discuss
and attach cleanup to eliminate these warnings.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message