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 Wed, 04 Jul 2012 09:28:35 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-02-aa-compatibilityTests-again.diff.txt

For my own education, I went through the changes in the 01-aa patch to understand exactly
why the compiler warned us. I found that some of the code touched by the patch could be made
simpler now that they are using Java 5 features. Attaching the patch as 02-aa.

JDBCDriverTest.java: The parameter that caused the warning was always null, so I just removed

VersionCombinationConfigurator.java: Used the more specific type URL instead of Object so
that no cast was needed.

VersionedNetworkServerTestSetup.java: Removed casts when calling cmd.toArray(new String[cmd.size()]),
as the compiler now knows the returned array is a String[].

_Suite.java: Replaced the reference to Collections.EMPTY_LIST with a call to Collections.emptyList(),
as the latter is type safe. Also removed the SuppressWarnings annotation since the change
to emptyList() silenced the warning.

The tests ran cleanly and I didn't see any warnings when doing a full build.
> 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
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message