You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/11/11 03:33:14 UTC

[GitHub] [orc] dongjoon-hyun commented on a change in pull request #961: ORC-492: Avoid potential `ArrayIndexOutOfBoundsException` when getting WriterVersion

dongjoon-hyun commented on a change in pull request #961:
URL: https://github.com/apache/orc/pull/961#discussion_r747176738



##########
File path: java/core/src/java/org/apache/orc/OrcFile.java
##########
@@ -242,7 +242,7 @@ public static WriterVersion from(WriterImplementation writer, int val) {
             val + " for writer " + writer);
       }
       WriterVersion[] versions = values[writer.id];
-      if (val < 0 || versions.length < val) {
+      if (val < 0 || val >= versions.length) {

Review comment:
       If you don't mind, could you keep the previous style like the following?
   ```java
   - if (val < 0 || val >= versions.length) {
   - if (val < 0 || versions.length <= val) {
   ```




-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org