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

Guillaume Nodet resolved FELIX-2851.
------------------------------------

       Resolution: Fixed
    Fix Version/s: framework-3.0.9

> Resolution problems after a fragment can't be resolved
> ------------------------------------------------------
>
>                 Key: FELIX-2851
>                 URL: https://issues.apache.org/jira/browse/FELIX-2851
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: framework-3.0.9
>
>
> When a fragment can't be resolved correctly, his removal isn't properly 
> handled.
> The following patch seems to fix the problem:
> {code}
> diff --git 
> a/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java 
> b/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
> index 534d56f..ca74100 100644
> --- 
> a/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
> +++ 
> b/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
> @@ -157,8 +157,9 @@ public class FelixResolverState implements 
> Resolver.ResolverState
>  
>      public void detachFragment(Module host, Module fragment)
>      {
> -        List<Module> fragments = ((ModuleImpl) host).getFragments();
> +        List<Module> fragments = new ArrayList<Module>(((ModuleImpl) 
> host).getFragments());
>          fragments.remove(fragment);
> +        removeFragment(fragment);
>          try
>          {
>              ((ModuleImpl) host).attachFragments(fragments);
> {code}
> The first line is needed as the attachFragments() processing is screwed 
> because the original list of modified.
> The second line will actually remove packages exported by the fragment from 
> the capabilities set.
> I'd like to apply that on to the 3.0.x branch and trunk (eventually), so 
> please review.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to