You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/11/30 14:15:51 UTC
[groovy] 02/02: Trivial tweak (closes #1437)
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit dab8f4e1f277701948db1e56d19ee1ecb8861051
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Nov 30 22:15:17 2020 +0800
Trivial tweak (closes #1437)
---
.../java/org/codehaus/groovy/runtime/typehandling/NumberMath.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java b/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java
index d7fd4e6..6d625ca 100644
--- a/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java
+++ b/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java
@@ -174,7 +174,7 @@ public abstract class NumberMath {
if (n instanceof BigInteger) {
return new BigDecimal((BigInteger) n);
}
- if (n instanceof Byte || n instanceof Short || n instanceof Integer || n instanceof Long) {
+ if (n instanceof Integer || n instanceof Long || n instanceof Byte || n instanceof Short) {
return new BigDecimal(n.longValue());
}
return new BigDecimal(n.toString());
@@ -184,7 +184,7 @@ public abstract class NumberMath {
if (n instanceof BigInteger) {
return (BigInteger) n;
}
- if (n instanceof Byte || n instanceof Short || n instanceof Integer || n instanceof Long) {
+ if (n instanceof Integer || n instanceof Long || n instanceof Byte || n instanceof Short) {
return BigInteger.valueOf(n.longValue());
}
return new BigInteger(n.toString());