andreachild commented on code in PR #3153:
URL: https://github.com/apache/tinkerpop/pull/3153#discussion_r2241297326


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java:
##########
@@ -717,8 +764,30 @@ public static Number coerceTo(final Number a, final 
Class<? extends Number> claz
             throw new IllegalArgumentException("Unsupported numeric type: " + 
clazz);
         }
 
-        // return as-is since it didn't fit the type we wanted to coerce to
-        return a;
+        throw new ArithmeticException(String.format("Can't convert number of 
type %s to %s due to overflow.",
+                a.getClass().getSimpleName(), clazz.getSimpleName()));
+    }
+
+    private static Long getLong(final Number num, final Class<? extends 
Number> clazz) {

Review Comment:
   ```suggestion
       private static Long longValue(final Number num, final Class<? extends 
Number> targetClass) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to