ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r419143 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
Date Wed, 05 Jul 2006 03:15:23 GMT
Author: kevj
Date: Tue Jul  4 20:15:22 2006
New Revision: 419143

URL: http://svn.apache.org/viewvc?rev=419143&view=rev
Log:
move validation of properties into private method

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=419143&r1=419142&r2=419143&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Tue Jul  4 20:15:22
2006
@@ -275,7 +275,29 @@
      */
     public void execute() throws BuildException {
         // first off, make sure that we've got a srcdir and destdir
+        validate();
+        
+        // log options used
+        String enc = encoding == null ? "default" : encoding;
+        log("options:"
+            + " eol=" + filter.getEol().getValue()
+            + " tab=" + filter.getTab().getValue()
+            + " eof=" + filter.getEof().getValue()
+            + " tablength=" + filter.getTablength()
+            + " encoding=" + enc
+            + " outputencoding="
+            + (outputEncoding == null ? enc : outputEncoding),
+            Project.MSG_VERBOSE);
+
+        DirectoryScanner ds = super.getDirectoryScanner(srcDir);
+        String[] files = ds.getIncludedFiles();
+
+        for (int i = 0; i < files.length; i++) {
+            processFile(files[i]);
+        }
+    }
 
+    private void validate() throws BuildException {
         if (file != null) {
             if (srcDir != null) {
                 throw new BuildException(ERROR_FILE_AND_SRCDIR);
@@ -302,26 +324,8 @@
                 throw new BuildException("destdir is not a directory!");
             }
         }
-        // log options used
-        String enc = encoding == null ? "default" : encoding;
-        log("options:"
-            + " eol=" + filter.getEol().getValue()
-            + " tab=" + filter.getTab().getValue()
-            + " eof=" + filter.getEof().getValue()
-            + " tablength=" + filter.getTablength()
-            + " encoding=" + enc
-            + " outputencoding="
-            + (outputEncoding == null ? enc : outputEncoding),
-            Project.MSG_VERBOSE);
-
-        DirectoryScanner ds = super.getDirectoryScanner(srcDir);
-        String[] files = ds.getIncludedFiles();
-
-        for (int i = 0; i < files.length; i++) {
-            processFile(files[i]);
-        }
     }
-
+    
     private void processFile(String file) throws BuildException {
         File srcFile = new File(srcDir, file);
         long lastModified = srcFile.lastModified();



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


Mime
View raw message