servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsny...@apache.org
Subject svn commit: r634714 - /servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java
Date Fri, 07 Mar 2008 15:22:48 GMT
Author: bsnyder
Date: Fri Mar  7 07:22:47 2008
New Revision: 634714

URL: http://svn.apache.org/viewvc?rev=634714&view=rev
Log:
SM-1161 - jbi-service-unit causes infinite loop when dependency graph is not cycle-free

Modified:
    servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java

Modified: servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java?rev=634714&r1=634713&r2=634714&view=diff
==============================================================================
--- servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java
(original)
+++ servicemix/smx3/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/AbstractJbiMojo.java
Fri Mar  7 07:22:47 2008
@@ -149,10 +149,12 @@
     }
 
     protected Set getArtifacts(Node n, Set s) {
-        s.add(n.getArtifact());
-        for (Iterator iter = n.getChildren().iterator(); iter.hasNext();) {
-            Node c = (Node) iter.next();
-            getArtifacts(c, s);
+        if (!s.contains(n.getArtifact())) {
+            s.add(n.getArtifact());
+            for (Iterator iter = n.getChildren().iterator(); iter.hasNext();) {
+                Node c = (Node) iter.next();
+                getArtifacts(c, s);
+            }
         }
         return s;
     }
@@ -165,11 +167,10 @@
         }
     }
 
-    protected void print(Node rootNode, String string) {
-        getLog().info(string + rootNode.getArtifact());
-        for (Iterator iter = rootNode.getChildren().iterator(); iter.hasNext();) {
-            Node n = (Node) iter.next();
-            print(n, string + "  ");
+    protected void print(Node rootNode) {
+        for (Iterator iter = getArtifacts(rootNode, new HashSet()).iterator(); iter.hasNext();)
{
+            Artifact a = (Artifact) iter.next();
+            getLog().info(" " + a);
         }
     }
 
@@ -231,7 +232,7 @@
         if (getLog().isDebugEnabled()) {
             getLog().debug("Dependency graph");
             getLog().debug("================");
-            print(listener.getRootNode(), "");
+            print(listener.getRootNode());
             getLog().debug("================");
         }
         return listener;



Mime
View raw message