diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-07 18:07:09 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-07 18:13:22 -0400 |
commit | 71a2c192c13200c5f864bca610e1ba6cf99e8e82 (patch) | |
tree | ca4b6f8cc12a00b494b3337215bac6e2eca9a8e0 /models-interactions/model-actors/actor.aai/src | |
parent | da708d64dc27f36ed5da733fca14ebfb4cc2832b (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.aai/src')
3 files changed, 7 insertions, 7 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java index 27dd56c60..ca3a55ced 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * 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. @@ -76,7 +76,7 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { final Map<String, String> request = makeRequest(); Map<String, Object> headers = makeHeaders(); - StringBuilder str = new StringBuilder(getClient().getBaseUrl()); + var str = new StringBuilder(getClient().getBaseUrl()); String path = getPath(); WebTarget web = getClient().getWebTarget().path(path); @@ -89,7 +89,7 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { webldr.header(header.getKey(), header.getValue()); } - String url = str.toString(); + var url = str.toString(); String strRequest = prettyPrint(request); logMessage(EventType.OUT, CommInfrastructure.REST, url, strRequest); diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java index 1f19918e1..839fe139c 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java @@ -70,7 +70,7 @@ public class AaiGetPnfOperation extends AaiGetOperation { protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) { Map<String, Object> headers = makeHeaders(); - StringBuilder str = new StringBuilder(getClient().getBaseUrl()); + var str = new StringBuilder(getClient().getBaseUrl()); String target = getRequiredProperty(OperationProperties.AAI_TARGET_ENTITY, "target entity"); String path = getPath() + URI_SEP + URLEncoder.encode(target, StandardCharsets.UTF_8); @@ -82,7 +82,7 @@ public class AaiGetPnfOperation extends AaiGetOperation { Builder webldr = web.request(); addHeaders(webldr, headers); - String url = str.toString(); + var url = str.toString(); logMessage(EventType.OUT, CommInfrastructure.REST, url, null); diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java index 412e463eb..4f09dcb51 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java @@ -67,7 +67,7 @@ public class AaiGetTenantOperation extends AaiGetOperation { protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) { final Map<String, Object> headers = makeHeaders(); - StringBuilder str = new StringBuilder(getClient().getBaseUrl()); + var str = new StringBuilder(getClient().getBaseUrl()); String path = getPath(); WebTarget web = getClient().getWebTarget().path(path); @@ -81,7 +81,7 @@ public class AaiGetTenantOperation extends AaiGetOperation { Builder webldr = web.request(); addHeaders(webldr, headers); - String url = str.toString(); + var url = str.toString(); logMessage(EventType.OUT, CommInfrastructure.REST, url, null); |