You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2016/01/13 14:16:01 UTC

tapestry-5 git commit: TAP5-2529: fix NullPointerException when joining a list with a single null element

Repository: tapestry-5
Updated Branches:
  refs/heads/master 9768f40bf -> 4d9557a2a


TAP5-2529: fix NullPointerException when joining a list with a single null element


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4d9557a2
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4d9557a2
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4d9557a2

Branch: refs/heads/master
Commit: 4d9557a2a303a1cadc944cc79108f6950cc8941e
Parents: 9768f40
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Wed Jan 13 14:14:27 2016 +0100
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Wed Jan 13 14:15:26 2016 +0100

----------------------------------------------------------------------
 .../apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java   | 2 +-
 tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4d9557a2/commons/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java b/commons/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java
index cbad70e..2a227ad 100644
--- a/commons/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java
+++ b/commons/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalCommonsUtils.java
@@ -265,7 +265,7 @@ public class InternalCommonsUtils {
                 return "";
     
             case 1:
-                return elements.get(0).toString();
+                return String.valueOf(elements.get(0));
     
             default:
     

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4d9557a2/tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy b/tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy
index 0666198..4f400bc 100644
--- a/tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy
+++ b/tapestry-ioc/src/test/groovy/ioc/specs/InternalUtilsSpec.groovy
@@ -123,6 +123,8 @@ class InternalUtilsSpec extends Specification {
     ["barney"]                      | "barney"                       | "single value"
     ["fred", "barney", "wilma"]     | "fred, barney, wilma"          | "multiple values"
     ["fred", "barney", "", "wilma"] | "fred, barney, (blank), wilma" | "empty string converted to '(blank)'"
+    ["fred", null ]                 | "fred, null"                   | "list with null values"
+    [ null ]                        | "null"                         | "list with a single null value" //TAP5-2529
   }
 
   @Unroll