Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3747

Boolean tests during Initialization consistent with JDK

    Details

    • Type: Patch
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 2.1.1.CR1
    • Fix Version/s: 2.1.1.CR2
    • Component/s: Core
    • Labels:
      None
    • Estimated Difficulty:
      Low

      Description

      I noticed code like:

      boolean autoCreate = "true".equals(factory.attributeValue("auto-create"));

      Java already has some boolean semantics that I would expect to be leveraged for consistency. The line could be replaced with:

      boolean autoCreate = Boolean.parseBoolean(factory.attributeValue("auto-create"));

      There is a subtle difference in that parseBoolean will do a case insensitive comparison, but at least this is consistent with core Java.

      See: http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html#parseBoolean(java.lang.String)
      and: http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html#valueOf(java.lang.String)

      The above change also removes "magic values" repeated ("true").

      Very minor issue, but also easy to fix.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shane.bryzak Shane Bryzak
                Reporter:
                awhitford Anthony Whitford
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: