Skip to content

Commit

Permalink
Remove dependency to org.apache.commons
Browse files Browse the repository at this point in the history
Replace org.apache.commons.lang.ArrayUtils to a default Java implementation.
  • Loading branch information
BONNe authored Apr 13, 2023
1 parent 4494cdc commit 6e9f9b3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
package world.bentobox.biomes.panels;


import org.apache.commons.lang.ArrayUtils;
import org.bukkit.ChatColor;
import org.bukkit.conversations.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down Expand Up @@ -68,7 +68,7 @@ protected boolean isInputValid(@NotNull ConversationContext context, @NotNull St

// Split and check if they exist in valid entries.
String[] accepted = validEntry.toLowerCase().replaceAll("\\s", "").split(",");
return ArrayUtils.contains(accepted, input.toLowerCase());
return Arrays.asList(accepted).contains(input.toLowerCase());
}


Expand All @@ -84,7 +84,7 @@ protected Prompt acceptValidatedInput(@NotNull ConversationContext context, @Not
{
String validEntry = user.getTranslation(Constants.CONVERSATIONS + "confirm-string").toLowerCase();

if (ArrayUtils.contains(validEntry.replaceAll("\\s", "").split(","), input.toLowerCase()))
if (Arrays.asList(validEntry.replaceAll("\\s", "").split(",")).contains(input.toLowerCase()))
{
// Add answer to consumer.
consumer.accept(true);
Expand Down Expand Up @@ -441,7 +441,7 @@ public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String
toLowerCase().replaceAll("\\s", "").
split(",");

if (input != null && ArrayUtils.contains(exit, input.toLowerCase()))
if (input != null && Arrays.asList(exit).contains(input.toLowerCase()))
{
return messagePrompt;
}
Expand Down

0 comments on commit 6e9f9b3

Please sign in to comment.