groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Refine parsing integer(exception should be thrown when node is null)
Date Sun, 06 Aug 2017 09:12:39 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 80181003a -> 926988e8f


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

(cherry picked from commit 2af3c83)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 926988e8feca51572157e164329e7a16713014ec
Parents: 8018100
Author: sunlan <sunlan@apache.org>
Authored: Sun Aug 6 17:11:13 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Sun Aug 6 17:12:17 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/926988e8/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() );


Mime
View raw message