xtern commented on code in PR #7400:
URL: https://github.com/apache/ignite-3/pull/7400#discussion_r2690146756
##########
modules/api/src/main/java/org/apache/ignite/table/TupleImpl.java:
##########
@@ -459,4 +483,89 @@ private <T> T valueNotNull(String columnName) {
return value;
}
+
+ private static byte castToByte(Number number) {
+ Class<? extends Number> cls = number.getClass();
Review Comment:
Fixed, thanks.
##########
modules/api/src/main/java/org/apache/ignite/table/TupleImpl.java:
##########
@@ -459,4 +483,89 @@ private <T> T valueNotNull(String columnName) {
return value;
}
+
+ private static byte castToByte(Number number) {
+ Class<? extends Number> cls = number.getClass();
+
+ if (cls == Long.class || cls == Integer.class || cls == Short.class) {
Review Comment:
Changed to `instanceof`.
Personally, I thought comparing by class reference might be a little more
efficient, but they're probably equally fast for final classes.
--
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]