Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 341F2200B9D for ; Thu, 13 Oct 2016 08:40:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 32B26160AE4; Thu, 13 Oct 2016 06:40:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6B82A160AF9 for ; Thu, 13 Oct 2016 08:40:22 +0200 (CEST) Received: (qmail 89411 invoked by uid 500); 13 Oct 2016 06:40:21 -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 89395 invoked by uid 99); 13 Oct 2016 06:40:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2016 06:40:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 557F42C0059 for ; Thu, 13 Oct 2016 06:40:21 +0000 (UTC) Date: Thu, 13 Oct 2016 06:40:21 +0000 (UTC) From: "Carsten Ziegeler (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (FELIX-5166) WrappedResource does not handle namespace correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 13 Oct 2016 06:40:23 -0000 [ https://issues.apache.org/jira/browse/FELIX-5166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler closed FELIX-5166. ----------------------------------- > WrappedResource does not handle namespace correctly > --------------------------------------------------- > > Key: FELIX-5166 > URL: https://issues.apache.org/jira/browse/FELIX-5166 > Project: Felix > Issue Type: Bug > Components: Resolver > Affects Versions: resolver-1.8.0 > Reporter: Thomas Watson > Assignee: Thomas Watson > Fix For: resolver-1.10.0 > > Attachments: FELIX-5166.patch > > > This is similar to FELIX-4727. There are several issues with how namespace is handled in getCapabilities and getRequirements for the org.apache.felix.resolver.WrappedResource class > In getCapabilities the namespace is correctly used to ask the host and fragment resources for the named capabilities. But then that list is saved into the m_cachedCapabilities field. If you first ask for the 'foo' namespace it will save all the 'foo' capabilities to m_cachedCapabilities, then if you ask for the 'bar' capabilities it will simply return the m_cachedCapabilities from before with 'foo' capabilities. > In getRequirements the namespace is completely ignored. I think there are several reasons to stop lazily crating these caches. It leads to strange bugs like the ones above, but also there is no synchronization here and the var is not volatile so I think there could be some issues with multi-threading. Now that the resolver is multi-threaded I think we should stop creating these lists of capabilities and requirements lazily. Instead I think we should make them final and create them in the constructor. -- This message was sent by Atlassian JIRA (v6.3.4#6332)