diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-10 09:53:23 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-10 11:07:36 -0400 |
commit | 6372b62fcd8813d7d49fb279b933ffe2e4637048 (patch) | |
tree | 5d221f640ece91ce331f56d7bb6537a4393def3a /models-sim/policy-models-simulators/src | |
parent | da708d64dc27f36ed5da733fca14ebfb4cc2832b (diff) |
Fix sonars in policy-models impls & simulators
Fixed:
- use "var"
Issue-ID: POLICY-3094
Change-Id: I65da54cae5a58966f21f981c6cea1259bfdf4239
Signed-off-by: Jim Hahn <jrh3@att.com>
simulators
Change-Id: I1144568485e62e0c72194caaf21ebf1ba88a6fef
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-sim/policy-models-simulators/src')
2 files changed, 7 insertions, 7 deletions
diff --git a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java index f82423c11..4c299914b 100644 --- a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java +++ b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -165,7 +165,7 @@ public class Main extends ServiceManagerContainer { private SimulatorParameters readParameters(String paramFile) { try { - String paramsJson = getResourceAsString(paramFile); + var paramsJson = getResourceAsString(paramFile); if (paramsJson == null) { throw new IllegalArgumentException(new FileNotFoundException(paramFile)); } @@ -183,14 +183,14 @@ public class Main extends ServiceManagerContainer { } private DmaapSimProvider buildDmaapProvider(DmaapSimParameterGroup params) { - DmaapSimProvider prov = new DmaapSimProvider(params); + var prov = new DmaapSimProvider(params); DmaapSimProvider.setInstance(prov); prov.start(); return prov; } private CdsSimulator buildCdsSimulator(CdsServerParameters params) throws IOException { - CdsSimulator cdsSimulator = new CdsSimulator(params.getHost(), params.getPort(), params.getResourceLocation(), + var cdsSimulator = new CdsSimulator(params.getHost(), params.getPort(), params.getResourceLocation(), params.getSuccessRepeatCount(), params.getRequestedResponseDelayMs()); cdsSimulator.start(); return cdsSimulator; @@ -211,7 +211,7 @@ public class Main extends ServiceManagerContainer { private HttpServletServer buildRestServer(String dmaapName, ClassRestServerParameters params) { try { - Properties props = getServerProperties(dmaapName, params); + var props = getServerProperties(dmaapName, params); HttpServletServer testServer = makeServer(props); testServer.waitedStart(5000); @@ -263,7 +263,7 @@ public class Main extends ServiceManagerContainer { * @return a set of properties representing the given parameters */ private static Properties getServerProperties(String dmaapName, ClassRestServerParameters params) { - final Properties props = new Properties(); + final var props = new Properties(); props.setProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES, params.getName()); final String svcpfx = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + params.getName(); diff --git a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java index 491585e9c..28c4f42d2 100644 --- a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java +++ b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java @@ -80,7 +80,7 @@ public class SimulatorParameters { if (dmaapProvider != null) { // do not want full validation of the provider, so validate the relevant // fields ourselves - BeanValidationResult subResult = new BeanValidationResult("dmaapProvider", dmaapProvider); + var subResult = new BeanValidationResult("dmaapProvider", dmaapProvider); subResult.validateNotNull("name", dmaapProvider.getName()); if (dmaapProvider.getTopicSweepSec() < 1) { subResult.addResult("topicSweepSec", dmaapProvider.getTopicSweepSec(), |