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

Terrien Jean-Yves updated KARAF-7687:
-------------------------------------
    Description: 
HI,
when declaring features with a version range
we get a NullPointerException while removing.

Let be the feature 'A'
{code:java}
<feature name="A" version="1.0.0">{code}
And feature 'B' which uses a version of 'A'
{code:java}
<feature name="B" version="1.0.0">
    <feature version="[1.0,1.1)">A</feature>
   ...
</feature>{code}
When you install 'A' then 'B', no problem the version of 'A' is found
If we delete 'B' then 'A' No problem. 
{code:java}
featureService.removeRepository(uri);{code}
But if we remove 'A' before 'B' It should throw an exception
FeaturesServiceImpl line 435
{code:java}
"Repository URI " + uri + " seems to have changed, can't remove 
repository"{code}
But in line 433 it uses getRepositoryClosure
there he looks for 
*{color:#ff0000}mvn:group.id/a-features/[1.0,1.1)/xml/features{color}*
it uses the repositoryCache cache to find it instead of looking for a version 
between 1.0 and 1.1
it does not find and returns null.
at line 119 of RepositoryCacheImpl 
{code:java}
remaining.add(null){code}
 causes a NullPointerEception

  was:
HI,
when declaring features with a version range
we get a NullPointerException while removing.

Let be the feature 'A'
{code:java}
<feature name="A" version="1.0.0">{code}
And feature 'B' which uses a version of 'A'
{code:java}
<feature name="A" version="1.0.0">
    <feature version="[1.0,1.1)">B</feature>
   ...
</feature>{code}
When you install 'A' then 'B', no problem the version of 'A' is found
If we delete 'B' then 'A' No problem. 
{code:java}
featureService.removeRepository(uri);{code}
But if we remove 'A' before 'B' It should throw an exception
FeaturesServiceImpl line 435
{code:java}
"Repository URI " + uri + " seems to have changed, can't remove 
repository"{code}
But in line 433 it uses getRepositoryClosure
there he looks for 
*{color:#ff0000}mvn:group.id/a-features/[1.0,1.1)/xml/features{color}*
it uses the repositoryCache cache to find it instead of looking for a version 
between 1.0 and 1.1
it does not find and returns null.
at line 119 of RepositoryCacheImpl 
{code:java}
remaining.add(null){code}
 causes a NullPointerEception


> NullPointerException on feature remove
> --------------------------------------
>
>                 Key: KARAF-7687
>                 URL: https://issues.apache.org/jira/browse/KARAF-7687
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.3.7
>            Reporter: Terrien Jean-Yves
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> HI,
> when declaring features with a version range
> we get a NullPointerException while removing.
> Let be the feature 'A'
> {code:java}
> <feature name="A" version="1.0.0">{code}
> And feature 'B' which uses a version of 'A'
> {code:java}
> <feature name="B" version="1.0.0">
>     <feature version="[1.0,1.1)">A</feature>
>    ...
> </feature>{code}
> When you install 'A' then 'B', no problem the version of 'A' is found
> If we delete 'B' then 'A' No problem. 
> {code:java}
> featureService.removeRepository(uri);{code}
> But if we remove 'A' before 'B' It should throw an exception
> FeaturesServiceImpl line 435
> {code:java}
> "Repository URI " + uri + " seems to have changed, can't remove 
> repository"{code}
> But in line 433 it uses getRepositoryClosure
> there he looks for 
> *{color:#ff0000}mvn:group.id/a-features/[1.0,1.1)/xml/features{color}*
> it uses the repositoryCache cache to find it instead of looking for a version 
> between 1.0 and 1.1
> it does not find and returns null.
> at line 119 of RepositoryCacheImpl 
> {code:java}
> remaining.add(null){code}
>  causes a NullPointerEception



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to