diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-09-28 18:26:22 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-09-29 14:44:49 +0100 |
commit | 865100d2bbaafac77f1d9e637bca81adc03c4c44 (patch) | |
tree | 2aeafd442bf49dd31bd682acbe6f70b3b0dd9bc6 /models-interactions/model-actors/actor.appc/src/main | |
parent | 938005505883cf7a636a8840e20e3dc8a0ad9176 (diff) |
Fix nexus and sonar vulnerabilities
- IQ nexus dependencies
- sonar hotspots and code smells
Issue-ID: POLICY-4760
Change-Id: Ic4260c568f9d9164a33aacb34a5ff3a6f91b1bd8
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'models-interactions/model-actors/actor.appc/src/main')
2 files changed, 11 insertions, 16 deletions
diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java index b8ec634e3..ffdbde831 100644 --- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java +++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,11 +75,10 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request, * Makes a request, given the target VNF. This is a support function for * {@link #makeRequest(int)}. * - * @param attempt attempt number * @param targetVnf target VNF * @return a new request */ - protected Request makeRequest(int attempt, GenericVnf targetVnf) { + protected Request makeRequest(GenericVnf targetVnf) { var request = new Request(); request.setCommonHeader(new CommonHeader()); request.getCommonHeader().setRequestId(params.getRequestId()); @@ -145,19 +145,13 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request, "unknown APPC-C response status code: " + response.getStatus().getCode()); } - switch (code) { - case SUCCESS: - return Status.SUCCESS; - case FAILURE: - return Status.FAILURE; - case ERROR: - case REJECT: - throw new IllegalArgumentException("APP-C request was not accepted, code=" + code); - case ACCEPT: - default: - // awaiting a "final" response - return Status.STILL_WAITING; - } + return switch (code) { + case SUCCESS -> Status.SUCCESS; + case FAILURE -> Status.FAILURE; + case ERROR, REJECT -> throw new IllegalArgumentException("APP-C request was not accepted, code=" + code); + // awaiting a "final" response + default -> Status.STILL_WAITING; + }; } /** diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java index 524c797b6..0cf004935 100644 --- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java +++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +44,6 @@ public class ModifyConfigOperation extends AppcOperation { @Override protected Request makeRequest(int attempt) { - return makeRequest(attempt, getRequiredProperty(OperationProperties.AAI_RESOURCE_VNF, "resource VNF")); + return makeRequest(getRequiredProperty(OperationProperties.AAI_RESOURCE_VNF, "resource VNF")); } } |