aboutsummaryrefslogtreecommitdiffstats
path: root/policy-core
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-10 16:39:28 -0400
committerJim Hahn <jrh3@att.com>2019-07-16 14:26:03 -0400
commit27d388563cdc48a1fc19ca5ca99a0482e6834db5 (patch)
tree5a28d040ec5832fe422a93a5a26c9509fd22f558 /policy-core
parent2fa10fe07132ee328fac7b46b6ef1530bcf590e5 (diff)
Fix checkstyle issues in policy-core
Also deleted the checkstyle suppression file. Change-Id: I93e9f9154b614b56f7826ec978e1a99bd9369348 Issue-ID: POLICY-1907 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-core')
-rw-r--r--policy-core/checkstyle-suppressions.xml30
-rw-r--r--policy-core/pom.xml1
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java16
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java6
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java (renamed from policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureAPI.java)6
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java4
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiTest.java4
-rw-r--r--policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureApi (renamed from policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureAPI)0
8 files changed, 18 insertions, 49 deletions
diff --git a/policy-core/checkstyle-suppressions.xml b/policy-core/checkstyle-suppressions.xml
deleted file mode 100644
index d771a027..00000000
--- a/policy-core/checkstyle-suppressions.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<!--
- ============LICENSE_START=======================================================
- Copyright (C) 2018 AT&T Technologies. 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
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
--->
-
-<!DOCTYPE suppressions PUBLIC
- "-//Puppy Crawl//DTD Suppressions 1.0//EN"
- "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
-
-<suppressions>
- <suppress checks="AbbreviationAsWordInName"
- files="PolicyResourceLockFeatureAPI.java|PolicySessionFeatureAPI.java"
- lines="1-9999"/>
-</suppressions>
diff --git a/policy-core/pom.xml b/policy-core/pom.xml
index 1a0626c9..c6866174 100644
--- a/policy-core/pom.xml
+++ b/policy-core/pom.xml
@@ -149,7 +149,6 @@
<includeTestResources>true</includeTestResources>
<excludes>
</excludes>
- <suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation>
<consoleOutput>true</consoleOutput>
<failsOnViolation>true</failsOnViolation>
<violationSeverity>warning</violationSeverity>
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
index 2c5d87f8..3b5c360f 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 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");
@@ -258,7 +258,7 @@ public class PolicyContainer implements Startable {
// loop through all of the features, and give each one
// a chance to create the 'KieSession'
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
if ((kieSession = feature.activatePolicySession(this, name, kieBaseName)) != null) {
break;
@@ -280,7 +280,7 @@ public class PolicyContainer implements Startable {
sessions.put(name, session);
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.newPolicySession(session);
} catch (Exception e) {
@@ -350,7 +350,7 @@ public class PolicyContainer implements Startable {
sessions.put(name, policySession);
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.newPolicySession(policySession);
} catch (Exception e) {
@@ -430,7 +430,7 @@ public class PolicyContainer implements Startable {
// KLUDGE WARNING: this is a temporary workaround -- if there are
// no features, we don't have persistence, and 'activate' is never
// called. In this case, make sure the container is started.
- if (PolicySessionFeatureAPI.impl.getList().isEmpty()) {
+ if (PolicySessionFeatureApi.impl.getList().isEmpty()) {
start();
}
@@ -562,7 +562,7 @@ public class PolicyContainer implements Startable {
session.getKieSession().dispose();
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.disposeKieSession(session);
} catch (Exception e) {
@@ -625,7 +625,7 @@ public class PolicyContainer implements Startable {
session.getKieSession().destroy();
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.destroyKieSession(session);
} catch (Exception e) {
@@ -685,7 +685,7 @@ public class PolicyContainer implements Startable {
logger.info("PolicyContainer.main: configDir={}", configDir);
// invoke 'globalInit' on all of the features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.globalInit(args, configDir);
} catch (Exception e) {
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
index 95da2865..f27bb4ab 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 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");
@@ -142,8 +142,8 @@ public class PolicySession
// loop through all of the features, and give each one
// a chance to create the 'ThreadModel'
- for (PolicySessionFeatureAPI feature :
- PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature :
+ PolicySessionFeatureApi.impl.getList()) {
try {
if ((threadModel = feature.selectThreadModel(this)) != null) {
break;
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureAPI.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java
index 56595901..3d259954 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureAPI.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java
@@ -32,13 +32,13 @@ import org.onap.policy.common.utils.services.OrderedServiceImpl;
* return a 'void' value. In other cases, such as 'activatePolicySession',
* may
*/
-public interface PolicySessionFeatureAPI extends OrderedService {
+public interface PolicySessionFeatureApi extends OrderedService {
/**
* 'FeatureAPI.impl.getList()' returns an ordered list of objects
* implementing the 'FeatureAPI' interface.
*/
- public static OrderedServiceImpl<PolicySessionFeatureAPI> impl =
- new OrderedServiceImpl<>(PolicySessionFeatureAPI.class);
+ public static OrderedServiceImpl<PolicySessionFeatureApi> impl =
+ new OrderedServiceImpl<>(PolicySessionFeatureApi.class);
/**
* This method is called during initialization at a point right after
diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
index d838f6bd..fbd81391 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 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.
@@ -28,7 +28,7 @@ import org.kie.api.runtime.KieSession;
* 'PolicySessionFeatureAPI', and providing a means to indicate
* which hooks have been invoked.
*/
-public class PolicySessionFeatureApiMock implements PolicySessionFeatureAPI {
+public class PolicySessionFeatureApiMock implements PolicySessionFeatureApi {
// contains the log entries since the most recent 'getLog()' call
private static ArrayList<String> log = new ArrayList<>();
diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiTest.java
index df2c1398..1d1ca0ff 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiTest.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019 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.
@@ -28,7 +28,7 @@ public class PolicySessionFeatureApiTest {
@Test
public void test() {
- PolicySessionFeatureAPI api = new PolicySessionFeatureAPI() {
+ PolicySessionFeatureApi api = new PolicySessionFeatureApi() {
@Override
public int getSequenceNumber() {
return 0;
diff --git a/policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureAPI b/policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureApi
index 3af9beea..3af9beea 100644
--- a/policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureAPI
+++ b/policy-core/src/test/resources/META-INF/services/org.onap.policy.drools.core.PolicySessionFeatureApi