diff options
5 files changed, 15 insertions, 18 deletions
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 331cebe8..f68747dd 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 @@ -82,7 +82,7 @@ public interface PolicySessionFeatureApi extends OrderedService { * In a distributed host environment, features have the ability to send * the object do a different host, and do the insert. * - * @param policySession the 'PolicySession' object associated with the + * @param session the 'PolicySession' object associated with the * Drools session * @param object the object to insert in Drools memory * @return 'true' if this feature is handling the operation, diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java index c5841b06..8b807387 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java @@ -89,6 +89,7 @@ import org.slf4j.LoggerFactory; tags = {@Tag(name = "pdp-d-telemetry", description = "Drools PDP Telemetry Operations")}) public class RestManager { + private static final String OFFER_FAILED = "{}: cannot offer to topic {} because of {}"; private static final String CANNOT_PERFORM_OPERATION = "cannot perform operation"; private static final String NO_FILTERS = " no filters"; private static final String NOT_FOUND = " not found: "; @@ -2085,17 +2086,16 @@ public class RestManager { .build(); } } catch (IllegalArgumentException e) { - logger.debug("{}: cannot offer to topic {} because of {}", this, topic, e.getMessage(), - e); + logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e); return Response.status(Response.Status.NOT_FOUND) .entity(new Error(topic + NOT_FOUND_MSG)).build(); } catch (IllegalStateException e) { - logger.debug("{}: cannot offer to topic {} because of {}", this, topic, e.getMessage(), - e); + logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e); return Response.status(Response.Status.NOT_ACCEPTABLE) .entity(new Error(topic + " not acceptable due to current state")) .build(); } catch (Exception e) { + logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(new Error(e.getMessage())) .build(); } diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java index c924fd69..757b67fa 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java @@ -841,8 +841,8 @@ class PolicyEngineManager implements PolicyEngine { logger.warn("{}: abnormal termination - shutdown graceful time period expiration", PolicyEngineManager.this); } catch (final InterruptedException e) { - /* courtesy to shutdown() to allow it to return */ synchronized (PolicyEngineManager.this) { + /* courtesy to shutdown() to allow it to return */ } logger.info("{}: finishing a graceful shutdown ", PolicyEngineManager.this, e); } finally { diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java index fe1a2345..397e9539 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java @@ -58,7 +58,6 @@ import org.onap.policy.common.utils.gson.GsonTestUtils; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.core.lock.Lock; import org.onap.policy.drools.core.lock.LockCallback; -import org.onap.policy.drools.core.lock.LockImpl; import org.onap.policy.drools.core.lock.PolicyResourceLockManager; import org.onap.policy.drools.features.PolicyControllerFeatureApi; import org.onap.policy.drools.features.PolicyEngineFeatureApi; diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java index 0b49993d..959e6a2c 100644 --- a/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java +++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java @@ -7,9 +7,9 @@ * 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. @@ -207,9 +207,7 @@ public class PropertyUtil { config.getInterpolator().registerLookup(CRYPTO_CODER_PROPERTY_PREFIX, new CryptoCoderValueLookup(cryptoCoder)); Properties props = ConfigurationConverter.getProperties(config); - props.stringPropertyNames().forEach(key -> { - props.setProperty(key, cryptoCoder.decrypt(props.getProperty(key))); - }); + props.stringPropertyNames().forEach(key -> props.setProperty(key, cryptoCoder.decrypt(props.getProperty(key)))); return props; } @@ -266,7 +264,7 @@ public class PropertyUtil { public interface Listener { /** * Notification of a properties file change. - * + * * @param properties the new properties * @param changedKeys the set of property names that have changed, including * additions and removals @@ -342,7 +340,7 @@ public class PropertyUtil { /** * Add a listener to the notification list. - * + * * @param listener this is the listener to add to the list * @return the properties at the moment the listener was added to the list */ @@ -353,7 +351,7 @@ public class PropertyUtil { /** * Remove a listener from the notification list. - * + * * @param listener this is the listener to remove */ synchronized void removeListener(Listener listener) { @@ -373,7 +371,7 @@ public class PropertyUtil { /** * This method is periodically called to check for property list updates. - * + * * @throws IOException if there is an error in reading the properties file */ synchronized void poll() throws IOException { @@ -441,7 +439,7 @@ public class PropertyUtil { /** * Stop listenening for updates. - * + * * @param file the properties file * @param listener notify if not null, this is a callback interface that was used for * notifications of changes @@ -457,7 +455,7 @@ public class PropertyUtil { /** * Stop listenening for updates. - * + * * @param fileName the properties file * @param listener notify if not null, this is a callback interface that was used for * notifications of changes |