groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [4/4] groovy git commit: More useful error message in NodeList.replaceNode method (closes #516)
Date Sun, 26 Mar 2017 22:52:16 GMT
More useful error message in NodeList.replaceNode method (closes #516)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/23fd6b52
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/23fd6b52
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/23fd6b52

Branch: refs/heads/GROOVY_2_5_X
Commit: 23fd6b52162b45cac2c38a6328c1b61d497d774a
Parents: d00d9df
Author: Konstantin Yegupov <kyegupov4@gmail.com>
Authored: Wed Mar 22 18:52:44 2017 +0000
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Sun Mar 26 15:31:01 2017 -0700

----------------------------------------------------------------------
 src/main/groovy/util/NodeList.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/23fd6b52/src/main/groovy/util/NodeList.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/NodeList.java b/src/main/groovy/util/NodeList.java
index 1442a53..e54009c 100644
--- a/src/main/groovy/util/NodeList.java
+++ b/src/main/groovy/util/NodeList.java
@@ -187,7 +187,8 @@ public class NodeList extends ArrayList {
 
     public Node replaceNode(Closure c) {
         if (size() <= 0 || size() > 1) {
-            throw new GroovyRuntimeException("replaceNode() can only be used to replace a
single node.");
+            throw new GroovyRuntimeException(
+                    "replaceNode() can only be used to replace a single node, but was applied
to " + size() + " nodes");
         }
         return ((Node)get(0)).replaceNode(c);
     }


Mime
View raw message