summaryrefslogtreecommitdiffstats
path: root/models-sim/policy-models-simulators/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-10 09:53:23 -0400
committerJim Hahn <jrh3@att.com>2021-05-10 11:07:36 -0400
commit6372b62fcd8813d7d49fb279b933ffe2e4637048 (patch)
tree5d221f640ece91ce331f56d7bb6537a4393def3a /models-sim/policy-models-simulators/src/main/java
parentda708d64dc27f36ed5da733fca14ebfb4cc2832b (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/main/java')
-rw-r--r--models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java12
-rw-r--r--models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java2
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(),