Skip to content
Merged
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 @@ -8,7 +8,6 @@
import java.util.List;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -142,7 +141,7 @@ private boolean hasArrayBrackets(final CharSequence path, final int index) {
}

private boolean isRoot(final CharSequence path) {
return StringUtils.equals(".", path);
return ".".contentEquals(path);
}

private boolean pathStartsWith(
Expand Down Expand Up @@ -201,7 +200,7 @@ protected boolean test() {
final StackTraceElement[] trace = Thread.currentThread().getStackTrace();
for (final StackTraceElement e : trace) {
final String m = e.getMethodName();
if (StringUtils.startsWith(m, "write")) {
if (m.startsWith("write")) {
LOGGER.trace("{} {}: {}", getCurrentPath(), m, test);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -23,7 +23,6 @@
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
Expand All @@ -46,7 +45,7 @@ public FilterParser(final String resource) {
public Collection<Object[]> data() throws IOException {
final URL url = FilterParser.class.getResource(resource);
assertTrue(url != null, "Resource does not exist: " + resource);
final String content = Resources.toString(url, Charsets.UTF_8);
final String content = Resources.toString(url, StandardCharsets.UTF_8);

final List<Object[]> data = Lists.newArrayList();

Expand Down Expand Up @@ -123,7 +122,7 @@ private boolean skip(final String line) {

private Set<String> split(final String path) {
final List<String> paths = COMMA_SPLITTER
.splitToList(StringUtils.defaultString(StringUtils.equals(path, "empty") ? null : path));
.splitToList(Objects.toString("empty".equals(path) ? null : path, ""));
return ImmutableSet.copyOf(paths);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public void testTraverse() throws IOException {
values.clear();
JacksonUtils.traverse(
root,
name -> !StringUtils.equals(name, "address"),
name -> !"address".equals(name),
node -> {
// collect values as we traverse
values.add(node.asText());
Expand Down