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

    • Sub-task
    • Status: Closed
    • Could
    • Resolution: Fixed
    • None
    • Core 2.5.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: