Fix issue of converting camel case to lower hyphen format

Fix issue of converting camel case to lower hyphen format when there are continuous capital letters.

Issue-ID: CCSDK-2026
Signed-off-by: Enbo Wang <wangenbo@huawei.com>
Change-Id: Ifd10b1e82c1f10476bbc6e15689e6025de57bbf4
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 5bd4bd9..89e4ee7 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
@@ -1149,8 +1149,8 @@
             str = str + inStr.substring(1);
         }
 
-        String regex = "(([a-z0-9])([A-Z]))";
-        String replacement = "$2-$3";
+        String regex = "([a-z0-9A-Z])(?=[A-Z])";
+        String replacement = "$1-";
 
         String retval = str.replaceAll(regex, replacement).toLowerCase();
 
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java
index a7f383f..992ed64 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java
@@ -1259,8 +1259,8 @@
             str = str + inStr.substring(1);
         }
 
-        String regex = "(([a-z0-9])([A-Z]))";
-        String replacement = "$2-$3";
+        String regex = "([a-z0-9A-Z])(?=[A-Z])";
+        String replacement = "$1-";
 
         String retval = str.replaceAll(regex, replacement).toLowerCase();