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 @@ -350,7 +350,7 @@ private static ResolvableType deriveElementType(Collection<?> elements, @Nullabl
}

return elements.stream()
.filter(it -> it != null)
.filter(Objects::nonNull)
.<Class<?>> map(Object::getClass)
.reduce(ClassUtils::determineCommonAncestor)
.map(ResolvableType::forClass)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/springframework/hateoas/UriTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.Objects;

import org.jspecify.annotations.Nullable;
import org.springframework.hateoas.TemplateVariable.VariableType;
Expand Down Expand Up @@ -462,7 +463,7 @@ public String expand(Map<String, ?> parameters) {

return type.join(variables.stream()
.map(it -> it.expand(parameters))
.filter(it -> it != null)
.filter(Objects::nonNull)
.collect(Collectors.toList()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public AnnotatedProperty(Property property) {
.orElseThrow(() -> new IllegalStateException("Could not resolve value!"));

this.annotations = Stream.of(property.getReadMethod(), property.getWriteMethod(), field) //
.filter(it -> it != null) //
.filter(Objects::nonNull) //
.map(MergedAnnotations::from) //
.collect(Collectors.toList());

Expand Down