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

Change of object type to primitive in the NameTemplate class

    XMLWordPrintable

    Details

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

      Description

      Case:
      The format method uses a Boolean type variable, but it can use a primitive because it is an internal variable. In addition, in the "if" condition it is compared with the result of the StringUtils.isNotBlank method, which returns a primitive.

      Conclusions:
      Changing from Boolean to boolean can improve memory usage.

      Link to a place of creation:
      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/layout/name/NameTemplate.java#L47

      Link to a place of use:
      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/layout/name/NameTemplate.java#L61

        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: