Refactor magic number into constant.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1586293 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2014-04-10 13:15:20 +00:00
parent 4eb70a5f43
commit 3efd6ccdbf
1 changed files with 5 additions and 3 deletions

View File

@ -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;
}
/**