diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-03-11 10:35:04 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-03-11 10:39:11 -0400 |
commit | 802e19fffd6b66d85130dec4669cb93613e62dc7 (patch) | |
tree | 27cd496b49e94cc04d62cbd894f193199bf28d00 /applications/common | |
parent | c48d65afeecfe1fd5cd735708107aa7c3bc87d17 (diff) |
Fix sonar logging bugs
These did not show up locally - sonarqube must have a new
version or rules to pick these up.
Issue-ID: POLICY-2242
Change-Id: I3df5aee84f696cde6b07c68913bbd55e95c8ba3b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/common')
6 files changed, 12 insertions, 12 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapPolicyFinderFactory.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapPolicyFinderFactory.java index e12f9f71..b000db92 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapPolicyFinderFactory.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapPolicyFinderFactory.java @@ -138,7 +138,7 @@ public class OnapPolicyFinderFactory extends PolicyFinderFactory { } return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "DOM Could not load policy"); } catch (DOMStructureException ex) { - logger.error("Error loading policy file {}: {}", fileLocation.getAbsolutePath(), ex); + logger.error("Error loading policy file {}", fileLocation.getAbsolutePath(), ex); return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage()); } } diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslator.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslator.java index 0a1ace2b..aba5e252 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslator.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslator.java @@ -132,7 +132,7 @@ public class StdCombinedPolicyResultsTranslator extends StdBaseTranslator { try { return RequestParser.parseRequest(StdCombinedPolicyRequest.createInstance(request)); } catch (IllegalArgumentException | IllegalAccessException | DataTypeException e) { - LOGGER.error("Failed to convert DecisionRequest: {}", e); + LOGGER.error("Failed to convert DecisionRequest", e); } // // TODO throw exception diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java index 2cb82942..d0ae524c 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java @@ -86,7 +86,7 @@ public class StdMatchablePolicyRequest { } dataTypeFactory = DataTypeFactory.newInstance(); } catch (FactoryException e) { - LOGGER.error("Can't get Data type Factory: {}", e); + LOGGER.error("Can't get Data type Factory", e); } return dataTypeFactory; } diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java index e84a9e77..d5e2a395 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java @@ -105,7 +105,7 @@ public class StdMatchableTranslator extends StdBaseTranslator { try { return StdMatchablePolicyRequest.createInstance(request); } catch (XacmlApplicationException e) { - LOGGER.error("Failed to convert DecisionRequest: {}", e); + LOGGER.error("Failed to convert DecisionRequest", e); } // // TODO throw exception diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdOnapPip.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdOnapPip.java index 4ef71b3d..ca07f22f 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdOnapPip.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdOnapPip.java @@ -110,7 +110,7 @@ public abstract class StdOnapPip extends StdConfigurableEngine { properties.getProperty(this.issuer + ".persistenceunit"), emProperties).createEntityManager(); } catch (Exception e) { - logger.error("Persistence failed {} operations history db {}", e.getLocalizedMessage(), e); + logger.error("Persistence failed {} operations history db", e.getLocalizedMessage(), e); } } @@ -143,7 +143,7 @@ public abstract class StdOnapPip extends StdConfigurableEngine { pipResponse = null; } } catch (PIPException ex) { - logger.error("PIPException getting subject-id attribute: " + ex.getMessage(), ex); + logger.error("PIPException getting subject-id attribute", ex); } return pipResponse; } @@ -167,7 +167,7 @@ public abstract class StdOnapPip extends StdConfigurableEngine { try { attributeValue = makeInteger(value); } catch (Exception e) { - logger.error("Failed to convert {} to integer {}", value, e); + logger.error("Failed to convert {} to integer", value, e); } if (attributeValue != null) { stdPipResponse.addAttribute(new StdMutableAttribute(category, attributeId, attributeValue, @@ -181,7 +181,7 @@ public abstract class StdOnapPip extends StdConfigurableEngine { try { attributeValue = makeLong(value); } catch (Exception e) { - logger.error("Failed to convert {} to long {}", value, e); + logger.error("Failed to convert {} to long", value, e); } if (attributeValue != null) { stdPipResponse.addAttribute(new StdMutableAttribute(category, attributeId, attributeValue, diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java index e43e6519..11271651 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 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. @@ -194,7 +194,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica Files.delete(refPolicy); } catch (IOException e) { LOGGER.error("Failed to delete policy {} from disk {}", toscaPolicy.getMetadata(), - refPolicy.toAbsolutePath().toString(), e); + refPolicy.toAbsolutePath(), e); } // // Write the properties to disk @@ -277,7 +277,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica this.pdpEngine = engine; } } catch (FactoryException e) { - LOGGER.error("Failed to create XACML PDP Engine {}", e); + LOGGER.error("Failed to create XACML PDP Engine", e); } } @@ -299,7 +299,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica try { response = this.pdpEngine.decide(request); } catch (PDPException e) { - LOGGER.error("Xacml PDP Engine failed {}", e); + LOGGER.error("Xacml PDP Engine decide failed", e); } finally { // // Track the end of timing |