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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        11h 40m 1 Howard M. Lewis Ship 21/Mar/12 20:08
        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
        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
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 5.3.3 [ 12320045 ]
        Fix Version/s 5.4 [ 12316401 ]
        Resolution Fixed [ 1 ]
        Hide
        Howard M. Lewis Ship added a comment -

        Nice catch!

        Show
        Howard M. Lewis Ship added a comment - Nice catch!
        Howard M. Lewis Ship made changes -
        Summary TypeCoercion from Number to Boolean fails every 256 times TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256
        Priority Major [ 3 ] Critical [ 2 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Jerome Alberto created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development