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

Boxed value is unboxed and then immediately reboxed in org.openmrs.FormField.getRequired()

    XMLWordPrintable

Details

    Description

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

      return required == null ? false : required;

      with

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

      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).

      Gliffy Diagrams

        Attachments

          Activity

            People

              wandji69 Wandji Collins
              dkayiwa Daniel Kayiwa
              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 - 2 hours
                  2h