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:39:34 UTC

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

guiyanakuang commented on a change in pull request #961:
URL: https://github.com/apache/orc/pull/961#discussion_r747178525



##########
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:
       I adjusted the order on purpose, comparing variables on the same side looks better to understand, that's how I feel.
   Of course I don't mind changing it back, but I'd like to mention your opinion.




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