diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-12-20 13:18:09 +0530 |
---|---|---|
committer | Sandeep J <sandeejh@in.ibm.com> | 2018-12-20 13:22:59 +0530 |
commit | ba4b7898676ec01cbab2f4b72ab92683626a9b40 (patch) | |
tree | 565844257a9fabf366167064cc1ebd1ea6c87b9b | |
parent | 0935246ecb1cad72a86eeedbc43f1ebdbbe5a9c8 (diff) |
fixed sonar issues in MdsalHelper.java
fixed sonar issues
Issue-ID: CCSDK-525
Change-Id: I0b77ad983305da8b19fa6e3587da8ea3fe1bca95
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index eeea80bc7..eb4e15e9e 100755 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -56,7 +56,9 @@ public class MdsalHelper { private static final String IPV6_ADDRESS="Ipv6Address"; private static final String IP_PREFIX="IpPrefix"; - + private static final String SETTING_PROPERTY="Setting property "; + private static final String BUILDER="-builder"; + @Deprecated public static void setProperties(Properties input) { setYangMappingProperties(input); @@ -146,7 +148,7 @@ public class MdsalHelper { } else if ("PortNumber".equals(simpleTypeName)) { propVal = String.valueOf((Integer) retValue); } - LOG.debug("Setting property " + pfx + " to " + propVal); + LOG.debug(SETTING_PROPERTY + pfx + " to " + propVal); props.setProperty(pfx, propVal); } } catch (Exception e) { @@ -182,8 +184,8 @@ public class MdsalHelper { propNamePfx = toLowerHyphen(fromClass.getSimpleName()); } - if (propNamePfx.endsWith("-builder")) { - propNamePfx = propNamePfx.substring(0, propNamePfx.length() - "-builder".length()); + if (propNamePfx.endsWith(BUILDER)) { + propNamePfx = propNamePfx.substring(0, propNamePfx.length() - BUILDER.length()); } if (propNamePfx.endsWith("-impl")) { @@ -332,7 +334,7 @@ public class MdsalHelper { } else { propVal = propValObj.toString(); } - LOG.debug("Setting property " + propName + " to " + propVal); + LOG.debug(SETTING_PROPERTY + propName + " to " + propVal); props.setProperty(propName, propVal); } @@ -379,7 +381,7 @@ public class MdsalHelper { } else { fromVal = fromObj.toString(); } - LOG.debug("Setting property " + pfx + " to " + fromVal); + LOG.debug(SETTING_PROPERTY + pfx + " to " + fromVal); props.setProperty(pfx, fromVal); } @@ -559,8 +561,8 @@ public class MdsalHelper { propNamePfx = toLowerHyphen(toClass.getSimpleName()); } - if (propNamePfx.endsWith("-builder")) { - propNamePfx = propNamePfx.substring(0, propNamePfx.length() - "-builder".length()); + if (propNamePfx.endsWith(BUILDER)) { + propNamePfx = propNamePfx.substring(0, propNamePfx.length() - BUILDER.length()); } if (propNamePfx.endsWith("-impl")) { @@ -1035,8 +1037,8 @@ public class MdsalHelper { propNamePfx = toLowerHyphen(toClass.getSimpleName()); } - if (propNamePfx.endsWith("-builder")) { - propNamePfx = propNamePfx.substring(0, propNamePfx.length() - "-builder".length()); + if (propNamePfx.endsWith(BUILDER)) { + propNamePfx = propNamePfx.substring(0, propNamePfx.length() - BUILDER.length()); } if (propNamePfx.endsWith("-impl")) { |