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:
Sebastian Bazley 2009-03-15 16:11:01 +00:00
parent ebfe3a9c1d
commit c06b74202d
1 changed files with 14 additions and 15 deletions

View File

@ -1989,7 +1989,7 @@ public static String[] substringsBetween(String str, String open, String close)
} }
int closeLen = close.length(); int closeLen = close.length();
int openLen = open.length(); int openLen = open.length();
List list = new ArrayList(); List<String> list = new ArrayList<String>();
int pos = 0; int pos = 0;
while (pos < (strLen - closeLen)) { while (pos < (strLen - closeLen)) {
int start = str.indexOf(open, pos); int start = str.indexOf(open, pos);
@ -2007,7 +2007,7 @@ public static String[] substringsBetween(String str, String open, String close)
if (list.isEmpty()) { if (list.isEmpty()) {
return null; return null;
} }
return (String[]) list.toArray(new String [list.size()]); return list.toArray(new String [list.size()]);
} }
// Nested extraction // Nested extraction
@ -2286,7 +2286,7 @@ private static String[] splitByWholeSeparatorWorker(String str, String separator
int separatorLength = separator.length(); int separatorLength = separator.length();
ArrayList substrings = new ArrayList(); ArrayList<String> substrings = new ArrayList<String>();
int numberOfSubstrings = 0; int numberOfSubstrings = 0;
int beg = 0; int beg = 0;
int end = 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) { if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayUtils.EMPTY_STRING_ARRAY;
} }
List list = new ArrayList(); List<String> list = new ArrayList<String>();
int i = 0, start = 0; int i = 0, start = 0;
boolean match = false; boolean match = false;
boolean lastMatch = false; boolean lastMatch = false;
@ -2441,7 +2441,7 @@ private static String[] splitWorker(String str, char separatorChar, boolean pres
if (match || (preserveAllTokens && lastMatch)) { if (match || (preserveAllTokens && lastMatch)) {
list.add(str.substring(start, i)); 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) { if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayUtils.EMPTY_STRING_ARRAY;
} }
List list = new ArrayList(); List<String> list = new ArrayList<String>();
int sizePlus1 = 1; int sizePlus1 = 1;
int i = 0, start = 0; int i = 0, start = 0;
boolean match = false; boolean match = false;
@ -2617,7 +2617,7 @@ private static String[] splitWorker(String str, String separatorChars, int max,
if (match || (preserveAllTokens && lastMatch)) { if (match || (preserveAllTokens && lastMatch)) {
list.add(str.substring(start, i)); 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; return ArrayUtils.EMPTY_STRING_ARRAY;
} }
char[] c = str.toCharArray(); char[] c = str.toCharArray();
List list = new ArrayList(); List<String> list = new ArrayList<String>();
int tokenStart = 0; int tokenStart = 0;
int currentType = Character.getType(c[tokenStart]); int currentType = Character.getType(c[tokenStart]);
for (int pos = tokenStart + 1; pos < c.length; pos++) { for (int pos = tokenStart + 1; pos < c.length; pos++) {
@ -2714,7 +2714,7 @@ private static String[] splitByCharacterType(String str, boolean camelCase) {
currentType = type; currentType = type;
} }
list.add(new String(c, tokenStart, c.length - tokenStart)); 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 // 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 * @return the joined String, <code>null</code> if null iterator input
* @since 2.0 * @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 // handle null, zero and one elements before building a buffer
if (iterator == null) { 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 "" * @param separator the separator character to use, null treated as ""
* @return the joined String, <code>null</code> if null iterator input * @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 // handle null, zero and one elements before building a buffer
if (iterator == null) { 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 * @return the joined String, <code>null</code> if null iterator input
* @since 2.3 * @since 2.3
*/ */
public static String join(Collection collection, char separator) { public static String join(Collection<?> collection, char separator) {
if (collection == null) { if (collection == null) {
return 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 * @return the joined String, <code>null</code> if null iterator input
* @since 2.3 * @since 2.3
*/ */
public static String join(Collection collection, String separator) { public static String join(Collection<?> collection, String separator) {
if (collection == null) { if (collection == null) {
return 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 * StringUtils.startsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true
* </pre> * </pre>
* *
* @see java.lang.String#startsWithAny(String, String[])
* @param string the String to check, may be null * @param string the String to check, may be null
* @param searchStrings the Strings to find, may be null or empty * @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 * @return <code>true</code> if the String starts with any of the the prefixes, case insensitive, or