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 C16D4E25C for ; Tue, 19 Feb 2013 13:49:19 +0000 (UTC) Received: (qmail 72091 invoked by uid 500); 19 Feb 2013 13:49:19 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 71490 invoked by uid 500); 19 Feb 2013 13:49:14 -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 71418 invoked by uid 99); 19 Feb 2013 13:49:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 13:49:12 +0000 Date: Tue, 19 Feb 2013 13:49:12 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6075) Use modern collections in impl/sql/compile 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-6075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-6075: -------------------------------------- Attachment: d6075-2a-bindExpression.diff Attaching d6075-2a-bindExpression.diff, which is built on top of the 1a patch. The patch changes the signatures of - ValueNode.bindExpression(FromList, SubqueryList, Vector) - ValueNode.bindExpression(FromList, SubqueryList, Vector, boolean) - JavaValueNode.bindExpression(FromList, SubqueryList, Vector) - all overrides of the above methods to use java.util.List instead of java.util.Vector. The patch only changes method signatures. The actual arguments passed to the bindExpression() methods are still of type java.util.Vector. All the regression tests ran cleanly with the 1a and the 2a patches. > Use modern collections in impl/sql/compile > ------------------------------------------ > > Key: DERBY-6075 > URL: https://issues.apache.org/jira/browse/DERBY-6075 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.10.0.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: d6075-1a-CollectNodesVisitor.diff, d6075-2a-bindExpression.diff > > > The code in the org.apache.derby.impl.sql.compile package predates the Java Collections Framework and uses old-style collections like java.util.Vector and java.util.Hashtable. Since the old-style collection classes are used in many method signatures, it's difficult to use modern collection classes when adding new code. > I suggest we switch to using interfaces (like java.util.List and java.util.Map) instead of specific classes in the signatures, so that we have more flexibility in choosing the right collection class for the job. > Only changing the signatures would allow us to continue using Vector and Hashtable, since they implement the interfaces. However, I think it would be good to switch to ArrayList and HashMap in a second step. The instances in impl/sql/compile are not shared between threads, so we don't need the synchronization provided by the old-style classes. Switching to unsynchronized classes may make compilation slightly faster. -- 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