karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [1/6] git commit: [KARAF-2888] Fix IllegalStateException if a bundle has been manually installed and is later requested by a feature
Date Fri, 25 Apr 2014 12:40:58 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 2e1dbb7b5 -> 1c63a097e


[KARAF-2888] Fix IllegalStateException if a bundle has been manually installed and is later
requested by a feature

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/1f563d5f
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/1f563d5f
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/1f563d5f

Branch: refs/heads/master
Commit: 1f563d5f59659c37fbb14033d8c3fe88bbb0d38b
Parents: 2e1dbb7
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Fri Apr 25 11:43:57 2014 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Fri Apr 25 11:43:57 2014 +0200

----------------------------------------------------------------------
 .../features/internal/region/SubsystemResolveContext.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/1f563d5f/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
index 10be228..da435de 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
@@ -35,6 +35,7 @@ import org.eclipse.equinox.region.Region;
 import org.eclipse.equinox.region.RegionDigraph;
 import org.eclipse.equinox.region.RegionFilter;
 import org.osgi.framework.BundleException;
+import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
@@ -130,9 +131,8 @@ public class SubsystemResolveContext extends ResolveContext {
                         String r2 = getRegion(resource).getName();
                         int c = r1.compareTo(r2);
                         if (c == 0) {
-                            // This should never happen because resource have been
-                            // de-duplicated during the pre-resolution phase.
-                            throw new IllegalStateException();
+                            // One of the resource has to be a bundle, use that one
+                            c = (prev instanceof BundleRevision) ? -1 : +1;
                         }
                         resource = c < 0 ? prev : resource;
                     }


Mime
View raw message