Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DCFA9F80 for ; Wed, 18 Jul 2012 14:12:35 +0000 (UTC) Received: (qmail 20053 invoked by uid 500); 18 Jul 2012 14:12:35 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19944 invoked by uid 500); 18 Jul 2012 14:12:35 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 19917 invoked by uid 99); 18 Jul 2012 14:12:34 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2012 14:12:34 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 9904A1427F2 for ; Wed, 18 Jul 2012 14:12:34 +0000 (UTC) Date: Wed, 18 Jul 2012 14:12:34 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <1880182438.69065.1342620754630.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1187523540.240.1341323420722.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (DERBY-5840) Clean up compiler warnings introduced by using Java 5 language features MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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-07-aa-drda-for-each.diff While I was at it, I went quickly through the network server code to see if there were places where we could use for-each loops, which would make the code more concise. The attached patch, derby-5840-07-aa-drda-for-each.diff, changes the places I found. Note that in one case (NetworkServerControlImpl.checkAddressIsLocal()) I went one step further and replaced the original for loop with a call to contains(). Also, I only touched loops using Enumerations if the original loop was inside a block synchronized on the collection instance, as there's a slight risk that the for-each loop would throw ConcurrentModificationException, which the Enumeration wouldn't throw. All the regression tests ran cleanly with the patch. > 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: 10.10.0.0 > 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 > > > 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