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.sdnr/src | |
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.sdnr/src')
-rw-r--r-- | models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java index 5b30c673a..7e57bcccd 100644 --- a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java +++ b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java @@ -3,6 +3,7 @@ * SdnrOperation * ================================================================================ * 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. @@ -90,22 +91,17 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe return Status.FAILURE; } - switch (code) { - case SUCCESS: - case PARTIAL_SUCCESS: - return Status.SUCCESS; - case FAILURE: - case PARTIAL_FAILURE: - return Status.FAILURE; - case ERROR: - case REJECT: + return switch (code) { + case SUCCESS, PARTIAL_SUCCESS -> Status.SUCCESS; + case FAILURE, PARTIAL_FAILURE -> Status.FAILURE; + case ERROR, REJECT -> { logger.warn("SDNR request was not accepted, code={}", code); - return Status.FAILURE; - case ACCEPTED: - default: + yield Status.FAILURE; + } + default -> // awaiting a "final" response - return Status.STILL_WAITING; - } + Status.STILL_WAITING; + }; } /** |