Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5845 Search and fix minor errors and typos
  3. TRUNK-5932

Case insensitive string comparisons should be made without intermediate upper or lower casing

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.5.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      Following the SonarQube:

      Using toLowerCase() or toUpperCase() to make case insensitive comparisons is inefficient because it requires the creation of temporary, intermediate String objects.

      GitHub link:

      Sonar link:

      Solution:

      • replace
        if (column.getName().toLowerCase().equals(UUID)) {...}
        

        with

        if (column.getName().equalsIgnoreCase(UUID)) {...}
        

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              sacull Lukasz Debicki
              Reporter:
              sacull Lukasz Debicki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: