felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1690720 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
Date Mon, 13 Jul 2015 15:18:32 GMT
Author: gnodet
Date: Mon Jul 13 15:18:32 2015
New Revision: 1690720

URL: http://svn.apache.org/r1690720
Log:
[FELIX-4942] Small improvements in mergeUses()

Modified:
    felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java

Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java?rev=1690720&r1=1690719&r2=1690720&view=diff
==============================================================================
--- felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java (original)
+++ felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java Mon Jul
13 15:18:32 2015
@@ -791,8 +791,8 @@ public class ResolverImpl implements Res
                 if (!req.getNamespace().equals(BundleNamespace.BUNDLE_NAMESPACE)
                     && !req.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE))
                 {
-                    List<Requirement> blameReqs = new ArrayList<Requirement>();
-                    blameReqs.add(req);
+                    List<Requirement> blameReqs =
+                            Collections.singletonList(req);
 
                     mergeUses(
                         session,
@@ -806,15 +806,15 @@ public class ResolverImpl implements Res
                 }
             }
             // Merge uses constraints from imported packages.
-            for (Entry<String, List<Blame>> entry : resourcePkgs.m_importedPkgs.fast())
+            for (List<Blame> blames : resourcePkgs.m_importedPkgs.values())
             {
-                for (Blame blame : entry.getValue())
+                for (Blame blame : blames)
                 {
                     // Ignore resources that import from themselves.
                     if (!blame.m_cap.getResource().equals(resource))
                     {
-                        List<Requirement> blameReqs = new ArrayList<Requirement>();
-                        blameReqs.add(blame.m_reqs.get(0));
+                        List<Requirement> blameReqs =
+                            Collections.singletonList(blame.m_reqs.get(0));
 
                         mergeUses(
                             session,
@@ -829,12 +829,12 @@ public class ResolverImpl implements Res
                 }
             }
             // Merge uses constraints from required bundles.
-            for (Entry<String, List<Blame>> entry : resourcePkgs.m_requiredPkgs.fast())
+            for (List<Blame> blames : resourcePkgs.m_requiredPkgs.values())
             {
-                for (Blame blame : entry.getValue())
+                for (Blame blame : blames)
                 {
-                    List<Requirement> blameReqs = new ArrayList<Requirement>();
-                    blameReqs.add(blame.m_reqs.get(0));
+                    List<Requirement> blameReqs =
+                        Collections.singletonList(blame.m_reqs.get(0));
 
                     mergeUses(
                         session,



Mime
View raw message