diff options
author | ramverma <ram.krishna.verma@ericsson.com> | 2018-09-09 14:24:10 +0100 |
---|---|---|
committer | ramverma <ram.krishna.verma@ericsson.com> | 2018-09-09 21:30:40 +0100 |
commit | 0afa5b5791c0ac739b980cf53f77e11bc1d3a0da (patch) | |
tree | 1e8814f33d2ded011b47b36bc0d3a29f8f929b8e /reception | |
parent | ed51ed0f7f1f479e394634de9ffb0778de4ea307 (diff) |
Fixing sonar bugs in distribution
Change-Id: I3ec5c73c54145b1ba9f637eaa95c843e25f46a10
Issue-ID: POLICY-1035
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'reception')
2 files changed, 14 insertions, 15 deletions
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java index 300dae8f..8782f795 100644 --- a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java +++ b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java @@ -22,6 +22,7 @@ package org.onap.policy.distribution.reception.handling; import java.util.ArrayList; import java.util.Collection; + import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.common.parameters.ParameterService; @@ -35,10 +36,9 @@ import org.onap.policy.distribution.reception.decoding.PolicyDecodingException; import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters; /** - * Base implementation of {@link ReceptionHandler}. All reception handlers should extend this base - * class by implementing the {@link #initializeReception(String)} method to perform the specific - * initialization required to receive inputs and by invoking {@link #inputReceived(PolicyInput)} - * when the reception handler receives input. + * Base implementation of {@link ReceptionHandler}. All reception handlers should extend this base class by implementing + * the {@link #initializeReception(String)} method to perform the specific initialization required to receive inputs and + * by invoking {@link #inputReceived(PolicyInput)} when the reception handler receives input. */ public abstract class AbstractReceptionHandler implements ReceptionHandler { @@ -51,15 +51,14 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler { */ @Override public void initialize(final String parameterGroupName) throws PluginInitializationException { - final ReceptionHandlerParameters receptionHandlerParameters = - (ReceptionHandlerParameters) ParameterService.get(parameterGroupName); + final ReceptionHandlerParameters receptionHandlerParameters = ParameterService.get(parameterGroupName); pluginHandler = new PluginHandler(receptionHandlerParameters.getPluginHandlerParameters().getName()); initializeReception(receptionHandlerParameters.getReceptionHandlerConfigurationName()); } /** - * Sub classes must implement this method to perform the specific initialization required to - * receive inputs, for example setting up subscriptions. + * Sub classes must implement this method to perform the specific initialization required to receive inputs, for + * example setting up subscriptions. * * @param parameterGroupName the parameter group name * @throws PluginInitializationException if initialization of reception handler fails @@ -67,13 +66,12 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler { protected abstract void initializeReception(String parameterGroupName) throws PluginInitializationException; /** - * Handle input that has been received. The given input shall be decoded using the - * {@link PolicyDecoder}s configured for this reception handler and forwarded using the - * {@link PolicyForwarder}s configured for this reception handler. + * Handle input that has been received. The given input shall be decoded using the {@link PolicyDecoder}s configured + * for this reception handler and forwarded using the {@link PolicyForwarder}s configured for this reception + * handler. * * @param policyInput the input that has been received - * @throws PolicyDecodingException if an error occurs in decoding a policy from the received - * input + * @throws PolicyDecodingException if an error occurs in decoding a policy from the received input */ protected void inputReceived(final PolicyInput policyInput) throws PolicyDecodingException { diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java b/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java index 4f3f41e3..e6bfefea 100644 --- a/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java +++ b/reception/src/main/java/org/onap/policy/distribution/reception/handling/PluginHandler.java @@ -23,6 +23,7 @@ package org.onap.policy.distribution.reception.handling; import java.util.ArrayList; import java.util.Collection; import java.util.Map; + import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.common.parameters.ParameterService; @@ -52,7 +53,7 @@ public class PluginHandler { * @throws PluginInitializationException exception if it occurs */ public PluginHandler(final String parameterGroupName) throws PluginInitializationException { - final PluginHandlerParameters params = (PluginHandlerParameters) ParameterService.get(parameterGroupName); + final PluginHandlerParameters params = ParameterService.get(parameterGroupName); initializePolicyDecoders(params.getPolicyDecoders()); initializePolicyForwarders(params.getPolicyForwarders()); } @@ -113,7 +114,7 @@ public class PluginHandler { try { final Class<PolicyForwarder> policyForwarderClass = (Class<PolicyForwarder>) Class.forName(forwarderParameters.getForwarderClassName()); - PolicyForwarder policyForwarder = policyForwarderClass.newInstance(); + final PolicyForwarder policyForwarder = policyForwarderClass.newInstance(); policyForwarder.configure(forwarderParameters.getForwarderConfigurationName()); policyForwarders.add(policyForwarder); } catch (final ClassNotFoundException | InstantiationException | IllegalAccessException exp) { |