aboutsummaryrefslogtreecommitdiffstats
path: root/reception
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-06 16:39:17 -0400
committerJim Hahn <jrh3@att.com>2021-05-06 16:48:30 -0400
commit8cd519ee397bd6661eddfeea1b989a99d1caac2e (patch)
tree0770d461c5afd76ecf7e603885cb7f2e936c654c /reception
parenta05cc62b6426d31c23f60dbe4a6f367331431ea4 (diff)
Fix sonars in policy-distribution
Fixed: - use "var" instead of actual type Issue-ID: POLICY-3285 Change-Id: I0dba2f96870722b4071ac0085287bc91a27dde88 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'reception')
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java4
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java4
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/parameters/PolicyDecoderConfigurationParametersJsonAdapter.java6
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java6
4 files changed, 10 insertions, 10 deletions
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
index ca15bfb3..8ad293c3 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Copyright (C) 2019 Nordix Foundation.
- * Copyright (C) 2020 AT&T Inc.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler {
*/
@Override
public void initialize(final String parameterGroupName) throws PluginInitializationException {
- final ReceptionHandlerParameters receptionHandlerParameters = ParameterService.get(parameterGroupName);
+ final var receptionHandlerParameters = (ReceptionHandlerParameters) ParameterService.get(parameterGroupName);
pluginHandler = new PluginHandler(receptionHandlerParameters.getPluginHandlerParameters().getName());
initializeReception(receptionHandlerParameters.getReceptionHandlerConfigurationName());
}
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java b/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java
index 95767a42..c2ea8009 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2020 AT&T Inc.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,7 +115,7 @@ public class PluginHandler {
try {
final Class<PolicyForwarder> policyForwarderClass =
(Class<PolicyForwarder>) Class.forName(forwarderParameters.getForwarderClassName());
- final PolicyForwarder policyForwarder = policyForwarderClass.getDeclaredConstructor().newInstance();
+ final var policyForwarder = policyForwarderClass.getDeclaredConstructor().newInstance();
policyForwarder.configure(forwarderParameters.getForwarderConfigurationName());
policyForwarders.add(policyForwarder);
} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PolicyDecoderConfigurationParametersJsonAdapter.java b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PolicyDecoderConfigurationParametersJsonAdapter.java
index 64ffa135..aedf357e 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PolicyDecoderConfigurationParametersJsonAdapter.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PolicyDecoderConfigurationParametersJsonAdapter.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2020 AT&T Inc.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ public class PolicyDecoderConfigurationParametersJsonAdapter
@Override
public PolicyDecoderConfigurationParameterGroup deserialize(final JsonElement json, final Type typeOfT,
final JsonDeserializationContext context) {
- final JsonObject jsonObject = json.getAsJsonObject();
+ final var jsonObject = json.getAsJsonObject();
final String policyDecoderParameterClassName = getParameterGroupClassName(jsonObject);
final Class<?> policyDecoderParameterClass = getParameterGroupClass(policyDecoderParameterClassName);
@@ -55,7 +55,7 @@ public class PolicyDecoderConfigurationParametersJsonAdapter
}
private String getParameterGroupClassName(final JsonObject jsonObject) {
- final JsonPrimitive classNameJsonPrimitive = ((JsonPrimitive) jsonObject.get(PARAMETER_CLASS_NAME));
+ final var classNameJsonPrimitive = ((JsonPrimitive) jsonObject.get(PARAMETER_CLASS_NAME));
if (classNameJsonPrimitive == null || classNameJsonPrimitive.getAsString().length() == 0) {
final String errorMessage = "parameter \"" + PARAMETER_CLASS_NAME + "\" value \""
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java
index 6cdbf28b..bc2e0e0c 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2020 AT&T Inc.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class ReceptionHandlerConfigurationParametersJsonAdapter
@Override
public ReceptionHandlerConfigurationParameterGroup deserialize(final JsonElement json, final Type typeOfT,
final JsonDeserializationContext context) {
- final JsonObject jsonObject = json.getAsJsonObject();
+ final var jsonObject = json.getAsJsonObject();
final String receptionHandlerParameterClassName = getParameterGroupClassName(jsonObject);
final Class<?> receptionHandlerParameterClass = getParameterGroupClass(receptionHandlerParameterClassName);
@@ -54,7 +54,7 @@ public class ReceptionHandlerConfigurationParametersJsonAdapter
}
private String getParameterGroupClassName(final JsonObject jsonObject) {
- final JsonPrimitive classNameJsonPrimitive = ((JsonPrimitive) jsonObject.get(PARAMETER_CLASS_NAME));
+ final var classNameJsonPrimitive = ((JsonPrimitive) jsonObject.get(PARAMETER_CLASS_NAME));
if (classNameJsonPrimitive == null || classNameJsonPrimitive.getAsString().length() == 0) {
final String errorMessage = "parameter \"" + PARAMETER_CLASS_NAME + "\" value \""