@@ -1,7 +1,7 @@
|
||||
package org.bukkit.util;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.Collection;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StringUtil {
|
||||
@@ -25,9 +25,9 @@ public class StringUtil {
|
||||
*/
|
||||
@NotNull
|
||||
public static <T extends Collection<? super String>> T copyPartialMatches(@NotNull final String token, @NotNull final Iterable<String> originals, @NotNull final T collection) throws UnsupportedOperationException, IllegalArgumentException {
|
||||
Validate.notNull(token, "Search token cannot be null");
|
||||
Validate.notNull(collection, "Collection cannot be null");
|
||||
Validate.notNull(originals, "Originals cannot be null");
|
||||
Preconditions.checkArgument(token != null, "Search token cannot be null");
|
||||
Preconditions.checkArgument(collection != null, "Collection cannot be null");
|
||||
Preconditions.checkArgument(originals != null, "Originals cannot be null");
|
||||
|
||||
for (String string : originals) {
|
||||
if (startsWithIgnoreCase(string, token)) {
|
||||
@@ -51,7 +51,7 @@ public class StringUtil {
|
||||
* @throws IllegalArgumentException if string is null
|
||||
*/
|
||||
public static boolean startsWithIgnoreCase(@NotNull final String string, @NotNull final String prefix) throws IllegalArgumentException, NullPointerException {
|
||||
Validate.notNull(string, "Cannot check a null string for a match");
|
||||
Preconditions.checkArgument(string != null, "Cannot check a null string for a match");
|
||||
if (string.length() < prefix.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user