Skip to content

Commit 694079d

Browse files
ravenberserkodrotbohm
authored andcommitted
DATAREST-1446 - DefaultExcerptProjector now declines presence of projection if metadata returns Optional.empty().
If no excerpt projection is exposed by the underlying ResourceMetadata, DefaultExcerptProjector now also properly declines its existence in ….hasExcerptProjection(…). Previously, it always indicated a presence as it improperly used a null check rather than calling Optional.isPresent(). Original pull request: #366.
1 parent b016c0b commit 694079d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultExcerptProjector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ public Object projectExcerpt(Object source) {
6464
public boolean hasExcerptProjection(Class<?> type) {
6565

6666
ResourceMetadata metadata = mappings.getMetadataFor(type);
67-
return metadata == null ? false : metadata.getExcerptProjection() != null;
67+
return metadata == null ? false : metadata.getExcerptProjection().isPresent();
6868
}
6969
}

0 commit comments

Comments
 (0)