bodewig     2003/07/23 01:09:01

  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
  Log:
  Whitespace changes
  
  Revision  Changes    Path
  1.57      +64 -60    ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- DirectoryScanner.java     23 Jul 2003 08:07:33 -0000      1.56
  +++ DirectoryScanner.java     23 Jul 2003 08:09:01 -0000      1.57
  @@ -682,81 +682,85 @@
           } else {
               // only scan directories that can include matched files or
               // directories
  -        Enumeration enum2 = newroots.keys();
  +            Enumeration enum2 = newroots.keys();
   
  -        File canonBase = null;
  -        try {
  -            canonBase = basedir.getCanonicalFile();
  -        } catch (IOException ex) {
  -            throw new BuildException(ex);
  -        }
  +            File canonBase = null;
  +            try {
  +                canonBase = basedir.getCanonicalFile();
  +            } catch (IOException ex) {
  +                throw new BuildException(ex);
  +            }
   
  -        while (enum2.hasMoreElements()) {
  -            String currentelement = (String) enum2.nextElement();
  -            String originalpattern = (String) newroots.get(currentelement);
  -            File myfile = new File(basedir, currentelement);
  +            while (enum2.hasMoreElements()) {
  +                String currentelement = (String) enum2.nextElement();
  +                String originalpattern = (String) 
newroots.get(currentelement);
  +                File myfile = new File(basedir, currentelement);
   
  -            if (myfile.exists()) {
  -                // may be on a case insensitive file system.  We want
  -                // the results to show what's really on the disk, so
  -                // we need to double check.
  -                try {
  -                    File canonFile = myfile.getCanonicalFile();
  -                    String path = fileUtils.removeLeadingPath(canonBase,
  -                                                              canonFile);
  -                    if (!path.equals(currentelement)) {
  -                        myfile = findFile(basedir, currentelement);
  -                        if (myfile != null) {
  -                            currentelement = 
  -                                fileUtils.removeLeadingPath(basedir, myfile);
  +                if (myfile.exists()) {
  +                    // may be on a case insensitive file system.  We want
  +                    // the results to show what's really on the disk, so
  +                    // we need to double check.
  +                    try {
  +                        File canonFile = myfile.getCanonicalFile();
  +                        String path = fileUtils.removeLeadingPath(canonBase,
  +                                                                  canonFile);
  +                        if (!path.equals(currentelement)) {
  +                            myfile = findFile(basedir, currentelement);
  +                            if (myfile != null) {
  +                                currentelement = 
  +                                    fileUtils.removeLeadingPath(basedir,
  +                                                                myfile);
  +                            }
                           }
  +                    } catch (IOException ex) {
  +                        throw new BuildException(ex);
                       }
  -                } catch (IOException ex) {
  -                    throw new BuildException(ex);
                   }
  -            }
               
  -            if ((myfile == null || !myfile.exists()) && !isCaseSensitive) {
  -                File f = findFileCaseInsensitive(basedir, currentelement);
  -                if (f.exists()) {
  -                    // adapt currentelement to the case we've actually found
  -                    currentelement = fileUtils.removeLeadingPath(basedir,
  -                                                                 f);
  -                    myfile = f;
  +                if ((myfile == null || !myfile.exists()) && 
!isCaseSensitive) {
  +                    File f = findFileCaseInsensitive(basedir, 
currentelement);
  +                    if (f.exists()) {
  +                        // adapt currentelement to the case we've
  +                        // actually found
  +                        currentelement = fileUtils.removeLeadingPath(basedir,
  +                                                                     f);
  +                        myfile = f;
  +                    }
                   }
  -            }
   
  -            if (myfile != null && myfile.exists()) {
  -                if (!followSymlinks && isSymlink(basedir, currentelement)) {
  -                    continue;
  -                }
  +                if (myfile != null && myfile.exists()) {
  +                    if (!followSymlinks 
  +                        && isSymlink(basedir, currentelement)) {
  +                        continue;
  +                    }
   
  -                if (myfile.isDirectory()) {
  -                    if (isIncluded(currentelement)
  -                        && currentelement.length() > 0) {
  -                        accountForIncludedDir(currentelement, myfile, true);
  -                    }  else {
  -                        if (currentelement.length() > 0) {
  -                            if (currentelement.charAt(currentelement.length()
  -                                                      - 1)
  -                                != File.separatorChar) {
  -                                currentelement =
  -                                    currentelement + File.separatorChar;
  +                    if (myfile.isDirectory()) {
  +                        if (isIncluded(currentelement)
  +                            && currentelement.length() > 0) {
  +                            accountForIncludedDir(currentelement, myfile, 
true);
  +                        }  else {
  +                            if (currentelement.length() > 0) {
  +                                if (currentelement.charAt(currentelement
  +                                                          .length() - 1)
  +                                    != File.separatorChar) {
  +                                    currentelement =
  +                                        currentelement + File.separatorChar;
  +                                }
                               }
  +                            scandir(myfile, currentelement, true);
  +                        }
  +                    } else {
  +                        if (isCaseSensitive
  +                            && originalpattern.equals(currentelement)) {
  +                            accountForIncludedFile(currentelement, myfile);
  +                        } else if (!isCaseSensitive
  +                                   && originalpattern
  +                                   .equalsIgnoreCase(currentelement)) {
  +                            accountForIncludedFile(currentelement, myfile);
                           }
  -                        scandir(myfile, currentelement, true);
  -                    }
  -                } else {
  -                    if (isCaseSensitive
  -                        && originalpattern.equals(currentelement)) {
  -                        accountForIncludedFile(currentelement, myfile);
  -                    } else if (!isCaseSensitive
  -                        && originalpattern.equalsIgnoreCase(currentelement)) 
{
  -                        accountForIncludedFile(currentelement, myfile);
                       }
                   }
               }
  -        }
           }
       }
   
  
  
  

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

Reply via email to