Skip to content

Commit

Permalink
Remove apache commons (openhab#16920)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Siepel <[email protected]>
  • Loading branch information
lsiepel authored Jun 23, 2024
1 parent e23b550 commit 6c734e1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import java.util.Objects;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.addon.AddonInfo;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.type.ThingType;
import org.openhab.io.neeo.internal.models.NeeoDevice;
import org.openhab.io.neeo.internal.models.TokenScore;
import org.openhab.io.neeo.internal.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -91,8 +91,7 @@ public Result search(String query) {
NeeoUtil.requireNotEmpty(query, "query cannot be empty");

final List<TokenScore<NeeoDevice>> results = new ArrayList<>();

final String[] needles = StringUtils.split(query, DELIMITER);
final String[] needles = StringUtils.split(query, String.valueOf(DELIMITER));
int maxScore = -1;

for (NeeoDevice device : context.getDefinitions().getExposed()) {
Expand Down Expand Up @@ -142,7 +141,8 @@ public Result search(String query) {
* @return the score of the match
*/
private int search(String haystack, String[] needles) {
return Arrays.stream(StringUtils.split(haystack, DELIMITER)).mapToInt(hs -> searchAlgorithm(hs, needles)).sum();
return Arrays.stream(StringUtils.split(haystack, String.valueOf(DELIMITER)))
.mapToInt(hs -> searchAlgorithm(hs, needles)).sum();
}

/**
Expand Down

0 comments on commit 6c734e1

Please sign in to comment.