summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appclcm
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-07 18:07:09 -0400
committerJim Hahn <jrh3@att.com>2021-05-07 18:13:22 -0400
commit71a2c192c13200c5f864bca610e1ba6cf99e8e82 (patch)
treeca4b6f8cc12a00b494b3337215bac6e2eca9a8e0 /models-interactions/model-actors/actor.appclcm
parentda708d64dc27f36ed5da733fca14ebfb4cc2832b (diff)
Fix sonars in policy-models actors
Fixed: - use "var" - don't throw generic Exception Issue-ID: POLICY-3094 Change-Id: I020addb9511fd665b5fed48e7d40719e27039224 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.appclcm')
-rw-r--r--models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
index 559709e9a..c3aae6879 100644
--- a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
+++ b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
@@ -69,15 +69,15 @@ public class AppcLcmOperation extends BidirectionalTopicOperation<AppcLcmDmaapWr
protected AppcLcmDmaapWrapper makeRequest(int attempt) {
String subRequestId = getSubRequestId();
- AppcLcmCommonHeader header = new AppcLcmCommonHeader();
+ var header = new AppcLcmCommonHeader();
header.setOriginatorId(params.getRequestId().toString());
header.setRequestId(params.getRequestId());
header.setSubRequestId(subRequestId);
- AppcLcmInput inputRequest = new AppcLcmInput();
+ var inputRequest = new AppcLcmInput();
inputRequest.setCommonHeader(header);
- AppcLcmRecipeFormatter recipeFormatter = new AppcLcmRecipeFormatter(getName());
+ var recipeFormatter = new AppcLcmRecipeFormatter(getName());
inputRequest.setAction(recipeFormatter.getBodyRecipe());
/*
@@ -99,10 +99,10 @@ public class AppcLcmOperation extends BidirectionalTopicOperation<AppcLcmDmaapWr
inputRequest.setPayload(null);
}
- AppcLcmBody body = new AppcLcmBody();
+ var body = new AppcLcmBody();
body.setInput(inputRequest);
- AppcLcmDmaapWrapper dmaapRequest = new AppcLcmDmaapWrapper();
+ var dmaapRequest = new AppcLcmDmaapWrapper();
dmaapRequest.setBody(body);
dmaapRequest.setVersion("2.0");
dmaapRequest.setCorrelationId(params.getRequestId() + "-" + subRequestId);
@@ -123,7 +123,7 @@ public class AppcLcmOperation extends BidirectionalTopicOperation<AppcLcmDmaapWr
*/
private void convertPayload(Map<String, Object> source, AppcLcmInput request) {
try {
- String encodedPayloadString = getCoder().encode(source);
+ var encodedPayloadString = getCoder().encode(source);
request.setPayload(encodedPayloadString);
} catch (CoderException e) {
throw new IllegalArgumentException("Cannot convert payload", e);