From 53a20351ed67acfa2218bd319c7e9b1d43287926 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Tue, 11 Sep 2018 11:02:24 +0530 Subject: Sonar Major issues This block of commented-out lines of code should be removed Sonar Link: https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-Vamy32hFUzlqc51Y&resolved=false&severities=MAJOR Location: src/main/java/com/att/dmf/mr/utils/PropertyReader.java Line No- L42 L44 L53 L86 Change-Id: Ic1a7aea8b53efa8bfddd0195fa710b1af43c49d2 Issue-ID: DMAAP-724 Signed-off-by: Surendra Reddy Katam --- .../java/com/att/dmf/mr/utils/PropertyReader.java | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/att/dmf/mr/utils/PropertyReader.java b/src/main/java/com/att/dmf/mr/utils/PropertyReader.java index 58c9fc9..000869e 100644 --- a/src/main/java/com/att/dmf/mr/utils/PropertyReader.java +++ b/src/main/java/com/att/dmf/mr/utils/PropertyReader.java @@ -39,9 +39,9 @@ public class PropertyReader extends nvReadableStack { * initializing logger * */ - //private static final Logger LOGGER = Logger.getLogger(PropertyReader.class); + private static final EELFLogger log = EELFManager.getInstance().getLogger(PropertyReader.class); -// private static final String MSGRTR_PROPERTIES_FILE = "msgRtrApi.properties"; + /** * constructor initialization @@ -50,11 +50,11 @@ public class PropertyReader extends nvReadableStack { * */ public PropertyReader() throws loadException { - /* Map argMap = new HashMap(); - final String config = getSetting(argMap, CambriaConstants.kConfig, MSGRTR_PROPERTIES_FILE); - final URL settingStream = findStream(config, ConfigurationReader.class); - push(new nvPropertiesFile(settingStream)); - push(new nvReadableTable(argMap));*/ + + + + + } /** @@ -83,43 +83,43 @@ public class PropertyReader extends nvReadableStack { * @exception MalformedURLException * */ - /*public static URL findStream(final String resourceName, Class clazz) { - try { - File file = new File(resourceName); + + + - if (file.isAbsolute()) { - return file.toURI().toURL(); - } + + + - String filesRoot = System.getProperty("RRWT_FILES", null); + - if (null != filesRoot) { + - String fullPath = filesRoot + "/" + resourceName; + - LOGGER.debug("Looking for [" + fullPath + "]."); + - file = new File(fullPath); - if (file.exists()) { - return file.toURI().toURL(); - } - } + + + + + - URL res = clazz.getClassLoader().getResource(resourceName); + - if (null != res) { - return res; - } + + + - res = ClassLoader.getSystemResource(resourceName); + + + + + + + + + + - if (null != res) { - return res; - } - } catch (MalformedURLException e) { - LOGGER.error("Unexpected failure to convert a local filename into a URL: " + e.getMessage(), e); - } - return null; - } -*/ } -- cgit 1.2.3-korg