diff options
author | Jim Hahn <jrh3@att.com> | 2021-02-10 16:17:10 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-02-10 17:17:34 -0500 |
commit | b7097d21c25a48c9d209548ac8afdc09b1679457 (patch) | |
tree | ee7a911622c333818a9ac30f2cae68aee7eb6601 /models-interactions/model-actors/actorServiceProvider/src/main | |
parent | f04d89c55ab4dfa94dfed1cc9b65471d1d3140c5 (diff) |
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 <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/main')
6 files changed, 13 insertions, 13 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java index e02e59239..b0ad38eff 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -78,7 +78,7 @@ public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial * @param clazz response class * @param propertyNames names of properties required by this operation */ - public BidirectionalTopicOperation(ControlLoopOperationParams params, BidirectionalTopicConfig config, + protected BidirectionalTopicOperation(ControlLoopOperationParams params, BidirectionalTopicConfig config, Class<S> clazz, List<String> propertyNames) { super(params, config, propertyNames); this.config = config; diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java index c75ca1d4f..a4b48d432 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -93,7 +93,7 @@ public abstract class HttpOperation<T> extends OperationPartial { * @param clazz response class * @param propertyNames names of properties required by this operation */ - public HttpOperation(ControlLoopOperationParams params, HttpConfig config, Class<T> clazz, + protected HttpOperation(ControlLoopOperationParams params, HttpConfig config, Class<T> clazz, List<String> propertyNames) { super(params, config, propertyNames); this.config = config; diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java index 6874c5edd..7ad0cd82e 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -118,7 +118,7 @@ public abstract class OperationPartial implements Operation { * @param config configuration for this operation * @param propertyNames names of properties required by this operation */ - public OperationPartial(ControlLoopOperationParams params, OperatorConfig config, List<String> propertyNames) { + protected OperationPartial(ControlLoopOperationParams params, OperatorConfig config, List<String> propertyNames) { this.params = params; this.config = config; this.fullName = params.getActor() + "." + params.getOperation(); @@ -518,7 +518,7 @@ public abstract class OperationPartial implements Operation { return futures[0]; } - CompletableFuture.anyOf(futures).thenApply(outcome -> (OperationOutcome) outcome) + CompletableFuture.anyOf(futures).thenApply(OperationOutcome.class::cast) .whenCompleteAsync(controller.delayedComplete(), params.getExecutor()); return controller; diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperatorPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperatorPartial.java index 8007c24f9..e75e99eaa 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperatorPartial.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperatorPartial.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -55,7 +55,7 @@ public abstract class OperatorPartial extends StartConfigPartial<Map<String, Obj * @param actorName name of the actor with which this operator is associated * @param name operation name */ - public OperatorPartial(String actorName, String name) { + protected OperatorPartial(String actorName, String name) { super(actorName + "." + name); this.actorName = actorName; this.name = name; diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/StartConfigPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/StartConfigPartial.java index 6c883f1b5..1cf611a61 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/StartConfigPartial.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/StartConfigPartial.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -51,7 +51,7 @@ public abstract class StartConfigPartial<T> implements Startable, Configurable<T * * @param fullName full name of this object, used for logging and exception purposes */ - public StartConfigPartial(String fullName) { + protected StartConfigPartial(String fullName) { this.fullName = fullName; } diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/TypedOperator.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/TypedOperator.java index 937776926..55bdab9ad 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/TypedOperator.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/TypedOperator.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -62,7 +62,7 @@ public abstract class TypedOperator<C, T extends Operation> extends OperatorPart * @param name operation name * @param operationMaker function to make an operation */ - public TypedOperator(String actorName, String name, OperationMaker<C, T> operationMaker) { + protected TypedOperator(String actorName, String name, OperationMaker<C, T> operationMaker) { super(actorName, name); this.operationMaker = operationMaker; } |