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 C6F1D10649 for ; Mon, 18 Nov 2013 09:25:56 +0000 (UTC) Received: (qmail 78937 invoked by uid 500); 18 Nov 2013 09:25:47 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 77677 invoked by uid 500); 18 Nov 2013 09:25:40 -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 77577 invoked by uid 99); 18 Nov 2013 09:25:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Nov 2013 09:25:34 +0000 Date: Mon, 18 Nov 2013 09:25:34 +0000 (UTC) From: "Xander Uiterlinden (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (FELIX-4304) DependencyManager ComponentImpl should not assume all service properties are stored in a Hashtable 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-4304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xander Uiterlinden reassigned FELIX-4304: ----------------------------------------- Assignee: Xander Uiterlinden > DependencyManager ComponentImpl should not assume all service properties are stored in a Hashtable > -------------------------------------------------------------------------------------------------- > > Key: FELIX-4304 > URL: https://issues.apache.org/jira/browse/FELIX-4304 > Project: Felix > Issue Type: Bug > Components: Dependency Manager > Affects Versions: dependencymanager-3.1.0 > Reporter: Herko ter Horst > Assignee: Xander Uiterlinden > Attachments: ComponentImpl.java.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > In org.apache.felix.dm.impl.ComponentImpl.getServiceProperties() a copy of the internal field m_serviceProperties is created by casting to Hashtable and calling clone(). However, as clients are allowed to call setServiceProperties(Dictionary properties) which assigns the parameter value to the field, it is very possible for m_serviceProperties to contain some other Dictionary implementation. > The attached patch doesn't solves this problem in getServiceProperties() by making a copy by enumerating over all keys and putting them in a newly created Hashtable. > Alternatively (or in addition), setProperties() could be changed to ensure the parameter value isn't directly assigned to the field. -- This message was sent by Atlassian JIRA (v6.1#6144)