ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r579953 - in /ant/core/trunk/src/main/org/apache/tools/ant/util: FileUtils.java UUEncoder.java
Date Thu, 27 Sep 2007 09:11:21 GMT
Author: peterreilly
Date: Thu Sep 27 02:11:21 2007
New Revision: 579953

URL: http://svn.apache.org/viewvc?rev=579953&view=rev
Log:
magicnumbers

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/UUEncoder.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?rev=579953&r1=579952&r2=579953&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Thu Sep 27 02:11:21 2007
@@ -54,7 +54,7 @@
  *
  */
 public class FileUtils {
-
+    private static final int EXPAND_SPACE = 50;
     private static final FileUtils PRIMARY_INSTANCE = new FileUtils();
 
     //get some non-crypto-grade randomness from various places.
@@ -578,9 +578,11 @@
             return (c == sep);
         }
         if (c == sep) {
+            // CheckStyle:MagicNumber OFF
             if (!(ON_DOS && len > 4 && filename.charAt(1) == sep)) {
                 return false;
             }
+            // CheckStyle:MagicNumber ON
             int nextsep = filename.indexOf(sep, 2);
             return nextsep > 2 && nextsep + 1 < len;
         }
@@ -611,7 +613,7 @@
         if (toProcess == null || toProcess.length() == 0) {
             return "";
         }
-        StringBuffer path = new StringBuffer(toProcess.length() + 50);
+        StringBuffer path = new StringBuffer(toProcess.length() + EXPAND_SPACE);
         PathTokenizer tokenizer = new PathTokenizer(toProcess);
         while (tokenizer.hasMoreTokens()) {
             String pathComponent = tokenizer.nextToken();
@@ -740,9 +742,10 @@
         String name = f.getName();
         boolean isAbsolute = path.charAt(0) == File.separatorChar;
         // treat directories specified using .DIR syntax as files
+        // CheckStyle:MagicNumber OFF
         boolean isDirectory = f.isDirectory()
                 && !name.regionMatches(true, name.length() - 4, ".DIR", 0, 4);
-
+        // CheckStyle:MagicNumber ON
         String device = null;
         StringBuffer directory = null;
         String file = null;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/UUEncoder.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/UUEncoder.java?rev=579953&r1=579952&r2=579953&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/UUEncoder.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/UUEncoder.java Thu Sep 27 02:11:21 2007
@@ -109,7 +109,9 @@
         byte[] data, int offset, int length, OutputStream out)
         throws IOException {
         // write out the number of characters encoded in this line.
+        // CheckStyle:MagicNumber OFF
         out.write((byte) ((length & 0x3F) + ' '));
+        // CheckStyle:MagicNumber ON
         byte a;
         byte b;
         byte c;



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


Mime
View raw message