You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/03/21 21:08:03 UTC
svn commit: r1303548 - in /tapestry/tapestry5/branches/5.3/tapestry-ioc/src:
main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java
test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
Author: hlship
Date: Wed Mar 21 20:08:02 2012
New Revision: 1303548
URL: http://svn.apache.org/viewvc?rev=1303548&view=rev
Log:
TAP5-1881: TypeCoercion from Number to Boolean returns false for any number that is an even multiple of 256
Modified:
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
Modified: tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java?rev=1303548&r1=1303547&r2=1303548&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java (original)
+++ tapestry/tapestry5/branches/5.3/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java Wed Mar 21 20:08:02 2012
@@ -309,7 +309,7 @@ public final class TapestryIOCModule
{
public Boolean coerce(Number input)
{
- return input.byteValue() != 0;
+ return input.longValue() != 0;
}
});
Modified: tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java?rev=1303548&r1=1303547&r2=1303548&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java (original)
+++ tapestry/tapestry5/branches/5.3/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java Wed Mar 21 20:08:02 2012
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -183,6 +183,9 @@ public class TypeCoercerImplTest extends
{55l, Integer.class, 55},
+ // TAP5-1881
+ {256l, Boolean.class, true},
+
{"", Boolean.class, false},
{" ", Boolean.class, false},