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:
parent
4eb70a5f43
commit
3efd6ccdbf
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue