stephan     2004/03/11 07:13:02

  Modified:    tools/src/anttasks XConfToolTask.java
  Log:
  Replace tab by two spaces.
  
  Revision  Changes    Path
  1.19      +39 -39    cocoon-2.1/tools/src/anttasks/XConfToolTask.java
  
  Index: XConfToolTask.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/src/anttasks/XConfToolTask.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XConfToolTask.java        11 Mar 2004 15:11:10 -0000      1.18
  +++ XConfToolTask.java        11 Mar 2004 15:13:02 -0000      1.19
  @@ -76,7 +76,7 @@
       private boolean addComments;
       /** for resolving entities such as dtds */
       private XMLCatalog xmlCatalog = new XMLCatalog();
  -             private DocumentBuilderFactory builderFactory;
  +    private DocumentBuilderFactory builderFactory;
       private DocumentBuilder builder;
       private Transformer transformer;
   
  @@ -154,51 +154,51 @@
               boolean hasChanged = false;
               // process recursive
               File patchfile;
  -                                             ArrayList suspended = new 
ArrayList();
  +            ArrayList suspended = new ArrayList();
               for (int i = 0; i < list.length; i++) {
                   patchfile = new File(this.srcdir, list[i]);
                   try {
                       // Adds configuration snippet from the file to the 
configuration
  -                                                                             
boolean changed = patch(document, patchfile);
  +                    boolean changed = patch(document, patchfile);
                       hasChanged |= changed;
  -                                                                             
if (!changed) {
  -                                                                             
    suspended.add(patchfile);
  -                                                                             
}
  +                    if (!changed) {
  +                        suspended.add(patchfile);
  +                    }
                   } catch (SAXException e) {
                       log("Ignoring: "+patchfile+"\n(not a valid XML)");
                   }
               }
   
  -                                             if (hasChanged && 
!suspended.isEmpty()) {
  -                                                 log("Try to apply suspended 
patch files");
  -                                             }
  -
  -                                             ArrayList newSuspended = new 
ArrayList();
  -                                             while (hasChanged && 
!suspended.isEmpty()) {
  -                                                       hasChanged = false;
  -                                                       for(Iterator 
i=suspended.iterator(); i.hasNext();) {
  -                                                                       
patchfile = (File)i.next();
  -                                                                 try {
  -                                                                             
        // Adds configuration snippet from the file to the configuration
  -                                                                             
        boolean changed = patch(document, patchfile);
  -                           hasChanged |= changed;
  -                           if (!changed) {
  +            if (hasChanged && !suspended.isEmpty()) {
  +                log("Try to apply suspended patch files");
  +            }
  +
  +            ArrayList newSuspended = new ArrayList();
  +            while (hasChanged && !suspended.isEmpty()) {
  +                hasChanged = false;
  +                for(Iterator i=suspended.iterator(); i.hasNext();) {
  +                    patchfile = (File)i.next();
  +                    try {
  +                         // Adds configuration snippet from the file to the 
configuration
  +                        boolean changed = patch(document, patchfile);
  +                        hasChanged |= changed;
  +                        if (!changed) {
                               newSuspended.add(patchfile);
  -                                 }
  -                             } catch (SAXException e) {
  -                                                                             
  log("Ignoring: "+patchfile+"\n(not a valid XML)");
  -                                                                             
}
  -                                                       }
  -                                                 suspended = newSuspended;
  -                                                             newSuspended = 
new ArrayList();
  -                                             }
  +                        }
  +                    } catch (SAXException e) {
  +                        log("Ignoring: "+patchfile+"\n(not a valid XML)");
  +                    }
  +                }
  +                suspended = newSuspended;
  +                newSuspended = new ArrayList();
  +            }
   
  -                                             if (!suspended.isEmpty()) {
  -                                                 for(Iterator 
i=suspended.iterator(); i.hasNext();) {
  +            if (!suspended.isEmpty()) {
  +                for(Iterator i=suspended.iterator(); i.hasNext();) {
                       patchfile = (File)i.next();
  -                                                     log("Dismiss: 
"+patchfile.toString());
  -                                                             }
  -                                             }
  +                    log("Dismiss: "+patchfile.toString());
  +                }
  +            }
   
               if (hasChanged) {
                   log("Writing: " + this.file);
  @@ -246,8 +246,8 @@
                             throws TransformerException, IOException, 
DOMException, SAXException {
   
           Document component = builder.parse(file.toURL().toExternalForm());
  -                             String filename = file.toString();
  -                                                                             
                                
  +        String filename = file.toString();
  +                            
           // Check to see if Document is an xconf-tool document
           Element elem = component.getDocumentElement();
   
  @@ -269,10 +269,10 @@
   
           NodeList nodes = XPathAPI.selectNodeList(configuration, xpath);
   
  -                             // Suspend, because the xpath returned not one 
node
  +        // Suspend, because the xpath returned not one node
           if (nodes.getLength() !=1 ) {
  -                                       log("Suspending: "+filename);
  -                                             return false;
  +            log("Suspending: "+filename);
  +            return false;
           }
           Node root = nodes.item(0);
   
  
  
  

Reply via email to