You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Olivier Prouvost (JIRA)" <ji...@apache.org> on 2018/10/04 09:11:00 UTC

[jira] [Created] (FELIX-5950) NPE in MultiplePrototypeRefPair.unsetServiceObject

Olivier Prouvost created FELIX-5950:
---------------------------------------

             Summary: NPE in  MultiplePrototypeRefPair.unsetServiceObject
                 Key: FELIX-5950
                 URL: https://issues.apache.org/jira/browse/FELIX-5950
             Project: Felix
          Issue Type: Bug
          Components: Dependency Manager Runtime
         Environment: Mac OS X 10.14
            Reporter: Olivier Prouvost


I use Felix with the eclipse runtime (Photon 0918), and I get a NPE when running my application. 

 

Actually in the code of 

MultiplePrototypeRefPair.unsetServiceObject we have :  instances.get(key). 

If we search for the callers, the DependencyManager class call It like this : 

 

       protected void ungetService(RefPair<S, T> ref)

        {

            Object service = ref.unsetServiceObject(*null*);

            if (service != null)

 

Unfortunately, the instances map is a ConcurentHashMap which can not deal with null keys (it calls key.hashcode at the beginning), and this call will always raise an exception... 

Don't know what is the Felix version involved, but the bundle I use in my launch configuration is  (org.apache.felix.scr 2.0.14.v20180117)

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)