ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/util DOMElementWriter.java
Date Mon, 17 May 2004 13:43:53 GMT
peterreilly    2004/05/17 06:43:53

  Modified:    src/main/org/apache/tools/ant Tag: ANT_16_BRANCH
                        XmlLogger.java
               src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH
                        DOMElementWriter.java
  Log:
  sync
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.39.2.6  +14 -5     ant/src/main/org/apache/tools/ant/XmlLogger.java
  
  Index: XmlLogger.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/XmlLogger.java,v
  retrieving revision 1.39.2.5
  retrieving revision 1.39.2.6
  diff -u -r1.39.2.5 -r1.39.2.6
  --- XmlLogger.java	9 Mar 2004 17:01:30 -0000	1.39.2.5
  +++ XmlLogger.java	17 May 2004 13:43:52 -0000	1.39.2.6
  @@ -116,6 +116,9 @@
           private long startTime;
           /** Element created at the start time. */
           private Element element;
  +        public String toString() {
  +            return element.getTagName() + ":" + element.getAttribute("name");
  +        }
       }
   
       /**
  @@ -178,7 +181,7 @@
                   stream = new FileOutputStream(outFilename);
               }
               out = new OutputStreamWriter(stream, "UTF8");
  -            out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
  +            out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
               if (xslUri.length() > 0) {
                   out.write("<?xml-stylesheet type=\"text/xsl\" href=\""
                           + xslUri + "\"?>\n\n");
  @@ -209,6 +212,10 @@
               threadStack = new Stack();
               threadStacks.put(Thread.currentThread(), threadStack);
           }
  +        /* For debugging purposes uncomment:
  +        org.w3c.dom.Comment s = doc.createComment("stack=" + threadStack);
  +        buildElement.element.appendChild(s);
  +         */
           return threadStack;
       }
   
  @@ -252,9 +259,9 @@
                   TimedElement poppedStack = (TimedElement) threadStack.pop();
                   if (poppedStack != targetElement) {
                       throw new RuntimeException("Mismatch - popped element = "
  -                            + poppedStack.element
  +                            + poppedStack
                               + " finished target element = "
  -                            + targetElement.element);
  +                            + targetElement);
                   }
                   if (!threadStack.empty()) {
                       parentElement = (TimedElement) threadStack.peek();
  @@ -320,11 +327,13 @@
                   TimedElement poppedStack = (TimedElement) threadStack.pop();
                   if (poppedStack != taskElement) {
                       throw new RuntimeException("Mismatch - popped element = "
  -                            + poppedStack.element + " finished task element = "
  -                            + taskElement.element);
  +                            + poppedStack + " finished task element = "
  +                            + taskElement);
                   }
               }
               tasks.remove(task);
  +        } else {
  +            throw new RuntimeException("Unknown task " + task + " not in " + tasks);
           }
       }
   
  
  
  
  No                   revision
  No                   revision
  1.20.2.5  +6 -0      ant/src/main/org/apache/tools/ant/util/DOMElementWriter.java
  
  Index: DOMElementWriter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/DOMElementWriter.java,v
  retrieving revision 1.20.2.4
  retrieving revision 1.20.2.5
  diff -u -r1.20.2.4 -r1.20.2.5
  --- DOMElementWriter.java	9 Mar 2004 17:01:57 -0000	1.20.2.4
  +++ DOMElementWriter.java	17 May 2004 13:43:53 -0000	1.20.2.5
  @@ -117,6 +117,12 @@
                   out.write(encode(child.getNodeValue()));
                   break;
   
  +            case Node.COMMENT_NODE:
  +                out.write("<!--");
  +                out.write(encode(child.getNodeValue()));
  +                out.write("-->");
  +                break;
  +
               case Node.CDATA_SECTION_NODE:
                   out.write("<![CDATA[");
                   out.write(encodedata(((Text) child).getData()));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message