You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Adrian Crum <ad...@sandglass-software.com> on 2015/01/02 16:07:29 UTC

Re: svn commit: r1649038 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java

Thank you for fixing that. I had my IDE set for Java 1.4 but somehow it 
let me use that method anyway.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 1/2/2015 6:17 AM, sebb@apache.org wrote:
> 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;
>
>

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


Re: svn commit: r1649038 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java

Posted by sebb <se...@gmail.com>.
On 2 January 2015 at 15:07, Adrian Crum
<ad...@sandglass-software.com> wrote:
> Thank you for fixing that. I had my IDE set for Java 1.4 but somehow it let
> me use that method anyway.

That setting only applies to the source and binary format.
It will complain about generics etc. but not library additions.

In order to check for newer APIs you have to compile against the
appropriate Java jars.

> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
>
> On 1/2/2015 6:17 AM, sebb@apache.org wrote:
>>
>> 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;
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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