From notifications-return-2442-apmail-ant-notifications-archive=ant.apache.org@ant.apache.org Sat Apr 19 17:03:38 2008 Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 3400 invoked from network); 19 Apr 2008 17:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Apr 2008 17:03:37 -0000 Received: (qmail 27650 invoked by uid 500); 19 Apr 2008 17:03:38 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 27626 invoked by uid 500); 19 Apr 2008 17:03:38 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 27617 invoked by uid 99); 19 Apr 2008 17:03:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Apr 2008 10:03:38 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Apr 2008 17:03:03 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00158234C0E8 for ; Sat, 19 Apr 2008 10:00:23 -0700 (PDT) Message-ID: <1355953468.1208624423986.JavaMail.jira@brutus> Date: Sat, 19 Apr 2008 10:00:23 -0700 (PDT) From: "Ben Hale (JIRA)" To: notifications@ant.apache.org Subject: [jira] Updated: (IVY-805) onMissingDescriptor doesn't work due to == comparison In-Reply-To: <507898353.1208624305015.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IVY-805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ben Hale updated IVY-805: ------------------------- Attachment: onMissingDescriptor.patch A patch for the fix. It's pretty straight forward. You'll noticed I switched the order of comparison. By putting the constant first, you can prevent an NPE when the value set is 'null'. > onMissingDescriptor doesn't work due to == comparison > ----------------------------------------------------- > > Key: IVY-805 > URL: https://issues.apache.org/jira/browse/IVY-805 > Project: Ivy > Issue Type: Bug > Components: Ant > Affects Versions: 2.0-RC1 > Reporter: Ben Hale > Attachments: onMissingDescriptor.patch > > > In the IvyBuildList file, you compare the value passed for onMissingDescriptor to a set of constants using the '==' operator. In Java, this will always return false unless you have the exact same instance (which is unlikely in this case :)) The code should use the .equals() method which will return true when strings are identical, even when they are not the same instance. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.