Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9897C11B81 for ; Thu, 24 Apr 2014 19:48:42 +0000 (UTC) Received: (qmail 34993 invoked by uid 500); 24 Apr 2014 19:48:41 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 34956 invoked by uid 500); 24 Apr 2014 19:48:41 -0000 Mailing-List: contact commits-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 commits@felix.apache.org Received: (qmail 34949 invoked by uid 99); 24 Apr 2014 19:48:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Apr 2014 19:48:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Apr 2014 19:48:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D19C02388993; Thu, 24 Apr 2014 19:48:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1589853 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java Date: Thu, 24 Apr 2014 19:48:17 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140424194817.D19C02388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rickhall Date: Thu Apr 24 19:48:17 2014 New Revision: 1589853 URL: http://svn.apache.org/r1589853 Log: Apply patch FELIX-4494 to fix improperly wrapped fragment capabilities. Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java?rev=1589853&r1=1589852&r2=1589853&view=diff ============================================================================== --- felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java (original) +++ felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java Thu Apr 24 19:48:17 2014 @@ -31,6 +31,7 @@ import java.util.Set; import java.util.TreeMap; import org.osgi.framework.Version; import org.osgi.framework.namespace.HostNamespace; +import org.osgi.framework.namespace.IdentityNamespace; import org.osgi.framework.namespace.PackageNamespace; import org.osgi.resource.Capability; import org.osgi.resource.Requirement; @@ -433,18 +434,23 @@ class Candidates { for (Capability fragCand : fragmentCands) { + String fragCandName = fragCand.getNamespace(); + if (IdentityNamespace.IDENTITY_NAMESPACE.equals(fragCandName)) { + // no need to wrap identity namespace ever + continue; + } // Only necessary for resolved fragments. Wiring wiring = rc.getWirings().get(fragCand.getResource()); if (wiring != null) { // Fragments only have host wire, so each wire represents // an attached host. - for (Wire wire : wiring.getRequiredResourceWires(null)) + for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE)) { // If the capability is a package, then make sure the // host actually provides it in its resolved capabilities, // since it may be a substitutable export. - if (!fragCand.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE) + if (!fragCandName.equals(PackageNamespace.PACKAGE_NAMESPACE) || rc.getWirings().get(wire.getProvider()) .getResourceCapabilities(null).contains(fragCand)) {