Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08541188A4 for ; Thu, 20 Aug 2015 19:16:46 +0000 (UTC) Received: (qmail 77008 invoked by uid 500); 20 Aug 2015 19:16:45 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 76937 invoked by uid 500); 20 Aug 2015 19:16:45 -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 76921 invoked by uid 99); 20 Aug 2015 19:16:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Aug 2015 19:16:45 +0000 Date: Thu, 20 Aug 2015 19:16:45 +0000 (UTC) From: "Thomas Watson (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (FELIX-4989) CopyOnWriteList.removeAll(Collection) is incorrect causing failures for multiple cardinality resolution MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Watson closed FELIX-4989. -------------------------------- Thanks for releasing the fix. > CopyOnWriteList.removeAll(Collection) is incorrect causing failures for multiple cardinality resolution > ---------------------------------------------------------------------------------------------------------- > > Key: FELIX-4989 > URL: https://issues.apache.org/jira/browse/FELIX-4989 > Project: Felix > Issue Type: Bug > Components: Resolver > Environment: All > Reporter: Thomas Watson > Assignee: Guillaume Nodet > Fix For: resolver-1.6.0 > > Attachments: CopyOnWriteList.patch > > > The method org.apache.felix.resolver.Candidates.clearCandidates(Requirement, Collection) uses the List.removeAll method which is backed by the org.apache.felix.resolver.util.CopyOnWriteList.removeAll(Collection) implementation. > clearCandidates is used when a requirement has multiple cardinality and some subset of candidates causes a uses constraint violation. The clearCandidates method will remove the offending capabilities as long as there is at least one remaining capability that does not cause a uses constraint violation. The issue is the CopyOnWriteList.removeAll is not correct. If the last element in the list is the only element to be removed then the logic ends up removing all elements (by constructing and empty data array). -- This message was sent by Atlassian JIRA (v6.3.4#6332)