From b7097d21c25a48c9d209548ac8afdc09b1679457 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 10 Feb 2021 16:17:10 -0500 Subject: More sonars in models Addressed the following: - make constructors protected - check exception type - too many assertions - remove annotation lists - use "<>" - reduce cognitive complexity - extract constant - multiple method calls in one assert - don't use eq() in verify() - indentation Issue-ID: POLICY-2905 Change-Id: I25bb3951f781250e9cdfe8f5f3b80cb63e129184 Signed-off-by: Jim Hahn --- .../src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java | 4 ++-- .../java/org/onap/policy/controlloop/ControlLoopNotification.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'models-interactions/model-impl/events') diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java index 3106e3909..4f0dbf730 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,7 +54,7 @@ public abstract class ControlLoopEvent implements Serializable { * * @param event the existing instance */ - public ControlLoopEvent(ControlLoopEvent event) { + protected ControlLoopEvent(ControlLoopEvent event) { if (event == null) { return; } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java index c4c46d30a..890fb083a 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -57,7 +57,7 @@ public abstract class ControlLoopNotification implements Serializable { * * @param event the event */ - public ControlLoopNotification(ControlLoopEvent event) { + protected ControlLoopNotification(ControlLoopEvent event) { if (event == null) { return; } -- cgit 1.2.3-korg