ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r910955 [2/2] - in /ant/core/trunk/src/main/org/apache/tools: ant/ ant/helper/ ant/launch/ ant/taskdefs/ ant/taskdefs/compilers/ ant/taskdefs/condition/ ant/taskdefs/email/ ant/taskdefs/optional/ejb/ ant/taskdefs/optional/image/ ant/taskdef...
Date Wed, 17 Feb 2010 12:58:52 GMT
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java Wed Feb
17 12:58:50 2010
@@ -19,6 +19,7 @@
 package org.apache.tools.ant.types.selectors;
 
 import java.io.File;
+import java.util.Locale;
 
 import org.apache.tools.ant.types.Comparison;
 import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -169,18 +170,21 @@
         if (parameters != null) {
             for (int i = 0; i < parameters.length; i++) {
                 String paramname = parameters[i].getName();
-                if (SIZE_KEY.equalsIgnoreCase(paramname)) {
+                if (paramname != null) {
+                    paramname = paramname.toLowerCase(Locale.ENGLISH);
+                }
+                if (SIZE_KEY.equals(paramname)) {
                     try {
                         setValue(Long.parseLong(parameters[i].getValue()));
                     } catch (NumberFormatException nfe) {
                         setError("Invalid size setting "
                                 + parameters[i].getValue());
                     }
-                } else if (UNITS_KEY.equalsIgnoreCase(paramname)) {
+                } else if (UNITS_KEY.equals(paramname)) {
                     ByteUnits units = new ByteUnits();
                     units.setValue(parameters[i].getValue());
                     setUnits(units);
-                } else if (WHEN_KEY.equalsIgnoreCase(paramname)) {
+                } else if (WHEN_KEY.equals(paramname)) {
                     SizeComparisons scmp = new SizeComparisons();
                     scmp.setValue(parameters[i].getValue());
                     setWhen(scmp);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java Wed Feb
17 12:58:50 2010
@@ -19,6 +19,7 @@
 package org.apache.tools.ant.types.selectors;
 
 import java.io.File;
+import java.util.Locale;
 
 import org.apache.tools.ant.types.EnumeratedAttribute;
 import org.apache.tools.ant.types.Parameter;
@@ -71,7 +72,10 @@
         if (parameters != null) {
             for (int i = 0; i < parameters.length; i++) {
                 String paramname = parameters[i].getName();
-                if (TYPE_KEY.equalsIgnoreCase(paramname)) {
+                if (paramname != null) {
+                    paramname = paramname.toLowerCase(Locale.ENGLISH);
+                }
+                if (TYPE_KEY.equals(paramname)) {
                     FileType t = new FileType();
                     t.setValue(parameters[i].getValue());
                     setType(t);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ChecksumAlgorithm.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ChecksumAlgorithm.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ChecksumAlgorithm.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ChecksumAlgorithm.java
Wed Feb 17 12:58:50 2010
@@ -18,7 +18,7 @@
 
 package org.apache.tools.ant.types.selectors.modifiedselector;
 
-
+import java.util.Locale;
 import java.util.zip.Checksum;
 import java.util.zip.CRC32;
 import java.util.zip.Adler32;
@@ -76,7 +76,8 @@
      * @param algorithm the digest algorithm to use
      */
     public void setAlgorithm(String algorithm) {
-        this.algorithm = algorithm;
+        this.algorithm =
+            algorithm != null ? algorithm.toUpperCase(Locale.ENGLISH) : null;
     }
 
 
@@ -85,9 +86,9 @@
         if (checksum != null) {
             return;
         }
-        if ("CRC".equalsIgnoreCase(algorithm)) {
+        if ("CRC".equals(algorithm)) {
             checksum = new CRC32();
-        } else if ("ADLER".equalsIgnoreCase(algorithm)) {
+        } else if ("ADLER".equals(algorithm)) {
             checksum = new Adler32();
         } else {
             throw new BuildException(new NoSuchAlgorithmException());
@@ -103,7 +104,7 @@
      * @return <i>true</i> if all is ok, otherwise <i>false</i>.
      */
     public boolean isValid() {
-        return "CRC".equalsIgnoreCase(algorithm) || "ADLER".equalsIgnoreCase(algorithm);
+        return "CRC".equals(algorithm) || "ADLER".equals(algorithm);
     }
 
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java
Wed Feb 17 12:58:50 2010
@@ -21,6 +21,7 @@
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.util.Locale;
 import java.security.DigestInputStream;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -92,7 +93,8 @@
      * @param algorithm the digest algorithm to use
      */
     public void setAlgorithm(String algorithm) {
-        this.algorithm = algorithm;
+        this.algorithm = algorithm != null
+            ? algorithm.toUpperCase(Locale.ENGLISH) : null;
     }
 
 
@@ -138,7 +140,7 @@
      * @return <i>true</i> if all is ok, otherwise <i>false</i>.
      */
     public boolean isValid() {
-        return "SHA".equalsIgnoreCase(algorithm) || "MD5".equalsIgnoreCase(algorithm);
+        return "SHA".equals(algorithm) || "MD5".equals(algorithm);
     }
 
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
Wed Feb 17 12:58:50 2010
@@ -20,10 +20,11 @@
 
 
 // Java
+import java.io.File;
 import java.util.Comparator;
-import java.util.Vector;
 import java.util.Iterator;
-import java.io.File;
+import java.util.Locale;
+import java.util.Vector;
 
 // Ant
 import org.apache.tools.ant.Project;
@@ -720,6 +721,8 @@
     public void useParameter(Parameter parameter) {
         String key = parameter.getName();
         String value = parameter.getValue();
+        String valueLC =
+            value != null ? value.toLowerCase(Locale.ENGLISH) : null;
         if ("cache".equals(key)) {
             CacheName cn = new CacheName();
             cn.setValue(value);
@@ -734,19 +737,19 @@
             setComparator(cn);
         } else if ("update".equals(key)) {
             boolean updateValue =
-                ("true".equalsIgnoreCase(value))
+                ("true".equals(valueLC))
                 ? true
                 : false;
             setUpdate(updateValue);
         } else if ("delayupdate".equals(key)) {
             boolean updateValue =
-                ("true".equalsIgnoreCase(value))
+                ("true".equals(valueLC))
                 ? true
                 : false;
             setDelayUpdate(updateValue);
         } else if ("seldirs".equals(key)) {
             boolean sdValue =
-                ("true".equalsIgnoreCase(value))
+                ("true".equals(valueLC))
                 ? true
                 : false;
             setSeldirs(sdValue);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java Wed Feb 17
12:58:50 2010
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
+import java.util.Locale;
 
 import org.apache.tools.ant.ProjectComponent;
 import org.apache.tools.ant.Task;
@@ -86,7 +87,11 @@
         try {
             result = super.read();
         } catch (IOException eyeOhEx) {
-            if ("write end dead".equalsIgnoreCase(eyeOhEx.getMessage())) {
+            String msg = eyeOhEx.getMessage();
+            if (msg != null) {
+                msg = msg.toLowerCase(Locale.ENGLISH);
+            }
+            if ("write end dead".equals(msg)) {
                 if (super.in > 0 && super.out < super.buffer.length
                     && super.out > super.in) {
                     result = super.buffer[super.out++] & BYTE_MASK;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java Wed
Feb 17 12:58:50 2010
@@ -20,8 +20,8 @@
 
 import org.apache.tools.ant.BuildException;
 
-
 import java.util.Iterator;
+import java.util.Locale;
 import org.apache.tools.ant.util.ScriptRunnerBase;
 import org.apache.tools.ant.util.ReflectUtil;
 import org.apache.tools.ant.util.ReflectWrapper;
@@ -90,7 +90,7 @@
             for (Iterator i = getBeans().keySet().iterator(); i.hasNext();) {
                 String key = (String) i.next();
                 Object value = getBeans().get(key);
-                if ("FX".equalsIgnoreCase(getLanguage())) {
+                if ("FX".equals(getLanguage().toUpperCase(Locale.ENGLISH))) {
                     engine.invoke(
                         "put", String.class, key
                         + ":" + value.getClass().getName(),

Modified: ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java?rev=910955&r1=910954&r2=910955&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java Wed Feb 17 12:58:50 2010
@@ -625,7 +625,7 @@
      */
     private static String normalizeFileName(String fileName,
                                             boolean preserveLeadingSlashes) {
-        String osname = System.getProperty("os.name").toLowerCase(Locale.US);
+        String osname = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
 
         if (osname != null) {
 



Mime
View raw message