mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-28 21:19:06 +00:00
Genericize; remove invalid Javadoc reference
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@754682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ebfe3a9c1d
commit
c06b74202d
@ -1989,7 +1989,7 @@ public static String[] substringsBetween(String str, String open, String close)
|
||||
}
|
||||
int closeLen = close.length();
|
||||
int openLen = open.length();
|
||||
List list = new ArrayList();
|
||||
List<String> list = new ArrayList<String>();
|
||||
int pos = 0;
|
||||
while (pos < (strLen - closeLen)) {
|
||||
int start = str.indexOf(open, pos);
|
||||
@ -2007,7 +2007,7 @@ public static String[] substringsBetween(String str, String open, String close)
|
||||
if (list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String[]) list.toArray(new String [list.size()]);
|
||||
return list.toArray(new String [list.size()]);
|
||||
}
|
||||
|
||||
// Nested extraction
|
||||
@ -2286,7 +2286,7 @@ private static String[] splitByWholeSeparatorWorker(String str, String separator
|
||||
|
||||
int separatorLength = separator.length();
|
||||
|
||||
ArrayList substrings = new ArrayList();
|
||||
ArrayList<String> substrings = new ArrayList<String>();
|
||||
int numberOfSubstrings = 0;
|
||||
int beg = 0;
|
||||
int end = 0;
|
||||
@ -2330,7 +2330,7 @@ private static String[] splitByWholeSeparatorWorker(String str, String separator
|
||||
}
|
||||
}
|
||||
|
||||
return (String[]) substrings.toArray(new String[substrings.size()]);
|
||||
return substrings.toArray(new String[substrings.size()]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@ -2420,7 +2420,7 @@ private static String[] splitWorker(String str, char separatorChar, boolean pres
|
||||
if (len == 0) {
|
||||
return ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
}
|
||||
List list = new ArrayList();
|
||||
List<String> list = new ArrayList<String>();
|
||||
int i = 0, start = 0;
|
||||
boolean match = false;
|
||||
boolean lastMatch = false;
|
||||
@ -2441,7 +2441,7 @@ private static String[] splitWorker(String str, char separatorChar, boolean pres
|
||||
if (match || (preserveAllTokens && lastMatch)) {
|
||||
list.add(str.substring(start, i));
|
||||
}
|
||||
return (String[]) list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2547,7 +2547,7 @@ private static String[] splitWorker(String str, String separatorChars, int max,
|
||||
if (len == 0) {
|
||||
return ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
}
|
||||
List list = new ArrayList();
|
||||
List<String> list = new ArrayList<String>();
|
||||
int sizePlus1 = 1;
|
||||
int i = 0, start = 0;
|
||||
boolean match = false;
|
||||
@ -2617,7 +2617,7 @@ private static String[] splitWorker(String str, String separatorChars, int max,
|
||||
if (match || (preserveAllTokens && lastMatch)) {
|
||||
list.add(str.substring(start, i));
|
||||
}
|
||||
return (String[]) list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2693,7 +2693,7 @@ private static String[] splitByCharacterType(String str, boolean camelCase) {
|
||||
return ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
}
|
||||
char[] c = str.toCharArray();
|
||||
List list = new ArrayList();
|
||||
List<String> list = new ArrayList<String>();
|
||||
int tokenStart = 0;
|
||||
int currentType = Character.getType(c[tokenStart]);
|
||||
for (int pos = tokenStart + 1; pos < c.length; pos++) {
|
||||
@ -2714,7 +2714,7 @@ private static String[] splitByCharacterType(String str, boolean camelCase) {
|
||||
currentType = type;
|
||||
}
|
||||
list.add(new String(c, tokenStart, c.length - tokenStart));
|
||||
return (String[]) list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
|
||||
// Joining
|
||||
@ -2925,7 +2925,7 @@ public static String join(Object[] array, String separator, int startIndex, int
|
||||
* @return the joined String, <code>null</code> if null iterator input
|
||||
* @since 2.0
|
||||
*/
|
||||
public static String join(Iterator iterator, char separator) {
|
||||
public static String join(Iterator<?> iterator, char separator) {
|
||||
|
||||
// handle null, zero and one elements before building a buffer
|
||||
if (iterator == null) {
|
||||
@ -2969,7 +2969,7 @@ public static String join(Iterator iterator, char separator) {
|
||||
* @param separator the separator character to use, null treated as ""
|
||||
* @return the joined String, <code>null</code> if null iterator input
|
||||
*/
|
||||
public static String join(Iterator iterator, String separator) {
|
||||
public static String join(Iterator<?> iterator, String separator) {
|
||||
|
||||
// handle null, zero and one elements before building a buffer
|
||||
if (iterator == null) {
|
||||
@ -3015,7 +3015,7 @@ public static String join(Iterator iterator, String separator) {
|
||||
* @return the joined String, <code>null</code> if null iterator input
|
||||
* @since 2.3
|
||||
*/
|
||||
public static String join(Collection collection, char separator) {
|
||||
public static String join(Collection<?> collection, char separator) {
|
||||
if (collection == null) {
|
||||
return null;
|
||||
}
|
||||
@ -3036,7 +3036,7 @@ public static String join(Collection collection, char separator) {
|
||||
* @return the joined String, <code>null</code> if null iterator input
|
||||
* @since 2.3
|
||||
*/
|
||||
public static String join(Collection collection, String separator) {
|
||||
public static String join(Collection<?> collection, String separator) {
|
||||
if (collection == null) {
|
||||
return null;
|
||||
}
|
||||
@ -5579,7 +5579,6 @@ private static boolean startsWith(String str, String prefix, boolean ignoreCase)
|
||||
* StringUtils.startsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true
|
||||
* </pre>
|
||||
*
|
||||
* @see java.lang.String#startsWithAny(String, String[])
|
||||
* @param string the String to check, may be null
|
||||
* @param searchStrings the Strings to find, may be null or empty
|
||||
* @return <code>true</code> if the String starts with any of the the prefixes, case insensitive, or
|
||||
|
Loading…
x
Reference in New Issue
Block a user