Repository: groovy
Updated Branches:
  refs/heads/master c04b2a09d -> 2af3c8330


Refine parsing integer(exception should be thrown when node is null)


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

Branch: refs/heads/master
Commit: 2af3c833037eb1bcbdfa1e5e43aff2084b797c97
Parents: c04b2a0
Author: sunlan <sun...@apache.org>
Authored: Sun Aug 6 17:11:13 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Sun Aug 6 17:11:13 2017 +0800

----------------------------------------------------------------------
 src/main/org/codehaus/groovy/syntax/Numbers.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2af3c833/src/main/org/codehaus/groovy/syntax/Numbers.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/syntax/Numbers.java 
b/src/main/org/codehaus/groovy/syntax/Numbers.java
index 652ec97..5540d09 100644
--- a/src/main/org/codehaus/groovy/syntax/Numbers.java
+++ b/src/main/org/codehaus/groovy/syntax/Numbers.java
@@ -228,13 +228,13 @@ public class Numbers
         switch (type)
         {
             case 'i':
-                if (radix==10 && reportNode != null && 
(value.compareTo(MAX_INTEGER) > 0 || value.compareTo(MIN_INTEGER) < 0) ) {
+                if (radix==10 && (value.compareTo(MAX_INTEGER) > 0 || 
value.compareTo(MIN_INTEGER) < 0) ) {
                     throw new ASTRuntimeException(reportNode, "Number of value 
"+value+" does not fit in the range of int, but int was enforced.");
                 } else {
                     return Integer.valueOf(value.intValue());
                 }
             case 'l':
-                if (radix==10 && reportNode != null && 
(value.compareTo(MAX_LONG) > 0 || value.compareTo(MIN_LONG) < 0) ) {
+                if (radix==10 && (value.compareTo(MAX_LONG) > 0 || 
value.compareTo(MIN_LONG) < 0) ) {
                     throw new ASTRuntimeException(reportNode, "Number of value 
"+value+" does not fit in the range of long, but long was enforced.");
                 } else {
                     return new Long( value.longValue() );

Reply via email to