Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-2026

Error of converting camel case to lower hyphen format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: High High
    • Frankfurt Release
    • Frankfurt Release
    • sli/core
    • None

      In method public static String toLowerHyphen(String inStr) of
      sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java

      Using the following statements to do the format conversion:

      String regex = "(([a-z0-9])([A-Z]))";
      String replacement = "$2-$3";
      String retval = str.replaceAll(regex, replacement).toLowerCase();
      

      It works well for the case such as UpgradePreCheck.
      But when there are two continuous capital letters, such as downloadNESw, it will convert to download-nesw, and the correct format is download-n-e-sw.

            wangeb wangeb
            wangeb wangeb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: