diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-06 17:32:21 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-06 17:53:00 -0400 |
commit | ccca53bbd25af1230e135587163bcb53e381058c (patch) | |
tree | 921e378cdce276092a11261d9d094e8c96f3f5cf /main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java | |
parent | a7bf744a50dcb660818a6bc6f265191b3389c13b (diff) |
Fix sonars in policy-pap
Fixed:
- use "var" instead of actual type
- remove unused parameter
- remove un-thrown exception from method declaration
- call isPresent() before Optional.get()
- check empty list before invoking doesNotContain()
Issue-ID: POLICY-3285
Change-Id: Ic90dccfd591c102ce29f14084f025b3ca69587dc
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java')
-rw-r--r-- | main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java index 4272e491..5c942341 100644 --- a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java +++ b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. + * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ import org.onap.policy.pap.main.comm.TimerManager; import org.onap.policy.pap.main.notification.PolicyNotifier; import org.onap.policy.pap.main.parameters.PapParameterGroup; import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams; -import org.onap.policy.pap.main.parameters.PdpParameters; import org.onap.policy.pap.main.rest.HealthCheckRestControllerV1; import org.onap.policy.pap.main.rest.PapAafFilter; import org.onap.policy.pap.main.rest.PapStatisticsManager; @@ -119,8 +118,8 @@ public class PapActivator extends ServiceManagerContainer { papParameterGroup.getRestServerParameters().setName(papParameterGroup.getName()); - final Object pdpUpdateLock = new Object(); - final PdpParameters pdpParams = papParameterGroup.getPdpParameters(); + final var pdpUpdateLock = new Object(); + final var pdpParams = papParameterGroup.getPdpParameters(); final AtomicReference<Publisher<PdpMessage>> pdpPub = new AtomicReference<>(); final AtomicReference<Publisher<PolicyNotification>> notifyPub = new AtomicReference<>(); final AtomicReference<TimerManager> pdpUpdTimers = new AtomicReference<>(); @@ -246,7 +245,7 @@ public class PapActivator extends ServiceManagerContainer { addAction("REST server", () -> { - RestServer server = new RestServer(papParameterGroup.getRestServerParameters(), PapAafFilter.class, + var server = new RestServer(papParameterGroup.getRestServerParameters(), PapAafFilter.class, HealthCheckRestControllerV1.class, StatisticsRestControllerV1.class, PdpGroupCreateOrUpdateControllerV1.class, @@ -270,7 +269,7 @@ public class PapActivator extends ServiceManagerContainer { * @param runner function to run in the background */ private void startThread(final Runnable runner) { - final Thread thread = new Thread(runner); + final var thread = new Thread(runner); thread.setDaemon(true); thread.start(); |