Replaced isEmpty with not hasText 49/121749/3
authormkerrigan <michael.kerrigan@est.tech>
Tue, 8 Jun 2021 11:58:08 +0000 (12:58 +0100)
committerRishi Chail <rishi.chail@est.tech>
Wed, 9 Jun 2021 10:14:51 +0000 (10:14 +0000)
Sonarcloud reported that isEmpty is deprecated.Not hasText will give the
same behavior

Issue-ID: CPS-89
Change-Id: I45b1723dad414bfc08d4ed33931d6c21eb5e6185
Signed-off-by: mkerrigan <michael.kerrigan@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java

index bdb71bf..5aadb3f 100755 (executable)
@@ -60,7 +60,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
 
     @Override
     public void createDataNode(final String cmHandle, final String parentNodeXpath, final String jsonData) {
-        if (StringUtils.isEmpty(parentNodeXpath) || "/".equals(parentNodeXpath)) {
+        if (!StringUtils.hasText(parentNodeXpath) || "/".equals(parentNodeXpath)) {
             cpsDataService.saveData(getDataspaceName(), cmHandle, jsonData);
         } else {
             cpsDataService.saveData(getDataspaceName(), cmHandle, parentNodeXpath, jsonData);