From: Robert Varga Date: Mon, 11 Jul 2022 21:02:24 +0000 (+0200) Subject: Use FrameworkUtil.asDictionary() X-Git-Tag: v0.16.1~6 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=1759151afb8f54cffc090f47291fedc8904f57bf;p=aaa.git Use FrameworkUtil.asDictionary() We do not need a Hashtable, use FrameworkUtil to give us what we need. Change-Id: Ib85e8fcfb7511e8c78576b7d27d33af896025abe Signed-off-by: Robert Varga --- diff --git a/aaa-password-service/impl/pom.xml b/aaa-password-service/impl/pom.xml index 51098e984..c8ba22abb 100644 --- a/aaa-password-service/impl/pom.xml +++ b/aaa-password-service/impl/pom.xml @@ -31,6 +31,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.aaa repackaged-shiro + + org.osgi + org.osgi.framework + org.osgi org.osgi.service.component diff --git a/aaa-password-service/impl/src/main/java/org/opendaylight/aaa/impl/password/service/OSGiPasswordServiceConfig.java b/aaa-password-service/impl/src/main/java/org/opendaylight/aaa/impl/password/service/OSGiPasswordServiceConfig.java index 183b322c5..6c67017f2 100644 --- a/aaa-password-service/impl/src/main/java/org/opendaylight/aaa/impl/password/service/OSGiPasswordServiceConfig.java +++ b/aaa-password-service/impl/src/main/java/org/opendaylight/aaa/impl/password/service/OSGiPasswordServiceConfig.java @@ -8,17 +8,15 @@ package org.opendaylight.aaa.impl.password.service; import static com.google.common.base.Verify.verifyNotNull; -import static java.util.Objects.requireNonNull; import com.google.common.annotations.Beta; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ForwardingObject; import java.util.Dictionary; -import java.util.Hashtable; import java.util.Map; -import org.gaul.modernizer_maven_annotations.SuppressModernizer; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.password.service.config.rev170619.PasswordServiceConfig; import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; @@ -81,10 +79,7 @@ public final class OSGiPasswordServiceConfig extends ForwardingObject implements delegate = null; } - @SuppressModernizer static Dictionary props(final PasswordServiceConfig delegate) { - final Dictionary ret = new Hashtable<>(2); - ret.put(DELEGATE, requireNonNull(delegate)); - return ret; + return FrameworkUtil.asDictionary(Map.of(DELEGATE, delegate)); } }