Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-544

BooleanPropertyExecutor refers to primitive boolean not object Boolean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5
    • 1.6
    • Engine
    • None

    Description

      note from Will: not sure if this is an actual bug or just a confusion re: the source. need to investigate.

      an example of a user-visible symptom would be helpful. see Christopher's note.

      ---------- Forwarded message ----------
      From: Adam Bishop (DSLWN) <AdamB@datacom.co.nz>
      Date: May 3, 2007 10:15 PM
      Subject: BooleanPropertyExecutor bug
      To: dev@velocity.apache.org

      getMethod().getReturnType() != Boolean.TYPE

      returns true if the method return type is Boolean rather than boolean.
      (i.e. it doesn't like the Boolean class, just the boolean primitive)

      the line should be

      getMethod().getReturnType() != Boolean.TYPE &&
      getMethod().getReturnType()!=Boolean.class

      bug exists in 1.3.1 and 1.5

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
      For additional commands, e-mail: dev-help@velocity.apache.org

      ---------- Forwarded message ----------
      From: Christopher Schultz <chris@christopherschultz.net>
      Date: May 4, 2007 9:59 AM
      Subject: Re: BooleanPropertyExecutor bug
      To: Velocity Developers List <dev@velocity.apache.org>

      ----BEGIN PGP SIGNED MESSAGE----
      Hash: SHA1

      All,

      I haven't looked at the code, but introspection often has special cases
      for primitive types, whereas their wrapper types (java.lang.Boolean, in
      this case) are handled generically as Objects.

      Are we sure that java.lang.Boolean.class is appropriate to check in this
      case?

      Adam did not provide an example of how to demonstrate the existence of
      the bug... just an assertion that the code was not sufficient.

      • -chris

      Attachments

        Activity

          People

            Unassigned Unassigned
            wglass William Glass-Husain
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: