Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

TAP5-1881: TypeCoercion from Number to Boolean returns false for any …

…number that is an even multiple of 256

git-svn-id: https://svn.apache.org/repos/asf/tapestry/tapestry5/trunk@1303549 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 68425b37ce66282b33df44a69999a0283af16188 1 parent 84f6b45
@hlship hlship authored
View
2  tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/TapestryIOCModule.java
@@ -310,7 +310,7 @@ public Boolean coerce(String input)
{
public Boolean coerce(Number input)
{
- return input.byteValue() != 0;
+ return input.longValue() != 0;
}
});
View
5 tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImplTest.java
@@ -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 void builtin_coercions(Object input, Class targetType, Object expected)
{55l, Integer.class, 55},
+ // TAP5-1881
+ {256l, Boolean.class, true},
+
{"", Boolean.class, false},
{" ", Boolean.class, false},
Please sign in to comment.
Something went wrong with that request. Please try again.