You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre De Rop (JIRA)" <ji...@apache.org> on 2015/03/01 15:07:04 UTC

[jira] [Updated] (FELIX-4304) DependencyManager ComponentImpl should not assume all service properties are stored in a Hashtable

     [ https://issues.apache.org/jira/browse/FELIX-4304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre De Rop updated FELIX-4304:
---------------------------------
    Fix Version/s:     (was: dependencymanager-4.0.0)
                   org.apache.felix.dependencymanager-r1

> 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
>             Fix For: org.apache.felix.dependencymanager-r1
>
>         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 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.3.4#6332)