From 3ba1f3fea3d6e54d5dd3fd7ad074217d8b1972bb Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 19 May 2021 21:10:44 +0200 Subject: [PATCH] Use a simple isEmpty() check Rather than checking size() == 0, use isEmpty(), which is clearer and potentially fasterUse a simple isEmpty() check Rather than checking size() == 0, use isEmpty(), which is clearer and potentially faster. Change-Id: I0aadff4a55258f2fbb0bd60c26993b08b3b8e7b0 Signed-off-by: Robert Varga --- .../providers/errors/RestconfDocumentedExceptionMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java index ca0f1f4ff8..3afb12d46e 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java @@ -270,7 +270,7 @@ public final class RestconfDocumentedExceptionMapper implements ExceptionMapper< final Set 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 -- 2.36.6