Apply patch (FELIX-3463) to fix a bug in fragment handling.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1326664 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/resolver/src/main/java/org/apache/felix/resolver/Candidates.java b/resolver/src/main/java/org/apache/felix/resolver/Candidates.java
index b3dc3e2..9296ab2 100644
--- a/resolver/src/main/java/org/apache/felix/resolver/Candidates.java
+++ b/resolver/src/main/java/org/apache/felix/resolver/Candidates.java
@@ -757,13 +757,16 @@
{
List<Capability> original = ((ShadowList) cands).getOriginal();
int removeIdx = original.indexOf(origCap);
- original.remove(removeIdx);
+ if (removeIdx != -1)
+ {
+ original.remove(removeIdx);
+ cands.remove(removeIdx);
+ }
int insertIdx = rc.insertHostedCapability(
original,
new SimpleHostedCapability(
hostResource.getDeclaredResource(),
origCap));
- cands.remove(removeIdx);
cands.add(insertIdx, c);
}
// If the original capability is from the host, then