liyafan82 commented on a change in pull request #8876:
URL: https://github.com/apache/arrow/pull/8876#discussion_r539146792



##########
File path: java/vector/src/main/codegen/templates/UnionListWriter.java
##########
@@ -194,13 +194,13 @@ public void endList() {
   @Override
   public void startList() {
     vector.startNewValue(idx());
-    writer.setPosition(vector.getOffsetBuffer().getInt((idx() + 1) * 
OFFSET_WIDTH));
+    writer.setPosition(vector.getOffsetBuffer().getInt(((long) idx() + 1L) * 
OFFSET_WIDTH));

Review comment:
       nit: By adding 1L, the result of `idx()` is automatically cast to a 
long, so the explicit cast can be avoided?




----------------------------------------------------------------
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.

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


Reply via email to