dossett commented on code in PR #3378:
URL: https://github.com/apache/parquet-java/pull/3378#discussion_r2733415412


##########
parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java:
##########
@@ -502,12 +502,7 @@ public EnumType(@JsonProperty("values") List<EnumValue> 
values) {
     }
 
     public Iterable<EnumValue> getValues() {
-      return new Iterable<EnumValue>() {
-        @Override
-        public Iterator<EnumValue> iterator() {
-          return values.iterator();
-        }
-      };
+      return List.copyOf(values);

Review Comment:
   @Fokko That's probably true, but in practice are EnumTypes ever large enough 
to matter?  I don't know.
   
   What about returning `Collections.unmodifiableList(values)` ? I believe that 
would still return a view but be more defensive about preventing modification 
of the underlying data.



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

Reply via email to