From derby-dev-return-82212-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Tue Oct 26 23:34:44 2010 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 11915 invoked from network); 26 Oct 2010 23:34:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Oct 2010 23:34:43 -0000 Received: (qmail 92932 invoked by uid 500); 26 Oct 2010 23:34:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 92904 invoked by uid 500); 26 Oct 2010 23:34:43 -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 92897 invoked by uid 99); 26 Oct 2010 23:34:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 23:34:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 23:34:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9QNYJS5027914 for ; Tue, 26 Oct 2010 23:34:19 GMT Message-ID: <17929854.90871288136059884.JavaMail.jira@thor> Date: Tue, 26 Oct 2010 19:34:19 -0400 (EDT) From: "Dag H. Wanvik (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4815) Override mechanism for modules.properties works backwards In-Reply-To: <13279562.366971285261473167.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925197#action_12925197 ] Dag H. Wanvik commented on DERBY-4815: -------------------------------------- Looks right to me. +1 > Override mechanism for modules.properties works backwards > --------------------------------------------------------- > > Key: DERBY-4815 > URL: https://issues.apache.org/jira/browse/DERBY-4815 > Project: Derby > Issue Type: Bug > Components: Services > Affects Versions: 10.6.1.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Attachments: d4815.diff > > > It is possible to override the properties in org/apache/derby/modules.properties by putting your own version of it somewhere on the classpath. BaseMonitor.getDefaultModuleProperties() apparently intends to use values from the first modules.properties file that mentions a property: > String key = (String) newKeys.nextElement(); > if( moduleList.contains( key)) > // RESOLVE how do we localize messages before we have finished initialization? > report( "Ignored duplicate property " + key + " in " + modulesPropertiesURL.toString()); > else > moduleList.setProperty( key, otherList.getProperty( key)); > However, moduleList.contains(key) doesn't look for a key in moduleList, it looks for a property value. This code should have used containsKey() instead. > Beacuse of this, the last modules.properties on the classpath will take precedence over the ones earlier on the classpath. So if you for example have two different versions of derby.jar in the classpath, the engine will use the classes from the first jar and modules.properties from the last jar. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.