aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-01-28 16:30:51 -0600
committerjhh <jorge.hernandez-herrero@att.com>2021-01-28 16:30:51 -0600
commit32905749456bb5309ff9158f9c74043fe0c32a49 (patch)
tree04b08306ab17e06869ef74283b4d7c56f909cc8f /policy-management
parent77d088a607c33c236bc41c58d9567e10299357a5 (diff)
sonars - protected constructors and typecasting
Issue-ID: POLICY-3017 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I7e7e384db26e244e2514aec3c3579b7b7f92f8a1
Diffstat (limited to 'policy-management')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java5
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/TopicCoderFilterConfiguration.java6
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/internal/FeatureLockImpl.java6
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java2
5 files changed, 12 insertions, 11 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
index c1eb9f37..46049138 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
@@ -486,7 +486,7 @@ public class MavenDroolsController implements DroolsController {
topic)) {
logger.warn("{}: DECODING-UNSUPPORTED {}:{}:{}", this,
- topic, this.getGroupId(), this.getArtifactId());
+ topic, this.getGroupId(), this.getArtifactId()); // NOSONAR
return true;
}
@@ -889,7 +889,8 @@ public class MavenDroolsController implements DroolsController {
Collection<FactHandle> factHandles = kieSession.getFactHandles(new ClassObjectFilter(objFact.getClass()));
for (FactHandle factHandle : factHandles) {
if (Objects.equals(objFact, kieSession.getObject(factHandle))) {
- logger.info("Slow delete of {} of type {} from {}", objFact, sessionName);
+ logger.info("Slow delete of {} of type {} from {}",
+ objFact, objFact.getClass().getName(), sessionName);
kieSession.delete(factHandle);
return true;
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
index 8f99f0dd..7cf3a2f3 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * 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) 2018 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -76,7 +76,7 @@ public abstract class ProtocolCoderToolset {
* @param controllerId the controller id
* @throws IllegalArgumentException if invalid data has been passed in
*/
- public ProtocolCoderToolset(EventProtocolParams eventProtocolParams, String controllerId) {
+ protected ProtocolCoderToolset(EventProtocolParams eventProtocolParams, String controllerId) {
if (eventProtocolParams == null || controllerId == null) {
throw new IllegalArgumentException("Invalid input");
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/TopicCoderFilterConfiguration.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/TopicCoderFilterConfiguration.java
index 2d694530..9da48521 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/TopicCoderFilterConfiguration.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/TopicCoderFilterConfiguration.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* policy-management
* ================================================================================
- * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -41,7 +41,7 @@ public class TopicCoderFilterConfiguration {
*
* @param rawCustomCoder with format: &lt;class-containing-custom-coder&gt;,&lt;static-coder-field&gt.
*/
- public CustomCoder(String rawCustomCoder) {
+ protected CustomCoder(String rawCustomCoder) {
if (rawCustomCoder != null && !rawCustomCoder.isEmpty()) {
this.className = rawCustomCoder.substring(0, rawCustomCoder.indexOf(','));
@@ -64,7 +64,7 @@ public class TopicCoderFilterConfiguration {
* @param className class name
* @param staticCoderField static coder field
*/
- public CustomCoder(String className, String staticCoderField) {
+ protected CustomCoder(String className, String staticCoderField) {
if (className == null || className.isEmpty()) {
throw new IllegalArgumentException("No classname to create CustomCoder cannot be created");
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/internal/FeatureLockImpl.java b/policy-management/src/main/java/org/onap/policy/drools/system/internal/FeatureLockImpl.java
index 799cca7b..6ec2dc4e 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/internal/FeatureLockImpl.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/internal/FeatureLockImpl.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-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.
@@ -47,7 +47,7 @@ public abstract class FeatureLockImpl extends LockImpl {
/**
* Constructs the object.
*/
- public FeatureLockImpl() {
+ protected FeatureLockImpl() {
this.attached = false;
}
@@ -62,7 +62,7 @@ public abstract class FeatureLockImpl extends LockImpl {
* @param callback callback to be invoked once the lock is granted, or subsequently
* lost; must not be {@code null}
*/
- public FeatureLockImpl(LockState state, String resourceId, String ownerKey, int holdSec, LockCallback callback) {
+ protected FeatureLockImpl(LockState state, String resourceId, String ownerKey, int holdSec, LockCallback callback) {
super(state, resourceId, ownerKey, holdSec, callback);
this.attached = true;
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java
index ef6b48d2..eee2a50e 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java
@@ -71,7 +71,7 @@ public abstract class LockManager<T extends FeatureLockImpl> implements PolicyRe
/**
* Constructs the object.
*/
- public LockManager() {
+ protected LockManager() {
super();
}