From 3508b003fb000065a53cc4af93b82ef066ba261b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 11 Jan 2023 18:28:27 +0100 Subject: [PATCH] Modernize YangLibRestApp Use Set.of() and make sure the service is not null. Change-Id: I63c3feb978344ad08d794c3441890bfecb36d5cd Signed-off-by: Robert Varga --- .../org/opendaylight/yanglib/impl/YangLibRestApp.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java b/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java index 946f8d1a59..51f6366897 100644 --- a/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java +++ b/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java @@ -5,10 +5,10 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.yanglib.impl; -import java.util.Collections; +import static java.util.Objects.requireNonNull; + import java.util.Set; import javax.ws.rs.core.Application; import org.opendaylight.yanglib.api.YangLibService; @@ -16,12 +16,12 @@ import org.opendaylight.yanglib.api.YangLibService; public class YangLibRestApp extends Application { private final YangLibService yangLibService; - public YangLibRestApp(YangLibService yangLibService) { - this.yangLibService = yangLibService; + public YangLibRestApp(final YangLibService yangLibService) { + this.yangLibService = requireNonNull(yangLibService); } @Override public Set getSingletons() { - return Collections.singleton(this.yangLibService); + return Set.of(yangLibService); } } -- 2.36.6