Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 37663 invoked from network); 2 Oct 2009 13:44:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 13:44:55 -0000 Received: (qmail 49233 invoked by uid 500); 2 Oct 2009 13:44:55 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 49152 invoked by uid 500); 2 Oct 2009 13:44:55 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 49137 invoked by uid 99); 2 Oct 2009 13:44:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 13:44:55 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 13:44:44 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 929F3234C04C for ; Fri, 2 Oct 2009 06:44:23 -0700 (PDT) Message-ID: <939555961.1254491063599.JavaMail.jira@brutus> Date: Fri, 2 Oct 2009 06:44:23 -0700 (PDT) From: "Henning Andersen (JIRA)" To: dev@felix.apache.org Subject: [jira] Commented: (FELIX-1600) ServiceReference.isAssignableTo() always returns true if requesting bundle has no wire In-Reply-To: <1439520196.1253018037757.JavaMail.jira@brutus> 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/FELIX-1600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761574#action_12761574 ] Henning Andersen commented on FELIX-1600: ----------------------------------------- Hi Karl, would it be possible to generate a new snapshot build to test against? Thanks, Henning > ServiceReference.isAssignableTo() always returns true if requesting bundle has no wire > -------------------------------------------------------------------------------------- > > Key: FELIX-1600 > URL: https://issues.apache.org/jira/browse/FELIX-1600 > Project: Felix > Issue Type: Bug > Components: Framework > Affects Versions: felix-2.0.0 > Reporter: Stuart McCulloch > Assignee: Karl Pauls > Fix For: felix-2.2.0 > > > [ from http://markmail.org/message/pu5usr5s7vsweyv3 ] > I think there's a bug in our ServiceReference.isAssignableTo implementation... > the javadoc for this method states: > "This method performs the following checks: > 1. Get the package name from the specified class name. > 2. For the bundle that registered the service referenced by this ServiceReference (registrant bundle); > find the source for the package. If no source is found then return true if the registrant bundle is > equal to the specified bundle; otherwise return false. > 3. If the package source of the registrant bundle is equal to the package source of the specified > bundle then return true; otherwise return false." > whereas our implementation does: > // There are three situations that may occur here: > // 1. The requester does not have a wire for the package. > // 2. The provider does not have a wire for the package. > // 3. Both have a wire for the package. > // For case 1, we do not filter the service reference since we > // assume that the bundle is using reflection or that it won't > // use that class at all since it does not import it. For > // case 2, we have to try to load the class from the class > // loader of the service object and then compare the class > // loaders to determine if we should filter the service > // refernce. In case 3, we simply compare the exporting > // modules from the package wiring to determine if we need > // to filter the service reference. > assume both the provider and requester have no wire for the package > (as happens when a bundle uses it's own export, as in this situation) > the javadoc says isAssignableTo should return false, because the > provider has no wire and the provider != requester - but we'll return > true because the requester has no wire and we do that check first -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.