diff options
author | Jim Hahn <jrh3@att.com> | 2019-06-14 19:20:55 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-06-17 12:31:32 -0400 |
commit | ba6267f5bd58dd7a3a0d6363e7ac4c27705e9f40 (patch) | |
tree | 658afb8b0500180302e837b0f90e0372c82b7062 /models-interactions/model-impl/vfc/src/main | |
parent | f59ec395bf1e41df894f884e70ff3185280668c0 (diff) |
Fix sonar issues in models: sdc to vfc
sdc
sdnc
snr
so
vfc
Still haven't done the "rest" project yet, as still awaiting removal
of www.examples.org.
Change-Id: Icc4948799e2423bd4568232ee5629b88b7ecb996
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/vfc/src/main')
-rw-r--r-- | models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcManager.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcManager.java b/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcManager.java index 850f37552..406e35d33 100644 --- a/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcManager.java +++ b/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcManager.java @@ -47,6 +47,7 @@ public final class VfcManager implements Runnable { // The REST manager used for processing REST calls for this VFC manager private RestManager restManager; + @FunctionalInterface public interface VfcCallback { void onResponse(VfcResponse responseError); } @@ -155,9 +156,11 @@ public final class VfcManager implements Runnable { } Thread.sleep(20000); } - if ((attemptsLeft <= 0) && (responseGet != null) && (responseGet.getResponseDescriptor() != null) - && (responseGet.getResponseDescriptor().getStatus() != null) - && (!responseGet.getResponseDescriptor().getStatus().isEmpty())) { + boolean isTimeout = (attemptsLeft <= 0) && (responseGet != null) + && (responseGet.getResponseDescriptor() != null); + isTimeout = isTimeout && (responseGet.getResponseDescriptor().getStatus() != null) + && (!responseGet.getResponseDescriptor().getStatus().isEmpty()); + if (isTimeout) { logger.debug("VFC timeout. Status: ({})", responseGet.getResponseDescriptor().getStatus()); this.callback.onResponse(responseGet); } |