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.
This commit is contained in:
committed by
Oliver Drotbohm
parent
843d6a217f
commit
bfed30d1a1
@@ -64,6 +64,6 @@ public class DefaultExcerptProjector implements ExcerptProjector {
|
||||
public boolean hasExcerptProjection(Class<?> type) {
|
||||
|
||||
ResourceMetadata metadata = mappings.getMetadataFor(type);
|
||||
return metadata == null ? false : metadata.getExcerptProjection() != null;
|
||||
return metadata == null ? false : metadata.getExcerptProjection().isPresent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user