Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class StringUtils {

private static final Predicate<String> NOT_EMPTY = (String s) -> !s.isEmpty();

private static final char[] HEX = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

private StringUtils() {
Expand All @@ -49,10 +46,6 @@ public static boolean isEmpty(String str) {
return true;
}

public static Predicate<String> notEmpty() {
return NOT_EMPTY;
}

public static boolean isEmpty(List<String> list) {
if (list == null || list.isEmpty()) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public static List<PathSegment> getPathSegments(String thePath, boolean decode,
segments.addAll(
Arrays
.stream(thePath.substring(start).split("/"))
.filter(StringUtils.notEmpty())
.filter(s -> !s.isEmpty())
.map(p -> new PathSegmentImpl(p, decode))
.collect(Collectors.toList()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public static boolean isGrantSupportedForClient(Client client,

public static List<String> parseScope(String requestedScope) {
if (requestedScope != null) {
return Arrays.stream(requestedScope.split(" ")).filter(StringUtils.notEmpty()).collect(toList());
return Arrays.stream(requestedScope.split(" ")).filter(s -> !s.isEmpty()).collect(toList());
} else {
return Collections.emptyList();
}
Expand Down