Skip to content

Commit

Permalink
DATAREST-1446 - DefaultExcerptProjector now declines presence of proj…
Browse files Browse the repository at this point in the history
…ection 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.
  • Loading branch information
ravenberserk authored and odrotbohm committed Oct 28, 2019
1 parent b016c0b commit 694079d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public Object projectExcerpt(Object source) {
public boolean hasExcerptProjection(Class<?> type) {

ResourceMetadata metadata = mappings.getMetadataFor(type);
return metadata == null ? false : metadata.getExcerptProjection() != null;
return metadata == null ? false : metadata.getExcerptProjection().isPresent();
}
}

0 comments on commit 694079d

Please sign in to comment.