commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1649038 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
Date Fri, 02 Jan 2015 14:17:49 GMT
Author: sebb
Date: Fri Jan  2 14:17:48 2015
New Revision: 1649038

URL: http://svn.apache.org/r1649038
Log:
https://issues.apache.org/jira/browse/VALIDATOR-307
Replace String.isEmpty() with Java 1.4 compatible code

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java?rev=1649038&r1=1649037&r2=1649038&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
Fri Jan  2 14:17:48 2015
@@ -82,7 +82,7 @@ public class InetAddressValidator implem
         // verify that address subgroups are legal
         for (int i = 0; i <= 3; i++) {
             String ipSegment = groups[i];
-            if (ipSegment == null || ipSegment.isEmpty()) {
+            if (ipSegment == null || ipSegment.length() == 0) {
                 return false;
             }
 
@@ -139,7 +139,7 @@ public class InetAddressValidator implem
         int emptyOctets = 0;
         for (int index = 0; index < octets.length; index++) {
             String octet = (String) octets[index];
-            if (octet.isEmpty()) {
+            if (octet.length() == 0) {
                 emptyOctets++;
                 if (emptyOctets > 1) {
                     return false;



Mime
View raw message