ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r703546 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
Date Fri, 10 Oct 2008 18:22:02 GMT
Author: mbenson
Date: Fri Oct 10 11:22:02 2008
New Revision: 703546

URL: http://svn.apache.org/viewvc?rev=703546&view=rev
Log:
small refactorings

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java?rev=703546&r1=703545&r2=703546&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Fri Oct 10 11:22:02
2008
@@ -548,8 +548,7 @@
                 }
             }
         }
-        String[] targetFiles = new String[targets.size()];
-        targets.copyInto(targetFiles);
+        String[] targetFiles = (String[]) targets.toArray(new String[targets.size()]);
 
         if (!addSourceFile) {
             srcFiles = new String[0];
@@ -617,16 +616,16 @@
         }
         // fill in source file names
         for (int i = 0; i < srcFiles.length; i++) {
-            if (!relative) {
-                result[srcIndex + i] =
-                    (new File(baseDirs[i], srcFiles[i])).getAbsolutePath();
+            String src;
+            if (relative) {
+                src = srcFiles[i];
             } else {
-                result[srcIndex + i] = srcFiles[i];
+                src = new File(baseDirs[i], srcFiles[i]).getAbsolutePath();
             }
             if (forwardSlash && fileSeparator != '/') {
-                result[srcIndex + i] =
-                    result[srcIndex + i].replace(fileSeparator, '/');
+                src = src.replace(fileSeparator, '/');
             }
+            result[srcIndex + i] = src;
         }
         return result;
     }
@@ -752,4 +751,5 @@
             return new String[] {FILE, DIR, "both"};
         }
     }
+
 }



Mime
View raw message