Simplify old package admin impl method. (FELIX-2950)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1153240 13f79535-47bb-0310-9956-ffa450edef68
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 2faedc5..1deb598 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
@@ -1433,7 +1433,7 @@
                     }
                 }
             }
-// TODO: OSGi R4.3 - If we eliminate resolving from this method, then we can
+// TODO: OSGi R4.3/ELIMINATE RESOLVE - If we eliminate resolving from this method, then we can
 //       simplify this catch, since resolve throws resolve and bundle exceptions.
             catch (Exception ex)
             {
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 c879761..beb42a2 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -1523,7 +1523,7 @@
         {
             return null;
         }
-// TODO: OSGi R4.3 - Previously, we try to resolve resource requests in
+// TODO: OSGi R4.3/ELIMINATE RESOLVE - Previously, we try to resolve resource requests in
 //       findClassOrResourceByDelegation() and fall back to local resource
 //       searching if it fails. Now we must attempt the resolve here since
 //       we cannot search by delegation until we are resolved and do the local
@@ -1565,7 +1565,7 @@
         {
             return null;
         }
-// TODO: OSGi R4.3 - Previously, we try to resolve resource requests in
+// TODO: OSGi R4.3/ELIMINATE RESOLVE - Previously, we try to resolve resource requests in
 //       findClassOrResourceByDelegation() and fall back to local resource
 //       searching if it fails. Now we must attempt the resolve here since
 //       we cannot search by delegation until we are resolved and do the local
@@ -3737,39 +3737,12 @@
             {
                 for (BundleCapability cap : caps)
                 {
-                    // See if the target bundle's revisions is one of the
-                    // resolved exporters of the package.
                     if (cap.getNamespace().equals(BundleRevision.PACKAGE_NAMESPACE))
                     {
-// TODO: OSGi R4.3 - We can probably do this in a more efficient way once
-//       BundleWiring.getCapabilities() returns the proper result. We probably
-//       Won't even need this method.
                         String pkgName = (String)
                             cap.getAttributes().get(BundleRevision.PACKAGE_NAMESPACE);
-                        Map<String, Object> attrs = new HashMap<String, Object>(1);
-                        attrs.put(BundleRevision.PACKAGE_NAMESPACE, pkgName);
-                        BundleRequirementImpl req =
-                            new BundleRequirementImpl(
-                            null,
-                            BundleRevision.PACKAGE_NAMESPACE,
-                            Collections.EMPTY_MAP,
-                            attrs);
-                        Set<BundleCapability> providers = m_resolver.getCandidates(req, false);
-
-                        // Search through the current providers to find the target revision.
-                        // We only want resolved capabilities.
-                        if (providers != null)
-                        {
-                            for (BundleCapability provider : providers)
-                            {
-                                if ((provider.getRevision().getWiring() != null)
-                                    && (provider == cap))
-                                {
-                                    list.add(new ExportedPackageImpl(
-                                        this, (BundleImpl) bundle, br, cap));
-                                }
-                            }
-                        }
+                        list.add(new ExportedPackageImpl(
+                            this, (BundleImpl) bundle, br, cap));
                     }
                 }
             }