Various cleaning up of the code. (FELIX-2950)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1102838 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
index e425c91..338d0e4 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
@@ -23,7 +23,19 @@
 import java.util.Dictionary;
 
 import org.apache.felix.framework.ext.FelixBundleContext;
-import org.osgi.framework.*;
+import org.osgi.framework.AdminPermission;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServicePermission;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.SynchronousBundleListener;
 
 class BundleContextImpl implements FelixBundleContext
 {
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
index 4ed25da..458fa9f 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
@@ -28,7 +28,15 @@
 import org.apache.felix.framework.ext.SecurityProvider;
 import org.apache.felix.framework.util.StringMap;
 import org.apache.felix.framework.util.Util;
-import org.osgi.framework.*;
+import org.osgi.framework.AdminPermission;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServicePermission;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
 import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.framework.wiring.BundleWire;
 
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java
index 349a0ce..7ebc611 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java
@@ -30,7 +30,7 @@
 import java.util.List;
 import java.util.Map;
 import org.apache.felix.framework.Felix.StatefulResolver;
-import org.apache.felix.framework.resolver.Content;
+import org.apache.felix.framework.cache.Content;
 import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.SecureAction;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
index 201f94a..60588b1 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
@@ -41,7 +41,7 @@
 import java.util.TreeMap;
 import org.apache.felix.framework.Felix.StatefulResolver;
 import org.apache.felix.framework.cache.JarContent;
-import org.apache.felix.framework.resolver.Content;
+import org.apache.felix.framework.cache.Content;
 import org.apache.felix.framework.resolver.HostedCapability;
 import org.apache.felix.framework.resolver.HostedRequirement;
 import org.apache.felix.framework.resolver.ResolveException;
@@ -54,7 +54,6 @@
 import org.apache.felix.framework.util.manifestparser.R4Library;
 import org.apache.felix.framework.wiring.BundleCapabilityImpl;
 import org.apache.felix.framework.wiring.BundleRequirementImpl;
-import org.apache.felix.framework.wiring.BundleWireImpl;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.BundleReference;
@@ -403,7 +402,7 @@
         return m_wires;
     }
 
-    public synchronized void addDynamicWire(BundleWireImpl wire)
+    public synchronized void addDynamicWire(BundleWire wire)
     {
         m_wires.add(wire);
         m_importedPkgs.put(
diff --git a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
index ff0c411..b30a70b 100644
--- a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
+++ b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
@@ -44,7 +44,7 @@
 import org.apache.felix.framework.util.StringMap;
 import org.apache.felix.framework.util.Util;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
-import org.apache.felix.framework.resolver.Content;
+import org.apache.felix.framework.cache.Content;
 import org.apache.felix.framework.util.manifestparser.R4Library;
 import org.apache.felix.framework.wiring.BundleCapabilityImpl;
 import org.osgi.framework.AdminPermission;
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 2d8437c..ba0f2ff 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -4579,20 +4579,15 @@
             // visibility, since we need to include those packages too.
             if (br.getWiring() == null)
             {
-System.out.println("+++ br.getWiring() = " + br.getWiring());
                 for (ResolverWire rw : wireMap.get(br))
                 {
-System.out.println("+++ rw.getCapability() = " + rw.getCapability());
-System.out.println("+++ rw.getRequirement() = " + rw.getRequirement());
                     if (rw.getCapability().getNamespace().equals(
                         BundleCapabilityImpl.BUNDLE_NAMESPACE))
                     {
                         String dir = rw.getRequirement()
                             .getDirectives().get(Constants.VISIBILITY_DIRECTIVE);
-System.out.println("+++ dir = " + dir);
                         if ((dir != null) && (dir.equals(Constants.VISIBILITY_REEXPORT)))
                         {
-System.out.println("+++ rw.getProvider() = " + rw.getProvider());
                             calculateExportedAndReexportedPackages(
                                 rw.getProvider(),
                                 wireMap,
diff --git a/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java b/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
index 1cea004..855223b 100644
--- a/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
@@ -18,12 +18,9 @@
  */
 package org.apache.felix.framework;
 
-import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Version;
-import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.service.packageadmin.RequiredBundle;
 
 class RequiredBundleImpl implements RequiredBundle
diff --git a/framework/src/main/java/org/apache/felix/framework/ResolverStateImpl.java b/framework/src/main/java/org/apache/felix/framework/ResolverStateImpl.java
index 3272b82..6d983c9 100644
--- a/framework/src/main/java/org/apache/felix/framework/ResolverStateImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/ResolverStateImpl.java
@@ -23,7 +23,6 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.StringTokenizer;
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java b/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java
index 72ec9fd..ff88bf6 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java
@@ -22,7 +22,6 @@
 import java.util.Map;
 
 import org.apache.felix.framework.Logger;
-import org.apache.felix.framework.resolver.Content;
 
 /**
  * <p>
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/Content.java b/framework/src/main/java/org/apache/felix/framework/cache/Content.java
similarity index 98%
rename from framework/src/main/java/org/apache/felix/framework/resolver/Content.java
rename to framework/src/main/java/org/apache/felix/framework/cache/Content.java
index f820ec8..b1cb0e4 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/Content.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/Content.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.framework.resolver;
+package org.apache.felix.framework.cache;
 
 import java.io.IOException;
 import java.io.InputStream;
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java b/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java
index aed76c6..4d8a2dd 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java
@@ -18,7 +18,6 @@
  */
 package org.apache.felix.framework.cache;
 
-import org.apache.felix.framework.resolver.Content;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java b/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java
index 3452ff8..4e7e929 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java
@@ -18,7 +18,6 @@
  */
 package org.apache.felix.framework.cache;
 
-import org.apache.felix.framework.resolver.Content;
 import java.io.*;
 import java.net.MalformedURLException;
 import java.net.URL;
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java b/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
index 8275272..54ee13f 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
@@ -26,7 +26,6 @@
 
 import org.apache.felix.framework.Logger;
 import org.apache.felix.framework.util.StringMap;
-import org.apache.felix.framework.resolver.Content;
 
 /**
  * <p>
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java b/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java
index 3b5512a..12ca117 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java
@@ -34,7 +34,6 @@
 import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.ZipFileX;
 import org.apache.felix.framework.util.Util;
-import org.apache.felix.framework.resolver.Content;
 import org.osgi.framework.Constants;
 
 public class JarContent implements Content
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java b/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
index 75daf4e..064d4e5 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
@@ -32,7 +32,6 @@
 import org.apache.felix.framework.util.ZipFileX;
 import org.apache.felix.framework.util.StringMap;
 import org.apache.felix.framework.util.Util;
-import org.apache.felix.framework.resolver.Content;
 
 /**
  * <p>
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
index 2721387..78cf088 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
@@ -90,7 +90,7 @@
 
                     // If the requested revision is a fragment, then
                     // ultimately we will verify the host.
-                    BundleRequirementImpl hostReq = getHostRequirement(revision);
+                    BundleRequirement hostReq = getHostRequirement(revision);
                     BundleRevision target = revision;
 
                     do
@@ -323,25 +323,25 @@
         return singletons;
     }
 
-    private static BundleCapabilityImpl getHostCapability(BundleRevision br)
+    private static BundleCapability getHostCapability(BundleRevision br)
     {
         for (BundleCapability c : br.getDeclaredCapabilities(null))
         {
             if (c.getNamespace().equals(BundleCapabilityImpl.HOST_NAMESPACE))
             {
-                return (BundleCapabilityImpl) c;
+                return c;
             }
         }
         return null;
     }
 
-    private static BundleRequirementImpl getHostRequirement(BundleRevision br)
+    private static BundleRequirement getHostRequirement(BundleRevision br)
     {
         for (BundleRequirement r : br.getDeclaredRequirements(null))
         {
             if (r.getNamespace().equals(BundleCapabilityImpl.HOST_NAMESPACE))
             {
-                return (BundleRequirementImpl) r;
+                return r;
             }
         }
         return null;
@@ -460,8 +460,8 @@
 
         // Create parallel arrays for requirement and proposed candidate
         // capability or actual capability if revision is resolved or not.
-        List<BundleRequirementImpl> reqs = new ArrayList();
-        List<BundleCapabilityImpl> caps = new ArrayList();
+        List<BundleRequirement> reqs = new ArrayList();
+        List<BundleCapability> caps = new ArrayList();
         boolean isDynamicImporting = false;
         if (revision.getWiring() != null)
         {
@@ -488,8 +488,8 @@
                         wire.getProviderWiring().getRevision(),
                         (BundleCapabilityImpl) c);
                 }
-                reqs.add((BundleRequirementImpl) r);
-                caps.add((BundleCapabilityImpl) c);
+                reqs.add(r);
+                caps.add(c);
             }
 
             // Since the revision is resolved, it could be dynamically importing,
@@ -508,8 +508,8 @@
                 }
 
                 BundleCapability cap = candCaps.iterator().next();
-                reqs.add((BundleRequirementImpl) req);
-                caps.add((BundleCapabilityImpl) cap);
+                reqs.add(req);
+                caps.add(cap);
                 isDynamicImporting = true;
                 // Can only dynamically import one at a time, so break
                 // out of the loop after the first.
@@ -530,8 +530,8 @@
                 }
 
                 BundleCapability cap = candCaps.iterator().next();
-                reqs.add((BundleRequirementImpl) req);
-                caps.add((BundleCapabilityImpl) cap);
+                reqs.add(req);
+                caps.add(cap);
             }
         }
 
@@ -542,8 +542,8 @@
         // Second, add all imported packages to the target revision's package space.
         for (int i = 0; i < reqs.size(); i++)
         {
-            BundleRequirementImpl req = reqs.get(i);
-            BundleCapabilityImpl cap = caps.get(i);
+            BundleRequirement req = reqs.get(i);
+            BundleCapability cap = caps.get(i);
             calculateExportedPackages(cap.getRevision(), allCandidates, revisionPkgMap);
             mergeCandidatePackages(revision, req, cap, revisionPkgMap, allCandidates);
         }
@@ -574,7 +574,7 @@
                     // Ignore revisions that import from themselves.
                     if (!blame.m_cap.getRevision().equals(revision))
                     {
-                        List<BundleRequirementImpl> blameReqs = new ArrayList();
+                        List<BundleRequirement> blameReqs = new ArrayList();
                         blameReqs.add(blame.m_reqs.get(0));
 
                         mergeUses(
@@ -592,7 +592,7 @@
             {
                 for (Blame blame : entry.getValue())
                 {
-                    List<BundleRequirementImpl> blameReqs = new ArrayList();
+                    List<BundleRequirement> blameReqs = new ArrayList();
                     blameReqs.add(blame.m_reqs.get(0));
 
                     mergeUses(
@@ -609,7 +609,7 @@
     }
 
     private void mergeCandidatePackages(
-        BundleRevision current, BundleRequirementImpl currentReq, BundleCapability candCap,
+        BundleRevision current, BundleRequirement currentReq, BundleCapability candCap,
         Map<BundleRevision, Packages> revisionPkgMap,
         Candidates allCandidates)
     {
@@ -667,7 +667,7 @@
 
     private void mergeCandidatePackage(
         BundleRevision current, boolean requires,
-        BundleRequirementImpl currentReq, BundleCapability candCap,
+        BundleRequirement currentReq, BundleCapability candCap,
         Map<BundleRevision, Packages> revisionPkgMap)
     {
         if (candCap.getNamespace().equals(BundleCapabilityImpl.PACKAGE_NAMESPACE))
@@ -717,7 +717,7 @@
 
     private void mergeUses(
         BundleRevision current, Packages currentPkgs,
-        BundleCapability mergeCap, List<BundleRequirementImpl> blameReqs,
+        BundleCapability mergeCap, List<BundleRequirement> blameReqs,
         Map<BundleRevision, Packages> revisionPkgMap,
         Candidates allCandidates,
         Map<BundleCapability, List<BundleRevision>> cycleMap)
@@ -776,7 +776,7 @@
                 {
                     if (blame.m_reqs != null)
                     {
-                        List<BundleRequirementImpl> blameReqs2 = new ArrayList(blameReqs);
+                        List<BundleRequirement> blameReqs2 = new ArrayList(blameReqs);
                         blameReqs2.add(blame.m_reqs.get(blame.m_reqs.size() - 1));
                         usedCaps.add(new Blame(blame.m_cap, blameReqs2));
                         mergeUses(current, currentPkgs, blame.m_cap, blameReqs2,
@@ -813,7 +813,7 @@
 
         ResolveException rethrow = null;
         Candidates permutation = null;
-        Set<BundleRequirementImpl> mutated = null;
+        Set<BundleRequirement> mutated = null;
 
         // Check for conflicting imports from fragments.
         for (Entry<String, List<Blame>> entry : pkgs.m_importedPkgs.entrySet())
@@ -898,11 +898,11 @@
 
                     mutated = (mutated != null)
                         ? mutated
-                        : new HashSet();
+                        : new HashSet<BundleRequirement>();
 
                     for (int reqIdx = usedBlame.m_reqs.size() - 1; reqIdx >= 0; reqIdx--)
                     {
-                        BundleRequirementImpl req = usedBlame.m_reqs.get(reqIdx);
+                        BundleRequirement req = usedBlame.m_reqs.get(reqIdx);
 
                         // If we've already permutated this requirement in another
                         // uses constraint, don't permutate it again just continue
@@ -991,7 +991,7 @@
 
                         for (int reqIdx = usedBlame.m_reqs.size() - 1; reqIdx >= 0; reqIdx--)
                         {
-                            BundleRequirementImpl req = usedBlame.m_reqs.get(reqIdx);
+                            BundleRequirement req = usedBlame.m_reqs.get(reqIdx);
 
                             // If we've already permutated this requirement in another
                             // uses constraint, don't permutate it again just continue
@@ -1036,7 +1036,7 @@
                     // Try to permutate the candidate for the original
                     // import requirement; only permutate it if we haven't
                     // done so already.
-                    BundleRequirementImpl req = importBlame.m_reqs.get(0);
+                    BundleRequirement req = importBlame.m_reqs.get(0);
                     if (!mutated.contains(req))
                     {
                         // Since there may be lots of uses constraint violations
@@ -1083,7 +1083,7 @@
                         // to backtrack on our current candidate selection.
                         if (permCount == (m_usesPermutations.size() + m_importPermutations.size()))
                         {
-                            BundleRequirementImpl req = importBlame.m_reqs.get(0);
+                            BundleRequirement req = importBlame.m_reqs.get(0);
                             permutate(allCandidates, req, m_importPermutations);
                         }
                         throw ex;
@@ -1094,7 +1094,7 @@
     }
 
     private static void permutate(
-        Candidates allCandidates, BundleRequirementImpl req, List<Candidates> permutations)
+        Candidates allCandidates, BundleRequirement req, List<Candidates> permutations)
     {
         SortedSet<BundleCapability> candidates = allCandidates.getCandidates(req);
         if (candidates.size() > 1)
@@ -1109,7 +1109,7 @@
     }
 
     private static void permutateIfNeeded(
-        Candidates allCandidates, BundleRequirementImpl req, List<Candidates> permutations)
+        Candidates allCandidates, BundleRequirement req, List<Candidates> permutations)
     {
         SortedSet<BundleCapability> candidates = allCandidates.getCandidates(req);
         if (candidates.size() > 1)
@@ -1203,7 +1203,7 @@
         for (Entry<String, BundleCapability> entry : exports.entrySet())
         {
             packages.m_exportedPkgs.put(
-                entry.getKey(), new Blame((BundleCapabilityImpl) entry.getValue(), null));
+                entry.getKey(), new Blame(entry.getValue(), null));
         }
 
         revisionPkgMap.put(revision, packages);
@@ -1359,9 +1359,9 @@
                         Packages candPkgs = revisionPkgMap.get(cand.getRevision());
                         ResolverWire wire = new ResolverWireImpl(
                             unwrappedRevision,
-                            (BundleRequirementImpl) getActualRequirement(req),
+                            getActualRequirement(req),
                             getActualBundleRevision(cand.getRevision()),
-                            (BundleCapabilityImpl) getActualCapability(cand));
+                            getActualCapability(cand));
                         if (req.getNamespace().equals(BundleCapabilityImpl.PACKAGE_NAMESPACE))
                         {
                             packageWires.add(wire);
@@ -1442,7 +1442,7 @@
                                 Collections.EMPTY_MAP,
                                 attrs),
                             getActualBundleRevision(blame.m_cap.getRevision()),
-                            (BundleCapabilityImpl) getActualCapability(blame.m_cap)));
+                            getActualCapability(blame.m_cap)));
                 }
             }
         }
@@ -1494,7 +1494,7 @@
         {
             for (int i = 0; i < blame.m_reqs.size(); i++)
             {
-                BundleRequirementImpl req = blame.m_reqs.get(i);
+                BundleRequirement req = blame.m_reqs.get(i);
                 sb.append("  ");
                 sb.append(req.getRevision().getSymbolicName());
                 sb.append(" [");
@@ -1508,7 +1508,7 @@
                 {
                     sb.append("    require: ");
                 }
-                sb.append(req.getFilter().toString());
+                sb.append(((BundleRequirementImpl) req).getFilter().toString());
                 sb.append("\n     |");
                 if (req.getNamespace().equals(BundleCapabilityImpl.PACKAGE_NAMESPACE))
                 {
@@ -1522,7 +1522,7 @@
                 {
                     BundleCapability cap = Util.getSatisfyingCapability(
                         blame.m_reqs.get(i + 1).getRevision(),
-                        blame.m_reqs.get(i));
+                        (BundleRequirementImpl) blame.m_reqs.get(i));
                     if (cap.getNamespace().equals(BundleCapabilityImpl.PACKAGE_NAMESPACE))
                     {
                         sb.append(BundleCapabilityImpl.PACKAGE_ATTR);
@@ -1533,13 +1533,13 @@
                         {
                             usedCap = Util.getSatisfyingCapability(
                                 blame.m_reqs.get(i + 2).getRevision(),
-                                blame.m_reqs.get(i + 1));
+                                (BundleRequirementImpl) blame.m_reqs.get(i + 1));
                         }
                         else
                         {
                             usedCap = Util.getSatisfyingCapability(
                                 blame.m_cap.getRevision(),
-                                blame.m_reqs.get(i + 1));
+                                (BundleRequirementImpl) blame.m_reqs.get(i + 1));
                         }
                         sb.append("; uses:=");
                         sb.append(usedCap.getAttributes().get(BundleCapabilityImpl.PACKAGE_ATTR));
@@ -1554,7 +1554,7 @@
                 {
                     BundleCapability export = Util.getSatisfyingCapability(
                         blame.m_cap.getRevision(),
-                        blame.m_reqs.get(i));
+                        (BundleRequirementImpl) blame.m_reqs.get(i));
                     sb.append(BundleCapabilityImpl.PACKAGE_ATTR);
                     sb.append("=");
                     sb.append(export.getAttributes().get(BundleCapabilityImpl.PACKAGE_ATTR).toString());
@@ -1600,9 +1600,9 @@
     private static class Blame
     {
         public final BundleCapability m_cap;
-        public final List<BundleRequirementImpl> m_reqs;
+        public final List<BundleRequirement> m_reqs;
 
-        public Blame(BundleCapability cap, List<BundleRequirementImpl> reqs)
+        public Blame(BundleCapability cap, List<BundleRequirement> reqs)
         {
             m_cap = cap;
             m_reqs = reqs;
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverWire.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverWire.java
index 324c6df..69162b9 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverWire.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverWire.java
@@ -18,7 +18,6 @@
  */
 package org.apache.felix.framework.resolver;
 
-import java.util.Set;
 import org.osgi.framework.wiring.BundleCapability;
 import org.osgi.framework.wiring.BundleRequirement;
 import org.osgi.framework.wiring.BundleRevision;