You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2011/02/21 10:15:38 UTC

[jira] Assigned: (FELIX-2851) Resolution problems after a fragment can't be resolved

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

Guillaume Nodet reassigned FELIX-2851:
--------------------------------------

    Assignee: Guillaume Nodet

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