Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3426

Use Boolean.TRUE, Boolean.FALSE, and Boolean.valueOf()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: checkstyle
    • Labels:
      None

      Description

      new Boolean(xxxx) should be avoided. There are only two Boolean states -- Boolean.TRUE and Boolean.FALSE. They can be tested directly using ==. When new Boolean(xxxx) is used, that introduces a new Object, and the Boolean object that is created can only be be tested using .valueOf() or .equals(), which is inefficient.

        Attachments

          Activity

            People

            Assignee:
            gmungoc Mungo Carstairs
            Reporter:
            hansonr Bob Hanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: