cvs commit: jakarta-alexandria/proposal/gump/java Project.java

[email protected]
Newsgroups gmane.comp.jakarta.alexandria.devel
Message-ID <[email protected]>
rubys       2002/11/24 13:12:05

  Modified:    proposal/gump/java Project.java
  Log:
  Nags for commons-vfs were not being generated (having ignorable whitespace
  is not the same as having a regexp child)
  
  Revision  Changes    Path
  1.45      +32 -25    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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- Project.java	27 Aug 2002 14:54:09 -0000	1.44
  +++ Project.java	24 Nov 2002 21:12:05 -0000	1.45
  @@ -817,36 +817,43 @@
               regexp.setAttribute("to", to);
               regexp.setAttribute("from", from);
               nag.appendChild(regexp);
  +        }
  +
  +        Element regexp = null;
  +        Node child = nag.getFirstChild();
  +        for (; child != null; child = child.getNextSibling()) {
  +            if (child.getNodeName().equals("regexp")) {
  +                regexp = (Element)child;
   
  -        } else {
  +                if (regexp.getAttribute("pattern").equals("")) {
  +                    regexp.setAttribute("pattern", "/BUILD FAILED/");
  +                }
  +
  +                if (regexp.getAttribute("subject").equals("")) {
  +                    regexp.setAttribute("subject", subject);
  +                } else {
  +                    String orig = regexp.getAttribute("subject");
  +                    regexp.setAttribute("subject", nagPrefix + " " + orig);
  +                }
   
  -            Node child = nag.getFirstChild();
  -            for (; child != null; child = child.getNextSibling()) {
  -                if (child.getNodeName().equals("regexp")) {
  -                    Element regexp = (Element)child;
  -                    if (regexp.getAttribute("pattern").equals("")) {
  -                        regexp.setAttribute("pattern", "/BUILD FAILED/");
  -                    }
  -
  -                    if (regexp.getAttribute("subject").equals("")) {
  -                        regexp.setAttribute("subject", subject);
  -                    } else {
  -                        String orig = regexp.getAttribute("subject");
  -                        regexp.setAttribute("subject", nagPrefix + " " + orig);
  -                        
  -                    }
  -
  -                    if (nagTo != null 
  -                        || regexp.getAttribute("to").equals("")) {
  -                        regexp.setAttribute("to", to);
  -                    }
  -
  -                    if (regexp.getAttribute("from").equals("")) {
  -                        regexp.setAttribute("from", from);
  -                    }
  +                if (nagTo != null || regexp.getAttribute("to").equals("")) {
  +                    regexp.setAttribute("to", to);
  +                }
  +
  +                if (regexp.getAttribute("from").equals("")) {
  +                    regexp.setAttribute("from", from);
                   }
               }
  +        }
   
  +        if (regexp == null) {
  +            regexp = nag.getOwnerDocument().createElement("regexp");
  +            regexp.setAttribute("pattern", "/BUILD FAILED/");
  +            regexp.setAttribute("subject", subject);
  +            regexp.setAttribute("to", to);
  +            regexp.setAttribute("from", from);
  +            nag.appendChild(regexp);
           }
  +
       }
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.