#831 - Polishing.
Applied some recommendations provided by IntelliJ that I stumbled over while reviewing the changes.
This commit is contained in:
@@ -166,7 +166,7 @@ public class JsonPathLinkDiscoverer implements LinkDiscoverer {
|
||||
JSONArray jsonArray = (JSONArray) parseResult;
|
||||
|
||||
return jsonArray.stream() //
|
||||
.flatMap(it -> JSONArray.class.isInstance(it) ? ((JSONArray) it).stream() : Stream.of(it)) //
|
||||
.flatMap(it -> it instanceof JSONArray ? ((JSONArray) it).stream() : Stream.of(it)) //
|
||||
.map(it -> extractLink(it, rel)) //
|
||||
.collect(Collectors.collectingAndThen(Collectors.toList(), Links::of));
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Traverson {
|
||||
Traverson.class.getClassLoader());
|
||||
|
||||
Assert.isTrue(ALL_DEFAULTS.size() == 1,
|
||||
() -> String.format("Expected to find only one TraversonDefaults instance, but found: ", //
|
||||
() -> String.format("Expected to find only one TraversonDefaults instance, but found: %s", //
|
||||
ALL_DEFAULTS.stream() //
|
||||
.map(Object::getClass) //
|
||||
.map(Class::getName) //
|
||||
|
||||
Reference in New Issue
Block a user