Uploaded image for project: 'Google Code-in'
  1. Google Code-in
  2. GCI-216

Boxed value is unboxed and then immediately reboxed in org.openmrs.ConceptNumeric.getAllowDecimal()

    Details

    • Complexity:
      Low

      Description

      Replace this line https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/ConceptNumeric.java#L214

      return allowDecimal == null ? false : allowDecimal;

      with

      return allowDecimal == null ? Boolean.FALSE : allowDecimal;

      Background Information:

      Boxing is the process of putting a primitive value into an analogous object, such as creating an Integer to hold an int value. Unboxing is the process of retrieving the primitive value from such an object.
      Since the original value is unchanged during boxing and unboxing, there's no point in doing either when not needed. This also applies to autoboxing and auto-unboxing (when Java implicitly handles the primitive/object transition for you).

        Attachments

          Activity

            People

            • Assignee:
              heliostrike Sai Sandeep Mutyala
              Reporter:
              dkayiwa Daniel Kayiwa
              Designated Committer:
              Sai Sandeep Mutyala
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h