rubys       02/01/13 04:15:05

  Modified:    proposal/gump/java Project.java
  Log:
  It is not nice to modify a collection that you are iterating over...
  
  Revision  Changes    Path
  1.26      +15 -10    jakarta-alexandria/proposal/gump/java/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Project.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Project.java      12 Jan 2002 23:03:25 -0000      1.25
  +++ Project.java      13 Jan 2002 12:15:05 -0000      1.26
  @@ -11,6 +11,7 @@
   import java.util.Iterator;
   import java.util.Set;
   import java.util.TreeSet;
  +import java.util.Vector;
   
   public class Project {
   
  @@ -310,6 +311,8 @@
        * Process all inherited dependencies.  
        */
       private void inheritDependencies() {
  +        Vector inheritance = new Vector();
  +
           for (Enumeration e=dependsOn.elements(); e.hasMoreElements(); ) {
               Element depend = (Element) e.nextElement();
               String inherit = depend.getAttribute("inherit");
  @@ -336,9 +339,7 @@
                           Jenny.moveChildren(clone, renamed);
                           clone = renamed;
                       }
  -                    clone.setAttribute("inherited", "true");
  -                    dependsOn.put(name,clone);
  -                    element.appendChild(clone);
  +                    inheritance.add(clone);
   
                   // look for runtime="true" dependencies in the referenced
                   // project.  Convert depends to options if the reference to
  @@ -351,9 +352,7 @@
                               Jenny.moveChildren(clone, renamed);
                               clone = renamed;
                           }
  -                        clone.setAttribute("inherited", "true");
  -                        dependsOn.put(name,clone);
  -                        element.appendChild(clone);
  +                        inheritance.add(clone);
                       }
                   }
   
  @@ -362,12 +361,18 @@
                   // that dependency.
                   if (source.getAttribute("inherit").equals("jars")) {
                       Element clone = (Element) source.cloneNode(true);
  -                    clone.setAttribute("inherited", "true");
  -                    clone.removeAttribute("inherit");
  -                    dependsOn.put(name,clone);
  -                    element.appendChild(clone);
  +                    clone.setAttribute("inherit", "runtime");
  +                    inheritance.add(clone);
                   }
               }
  +        }
  +
  +        // Add the inherited nodes
  +        for (Enumeration e=inheritance.elements(); e.hasMoreElements(); ) {
  +            Element inherited = (Element) e.nextElement();
  +            inherited.setAttribute("inherited", "true");
  +            dependsOn.put(inherited.getAttribute("project"),inherited);
  +            element.appendChild(inherited);
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to