easyice commented on code in PR #13376:
URL: https://github.com/apache/lucene/pull/13376#discussion_r1604988872
##########
lucene/core/src/java/org/apache/lucene/util/GroupVIntUtil.java:
##########
@@ -118,6 +120,13 @@ private static int numBytes(int v) {
return Integer.BYTES - (Integer.numberOfLeadingZeros(v | 1) >> 3);
}
+ private static int toInt(long value) {
+ if (value < 0 || value > 0xFFFFFFFFL) {
+ throw new ArithmeticException("integer overflow");
+ }
Review Comment:
Great!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]