Use a simple isEmpty() check
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / errors / RestconfDocumentedExceptionMapper.java
index ca0f1f4ff8e5eae2a48ad0df5e2a5fb1cd0d9aa2..3afb12d46e66cfe51739f6bab315a0126ad0aecf 100644 (file)
@@ -270,7 +270,7 @@ public final class RestconfDocumentedExceptionMapper implements ExceptionMapper<
         final Set<MediaType> acceptableAndSupportedMediaTypes = headers.getAcceptableMediaTypes().stream()
                 .filter(RestconfDocumentedExceptionMapper::isCompatibleMediaType)
                 .collect(Collectors.toSet());
-        if (acceptableAndSupportedMediaTypes.size() == 0) {
+        if (acceptableAndSupportedMediaTypes.isEmpty()) {
             // check content type of the request
             final MediaType requestMediaType = headers.getMediaType();
             return requestMediaType == null ? DEFAULT_MEDIA_TYPE