commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: svn commit: r1586293 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
Date Thu, 10 Apr 2014 18:41:44 GMT
Nice!


2014-04-10 15:15 GMT+02:00 <ggregory@apache.org>:

> Author: ggregory
> Date: Thu Apr 10 13:15:20 2014
> New Revision: 1586293
>
> URL: http://svn.apache.org/r1586293
> Log:
> Refactor magic number into constant.
>
> Modified:
>
> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
>
> Modified:
> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java?rev=1586293&r1=1586292&r2=1586293&view=diff
>
> ==============================================================================
> ---
> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
> (original)
> +++
> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
> Thu Apr 10 13:15:20 2014
> @@ -26,6 +26,8 @@ package org.apache.commons.lang3;
>   */
>  public class CharSequenceUtils {
>
> +    private static final int NOT_FOUND = -1;
> +
>      /**
>       * <p>{@code CharSequenceUtils} instances should NOT be constructed in
>       * standard programming. </p>
> @@ -79,7 +81,7 @@ public class CharSequenceUtils {
>                  return i;
>              }
>          }
> -        return -1;
> +        return NOT_FOUND;
>      }
>
>      /**
> @@ -118,7 +120,7 @@ public class CharSequenceUtils {
>          }
>          final int sz = cs.length();
>          if (start < 0) {
> -            return -1;
> +            return NOT_FOUND;
>          }
>          if (start >= sz) {
>              start = sz - 1;
> @@ -128,7 +130,7 @@ public class CharSequenceUtils {
>                  return i;
>              }
>          }
> -        return -1;
> +        return NOT_FOUND;
>      }
>
>      /**
>
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message