Herko ter Horst created FELIX-4304:
--------------------------------------

             Summary: 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


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)

Reply via email to