commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1648867 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
Date Thu, 01 Jan 2015 16:16:39 GMT
Author: britter
Date: Thu Jan  1 16:16:39 2015
New Revision: 1648867

URL: http://svn.apache.org/r1648867
Log:
PMD: Combine nested if statements

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=1648867&r1=1648866&r2=1648867&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
Thu Jan  1 16:16:39 2015
@@ -127,11 +127,8 @@ public class InetAddressValidator implem
             if (inet6Address.endsWith("::")) {
                 // String.split() drops ending empty segments
                 octetList.add("");
-            } else if (inet6Address.startsWith("::")) {
-                // String.split() adds beginning empty segments
-                if (!octetList.isEmpty()) {
-                    octetList.remove(0);
-                }
+            } else if (inet6Address.startsWith("::") && !octetList.isEmpty()) {
+                octetList.remove(0);
             }
             octets = octetList.toArray();
         }



Mime
View raw message