Tapestry 5
  1. Tapestry 5
  2. TAP5-1881

TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.3.3, 5.4
    • Component/s: tapestry-ioc
    • Labels:

      Description

      At the moment the coercion from Number to Boolean is implemented as

      public Boolean coerce(Number input)

      { return input.byteValue() != 0; }

      It should be

      public Boolean coerce(Number input)

      { return input.longValue() != 0; }

      All numbers (e.g. longs, integers, shorts) will be coerced to false if the number modulo 256 is zero.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Nice catch!

        Show
        Howard M. Lewis Ship added a comment - Nice catch!
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #692 (See https://builds.apache.org/job/tapestry-trunk-freestyle/692/)
        TAP5-1881: TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256 (Revision 1303549)

        Result = SUCCESS
        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1303549
        Files :

        • /tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java
        • /tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #692 (See https://builds.apache.org/job/tapestry-trunk-freestyle/692/ ) TAP5-1881 : TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256 (Revision 1303549) Result = SUCCESS hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1303549 Files : /tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java /tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
        Hide
        Hudson added a comment -

        Integrated in tapestry-5.3-freestyle #16 (See https://builds.apache.org/job/tapestry-5.3-freestyle/16/)
        TAP5-1881: TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256 (Revision 1303548)

        Result = SUCCESS
        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1303548
        Files :

        • /tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java
        • /tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
        Show
        Hudson added a comment - Integrated in tapestry-5.3-freestyle #16 (See https://builds.apache.org/job/tapestry-5.3-freestyle/16/ ) TAP5-1881 : TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256 (Revision 1303548) Result = SUCCESS hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1303548 Files : /tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java /tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Jerome Alberto
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development