diff options
author | waynedunican <wayne.dunican@est.tech> | 2020-08-13 12:23:39 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2020-08-13 13:22:23 +0100 |
commit | 6c3192ce8ef5283b97da0853e39a0d571f6bdd7b (patch) | |
tree | 431c33de35a95f30ec8a5d2aee50152eb8684f64 /services | |
parent | 1798f96670cc2d182628332ffec5e012816c82ea (diff) |
SONAR fixes - log formatting
Fixed the sonar issues relating to Printf format being used for logging
instead of String concatenation
Issue-ID: POLICY-2773
Change-Id: I38db8d1df077fd7102f6c4f9b33685f2914bd624
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'services')
2 files changed, 10 insertions, 7 deletions
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java index 04de6b1bc..076c50b40 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -199,14 +200,14 @@ public class ApexFileEventConsumer implements ApexEventConsumer, Runnable { } } while (!textBlock.isEndOfText()); } catch (final Exception e) { - LOGGER.warn("\"" + consumerName + "\" failed to read event from file: \"" - + fileCarrierTechnologyParameters.getFileName() + "\"", e); + LOGGER.warn("\"{}\" failed to read event from file: \"{}\"", consumerName, + fileCarrierTechnologyParameters.getFileName(), e); } finally { try { eventInputStream.close(); } catch (final IOException e) { - LOGGER.warn(APEX_FILE_CONSUMER_PREAMBLE + consumerName + "\" failed to close file: \"" - + fileCarrierTechnologyParameters.getFileName() + "\"", e); + LOGGER.warn("{}{}\" failed to close file: \"{}\"", APEX_FILE_CONSUMER_PREAMBLE, consumerName, + fileCarrierTechnologyParameters.getFileName(), e); } } @@ -220,8 +221,8 @@ public class ApexFileEventConsumer implements ApexEventConsumer, Runnable { try { eventInputStream.close(); } catch (final IOException e) { - LOGGER.warn(APEX_FILE_CONSUMER_PREAMBLE + consumerName + "\" failed to close file for reading: \"" - + fileCarrierTechnologyParameters.getFileName() + "\"", e); + LOGGER.warn("{}{}\" failed to close file for reading: \"{}\"", + APEX_FILE_CONSUMER_PREAMBLE, consumerName, fileCarrierTechnologyParameters.getFileName(), e); } if (consumerThread.isAlive() && !consumerThread.isInterrupted()) { diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java index 4a5fb360e..609be10c2 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +51,8 @@ public class ApexStarterMain { * @param args the command line arguments */ public ApexStarterMain(final String[] args) { - LOGGER.info("In ApexStarter with parameters " + Arrays.toString(args)); + final String params = Arrays.toString(args); + LOGGER.info("In ApexStarter with parameters {}", params); // Check the arguments final ApexStarterCommandLineArguments arguments = new ApexStarterCommandLineArguments(); |