ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gscok...@apache.org
Subject svn commit: r683610 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve: IvyNode.java IvyNodeEviction.java ResolveEngine.java
Date Thu, 07 Aug 2008 13:12:45 GMT
Author: gscokart
Date: Thu Aug  7 06:12:44 2008
New Revision: 683610

URL: http://svn.apache.org/viewvc?rev=683610&view=rev
Log:
minor optimization (avoid 1 copy) (IVY-872)

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=683610&r1=683609&r2=683610&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Thu Aug  7 06:12:44
2008
@@ -1044,7 +1044,8 @@
     // EVICTION MANAGEMENT
     // /////////////////////////////////////////////////////////////////////////////
 
-    public Collection getResolvedNodes(ModuleId moduleId, String rootModuleConf) {
+    /** A copy of the set of resolved nodes (real nodes) */
+    public Set getResolvedNodes(ModuleId moduleId, String rootModuleConf) {
         return eviction.getResolvedNodes(moduleId, rootModuleConf);
     }
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java?rev=683610&r1=683609&r2=683610&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java Thu Aug 
7 06:12:44 2008
@@ -204,7 +204,10 @@
         this.node = node;
     }
 
-    public Collection getResolvedNodes(ModuleId mid, String rootModuleConf) {
+    /**
+     * @return A copy of the set of resolved nodes (real nodes)
+     */
+    public Set getResolvedNodes(ModuleId mid, String rootModuleConf) {
         Collection resolved = (Collection) selectedDeps.get(new ModuleIdConf(mid, rootModuleConf));
         Set ret = new HashSet();
         if (resolved != null) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?rev=683610&r1=683609&r2=683610&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java Thu Aug  7
06:12:44 2008
@@ -775,6 +775,7 @@
             // job is done and node is evicted, nothing to do
             return true;
         }
+        boolean debugConflictResolution = settings.debugConflictResolution();
         if (checkConflictSolvedSelected(node, ancestor)) {
             // job is done and node is selected, nothing to do for this ancestor, but we
still have
             // to check higher levels, for which conflict resolution might have been impossible
@@ -786,13 +787,13 @@
                     ancestor);
                 if (evictionData != null) {
                     // node has been previously evicted in an ancestor: we mark it as evicted
-                    if (settings.debugConflictResolution()) {
+                    if (debugConflictResolution) {
                         Message.debug(node + " was previously evicted in root module conf
"
                                 + node.getRootModuleConf());
                     }
 
                     node.markEvicted(evictionData);
-                    if (settings.debugConflictResolution()) {
+                    if (debugConflictResolution) {
                         Message.debug("evicting " + node + " by " + evictionData);
                     }
                 }
@@ -814,7 +815,7 @@
         Collection resolved = resolveConflicts(node, ancestor, conflicts, conflictManager);
 
         if (resolved == null) {
-            if (settings.debugConflictResolution()) {
+            if (debugConflictResolution) {
                 Message.debug("impossible to resolve conflicts for " + node + " in " + ancestor
                         + " yet");
                 Message.debug("setting all nodes as pending conflicts for later conflict"

@@ -825,7 +826,7 @@
             return false;
         }
 
-        if (settings.debugConflictResolution()) {
+        if (debugConflictResolution) {
             Message.debug("selected revisions for " + node + " in " + ancestor + ": " + resolved);
         }
         if (resolved.contains(node.getNode())) {
@@ -840,7 +841,7 @@
                 te.markEvicted(node.getRootModuleConf(), ancestor.getNode(), conflictManager,
                     resolved);
 
-                if (settings.debugConflictResolution()) {
+                if (debugConflictResolution) {
                     Message.debug("evicting " + te + " by "
                             + te.getEvictedData(node.getRootModuleConf()));
                 }
@@ -865,7 +866,7 @@
         } else {
             // node has been evicted for the current parent
             if (resolved.isEmpty()) {
-                if (settings.debugConflictResolution()) {
+                if (debugConflictResolution) {
                     Message.verbose("conflict manager '" + conflictManager
                             + "' evicted all revisions among " + conflicts);
                 }
@@ -885,7 +886,7 @@
                 Collections.EMPTY_SET);
 
             node.markEvicted(ancestor, conflictManager, resolved);
-            if (settings.debugConflictResolution()) {
+            if (debugConflictResolution) {
                 Message.debug("evicting " + node + " by " + node.getEvictedData());
             }
 



Mime
View raw message