summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-12-11 15:27:07 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-11 15:27:07 +0000
commita84ac351523902e35ed0bc47778306855c469bf9 (patch)
tree386bcb3d0e161bc8aba459b84eef6ae0c8d9d945
parent982b042ac455a740b916cdb976ac1f004ffe0630 (diff)
parent2a9b46ef39b1717ed055f1f80a3bba532b3f64d9 (diff)
Merge "fixed sonar issues in PrintYangToProp.java"
-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 2e2910235..e22f39258 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());
}
}