[ 
https://issues.apache.org/jira/browse/FELIX-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996653#comment-12996653
 ] 

Guillaume Nodet commented on FELIX-2851:
----------------------------------------

 I do get that point. However, I  I think the resolver rewrite is quite a big 
change, so it may introduce different behaviors.  We already had problems when 
trying to upgrade from 3.0.2 to 3.0.8 so I wonder if creating a 3.0.9 bug fix 
release before you put in the new resolver would be a good idea.

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