diff options
author | Taka Cho <takamune.cho@att.com> | 2021-08-17 14:23:26 -0400 |
---|---|---|
committer | Taka Cho <takamune.cho@att.com> | 2021-08-20 17:16:49 -0400 |
commit | bf06e83f40cdbfcfc1428040bf8fa58a518cdea4 (patch) | |
tree | 6bf66e14c5e340f4faa8e08cf7404e40cc6e4096 /models/src/main | |
parent | 172f990bd92e1441eca6dd161458efddb674b2fc (diff) |
sonar fix for clamp
- bug: added InterruptedException for sleep
- vulns: two false positve
- removed some unused import
- changed to use var for local variable
Issue-ID: POLICY-3452
Change-Id: I8b4be1378a2aad8f68562b63f70853832673ce97
Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'models/src/main')
4 files changed, 11 insertions, 7 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaClElementStatistics.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaClElementStatistics.java index c5ce99677..956f1db02 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaClElementStatistics.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaClElementStatistics.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 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. * You may obtain a copy of the License at @@ -139,7 +141,7 @@ public class JpaClElementStatistics extends PfConcept implements PfAuthorative<C @Override public ClElementStatistics toAuthorative() { - ClElementStatistics clElementStatistics = new ClElementStatistics(); + var clElementStatistics = new ClElementStatistics(); clElementStatistics.setId(UUID.fromString(getKey().getReferenceKey().getLocalName())); clElementStatistics.setTimeStamp(key.getInstant()); clElementStatistics.setParticipantId(new ToscaConceptIdentifier(participantId)); diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopElement.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopElement.java index 911a52089..22773e064 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopElement.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopElement.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 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. * You may obtain a copy of the License at @@ -152,7 +154,7 @@ public class JpaControlLoopElement extends PfConcept implements PfAuthorative<Co @Override public ControlLoopElement toAuthorative() { - ControlLoopElement element = new ControlLoopElement(); + var element = new ControlLoopElement(); element.setId(UUID.fromString(getKey().getLocalName())); element.setDefinition(new ToscaConceptIdentifier(definition)); diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantStatistics.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantStatistics.java index b97f9ed69..2e5188abe 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantStatistics.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantStatistics.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 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. * You may obtain a copy of the License at @@ -189,7 +191,7 @@ public class JpaParticipantStatistics extends PfConcept implements PfAuthorative @Override public ParticipantStatistics toAuthorative() { - ParticipantStatistics participantStatistics = new ParticipantStatistics(); + var participantStatistics = new ParticipantStatistics(); participantStatistics.setTimeStamp(key.getTimeStamp().toInstant()); participantStatistics.setParticipantId(new ToscaConceptIdentifier(participantId)); participantStatistics.setState(state); diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateAck.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateAck.java index 0f065e9e6..d38fa4bb2 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateAck.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateAck.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 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. * You may obtain a copy of the License at @@ -23,10 +25,6 @@ package org.onap.policy.clamp.controlloop.models.messages.dmaap.participant; import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoops; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantHealthStatus; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantStatistics; /** * Class to represent the PARTICIPANT_UPDATE_ACK message that registered participant sends to controlloop runtime. |