Adam Bird created KARAF-2896:
--------------------------------

             Summary: RepositoryImpl load method incorrectly populates 
"features" list
                 Key: KARAF-2896
                 URL: https://issues.apache.org/jira/browse/KARAF-2896
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 2.3.3
            Reporter: Adam Bird


The RepositoryImpl incorrectly populates the RepositoryImpl's Features list 
with different FeatureImpl references than it populates FeatureImpl dependency 
lists with. Given a features.xml file that contains two features, FeatureA and 
FeatureB, where FeatureA depends on FeatureB, the following scenario is 
encountered in the RepositoryImpl's load() method (note that line numbers are 
based on Karaf 2.3.3 - this may not be an issue in 3.x given JAXB is now used):

* Line 127: Encounters node for FeatureA and creates FeatureImplA
* Line 165/167: Upon discovering that FeatureA is dependent on FeatureB, 
creates FeatureImplB and adds it to FeatureImplA's dependencies list
* Line 226: Adds FeatureImplA to the RepositoryImpl's features list
LOOP
* Line 127: Encounters node that defines FeatureB, but creates a new 
FeatureImpl instance, FeatureImplC, rather than using a reference to 
FeatureImplB
* Line 226: Adds FeatureImplC to the RepositoryImpl's features list

As a result calling FeatureImplA.getDependencies() will return FeatureImplB and 
calling RepositoryImpl.getFeatures() will return FeatureImplC, even though both 
calls should return a reference to the same FeatureImpl instance.




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to