summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-07 15:59:45 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-07 15:59:59 +0530
commit2a9b46ef39b1717ed055f1f80a3bba532b3f64d9 (patch)
treef73a26c86ec0256d290023d4a2691b59a8a35a07
parent7db11491f101ed834da2f73958647240502677df (diff)
fixed sonar issues in PrintYangToProp.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: Ie44b6710411605e262fd74fa7e4947eb3bd05a90 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
index 2e291023..e22f3925 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
@@ -53,9 +55,11 @@ public class PrintYangToProp {
private static final Logger LOG = LoggerFactory.getLogger(PrintYangToProp.class);
public static final String PROPERTIES_FILE="";
private static Properties properties;
+ private static final String BUILDER="-builder";
+ private static final String IMPL="-impl";
public static Properties prop = new Properties();
- public static ArrayList<String> propList = new ArrayList<String>();
+ public static ArrayList<String> propList = new ArrayList<>();
public static Properties toProperties(Properties props, Object fromObj) {
@@ -115,14 +119,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(fromClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}
@@ -486,14 +490,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(toClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}
@@ -999,14 +1003,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(toClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}