Repository: ant
Updated Branches:
  refs/heads/master cda6c91cf -> 30f52135a


http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/types/spi/Service.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/spi/Service.java 
b/src/main/org/apache/tools/ant/types/spi/Service.java
index 064bd08..7d7c8a2 100644
--- a/src/main/org/apache/tools/ant/types/spi/Service.java
+++ b/src/main/org/apache/tools/ant/types/spi/Service.java
@@ -96,7 +96,7 @@ public class Service extends ProjectComponent {
                 "type attribute must be set for service element",
                 getLocation());
         }
-        if (type.length() == 0) {
+        if (type.isEmpty()) {
             throw new BuildException(
                 "Invalid empty type classname", getLocation());
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/util/DOMElementWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java 
b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
index 0104c34..d0cef7c 100644
--- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java
+++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
@@ -248,7 +248,7 @@ public class DOMElementWriter {
                     out.write("<?");
                     out.write(child.getNodeName());
                     String data = child.getNodeValue();
-                    if (data != null && data.length() > 0) {
+                    if (data != null && !data.isEmpty()) {
                         out.write(' ');
                         out.write(data);
                     }
@@ -398,7 +398,7 @@ public class DOMElementWriter {
         if (namespacePolicy.qualifyElements) {
             String uri = getNamespaceURI(element);
             String prefix = nsPrefixMap.get(uri);
-            if (prefix != null && !"".equals(prefix)) {
+            if (prefix != null && !prefix.isEmpty()) {
                 out.write(prefix);
                 out.write(":");
             }

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/util/DeweyDecimal.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DeweyDecimal.java 
b/src/main/org/apache/tools/ant/util/DeweyDecimal.java
index 32564fd..d9a28e8 100644
--- a/src/main/org/apache/tools/ant/util/DeweyDecimal.java
+++ b/src/main/org/apache/tools/ant/util/DeweyDecimal.java
@@ -60,7 +60,7 @@ public class DeweyDecimal implements Comparable<DeweyDecimal> 
{
 
         for (int i = 0; i < components.length; i++) {
             final String component = tokenizer.nextToken();
-            if (component.length() == 0) {
+            if (component.isEmpty()) {
                 throw new NumberFormatException("Empty component in string");
             }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java 
b/src/main/org/apache/tools/ant/util/FileUtils.java
index af76942..541353c 100644
--- a/src/main/org/apache/tools/ant/util/FileUtils.java
+++ b/src/main/org/apache/tools/ant/util/FileUtils.java
@@ -634,7 +634,7 @@ public class FileUtils {
      * @since Ant 1.7
      */
     public static boolean isContextRelativePath(String filename) {
-        if (!(ON_DOS || ON_NETWARE) || filename.length() == 0) {
+        if (!(ON_DOS || ON_NETWARE) || filename.isEmpty()) {
             return false;
         }
         char sep = File.separatorChar;
@@ -658,10 +658,10 @@ public class FileUtils {
      * @since Ant 1.6.3
      */
     public static boolean isAbsolutePath(String filename) {
-        int len = filename.length();
-        if (len == 0) {
+        if (filename.isEmpty()) {
             return false;
         }
+        int len = filename.length();
         char sep = File.separatorChar;
         filename = filename.replace('/', sep).replace('\\', sep);
         char c = filename.charAt(0);

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java 
b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
index f1031e1..2ace4d4 100644
--- a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
+++ b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
@@ -353,7 +353,7 @@ public class LayoutPreservingProperties extends Properties {
                 LogicalLine line;
                 if (comment) {
                     line = new Comment(logicalLineBuffer.toString());
-                } else if (logicalLineBuffer.toString().trim().length() == 0) {
+                } else if (logicalLineBuffer.toString().trim().isEmpty()) {
                     line = new Blank();
                 } else {
                     line = new Pair(logicalLineBuffer.toString());

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/ant/util/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/ResourceUtils.java 
b/src/main/org/apache/tools/ant/util/ResourceUtils.java
index 741ff60..f1114e7 100644
--- a/src/main/org/apache/tools/ant/util/ResourceUtils.java
+++ b/src/main/org/apache/tools/ant/util/ResourceUtils.java
@@ -657,7 +657,7 @@ public class ResourceUtils {
             lineTokenizer.setIncludeDelims(true);
             String line = lineTokenizer.getToken(in);
             while (line != null) {
-                if (line.length() == 0) {
+                if (line.isEmpty()) {
                     // this should not happen, because the lines are
                     // returned with the end of line delimiter
                     out.newLine();

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/tar/TarEntry.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarEntry.java 
b/src/main/org/apache/tools/tar/TarEntry.java
index feae109..f706a64 100644
--- a/src/main/org/apache/tools/tar/TarEntry.java
+++ b/src/main/org/apache/tools/tar/TarEntry.java
@@ -995,7 +995,7 @@ public class TarEntry implements TarConstants {
                 if (isDirectory() && !name.endsWith("/")) {
                     name += "/";
                 }
-                if (prefix.length() > 0) {
+                if (!prefix.isEmpty()) {
                     name = prefix + "/" + name;
                 }
             }

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/tar/TarOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarOutputStream.java 
b/src/main/org/apache/tools/tar/TarOutputStream.java
index 7e92d7a..2802e95 100644
--- a/src/main/org/apache/tools/tar/TarOutputStream.java
+++ b/src/main/org/apache/tools/tar/TarOutputStream.java
@@ -288,7 +288,7 @@ public class TarOutputStream extends FilterOutputStream {
                                                        
TarConstants.LF_GNUTYPE_LONGNAME, "file name");
 
         final String linkName = entry.getLinkName();
-        boolean paxHeaderContainsLinkPath = linkName != null && 
linkName.length() > 0
+        boolean paxHeaderContainsLinkPath = linkName != null && 
!linkName.isEmpty()
             && handleLongName(entry, linkName, paxHeaders, "linkpath",
                               TarConstants.LF_GNUTYPE_LONGLINK, "link name");
 

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/main/org/apache/tools/zip/AsiExtraField.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/AsiExtraField.java 
b/src/main/org/apache/tools/zip/AsiExtraField.java
index 0108ee2..9b1cb24 100644
--- a/src/main/org/apache/tools/zip/AsiExtraField.java
+++ b/src/main/org/apache/tools/zip/AsiExtraField.java
@@ -241,7 +241,7 @@ public class AsiExtraField implements ZipExtraField, 
UnixStat, Cloneable {
      * @since 1.1
      */
     public boolean isLink() {
-        return getLinkedFile().length() != 0;
+        return !getLinkedFile().isEmpty();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java 
b/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
index 6636615..7d82670 100644
--- a/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
+++ b/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
@@ -265,7 +265,7 @@ public class TokenFilterTest {
 
     public static class Capitalize implements TokenFilter.Filter {
         public String filter(String token) {
-            if (token.length() == 0) {
+            if (token.isEmpty()) {
                 return token;
             }
             return token.substring(0, 1).toUpperCase() + token.substring(1);

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
b/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
index 24cd1ef..b4e1e9b 100644
--- a/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
@@ -65,7 +65,7 @@ public class LocatorTest {
      * @param enabled is the test enabled?
      */
     private void assertResolved(String uri, String expectedResult, String 
result, boolean enabled) {
-        if (enabled && expectedResult != null && expectedResult.length() > 0) {
+        if (enabled && expectedResult != null && !expectedResult.isEmpty()) {
             assertEquals("Expected " + uri + " to resolve to \n" + 
expectedResult + "\n but got\n"
                     + result + "\n", expectedResult, result);
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
index f261289..e7905af 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
@@ -302,7 +302,7 @@ public class CopyTest {
         try (BufferedReader reader = new BufferedReader(new 
FileReader(srcFile))) {
             originalContent = FileUtils.readFully(reader);
         }
-        assertTrue("Content missing in file " + srcFile, originalContent != 
null && originalContent.length() > 0);
+        assertTrue("Content missing in file " + srcFile, originalContent != 
null && !originalContent.isEmpty());
 
         // run the copy tests
         buildRule.executeTarget("testSelfCopy");

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java
index e5e3b2f..9fad648 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java
@@ -54,7 +54,7 @@ public class DemuxOutputTask extends Task {
 
     protected void handleOutput(String line) {
         line = line.trim();
-        if (line.length() != 0 && !line.equals(randomOutValue)) {
+        if (!line.isEmpty() && !line.equals(randomOutValue)) {
             String message = "Received = [" + line + "], expected = ["
                 + randomOutValue + "]";
             throw new BuildException(message);
@@ -64,7 +64,7 @@ public class DemuxOutputTask extends Task {
 
     protected void handleErrorOutput(String line) {
         line = line.trim();
-        if (line.length() != 0 && !line.equals(randomErrValue)) {
+        if (!line.isEmpty() && !line.equals(randomErrValue)) {
             String message = "Received = [" + line + "], expected = ["
                 + randomErrValue + "]";
             throw new BuildException(message);

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
index 80a4ac3..25c5231 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
@@ -87,7 +87,7 @@ public class ExecuteWatchdogTest {
         int retcode = p.waitFor();
         if (retcode != 0) {
             String err = getErrorOutput(p);
-            if (err.length() > 0) {
+            if (!err.isEmpty()) {
                 System.err.println("ERROR:");
                 System.err.println(err);
             }

http://git-wip-us.apache.org/repos/asf/ant/blob/30f52135/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java 
b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
index 3bdede4..c44c8f9 100644
--- a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
@@ -608,7 +608,7 @@ public class FileUtilsTest {
      */
     private void assertEqualsIgnoreDriveCase(String s1, String s2) {
         if ((Os.isFamily("dos") || Os.isFamily("netware"))
-            && s1.length() > 0 && s2.length() > 0) {
+            && !s1.isEmpty() && !s2.isEmpty()) {
             StringBuilder sb1 = new StringBuilder(s1);
             StringBuilder sb2 = new StringBuilder(s2);
             sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));

Reply via email to