opwvhk commented on code in PR #3307: URL: https://github.com/apache/avro/pull/3307#discussion_r1965316240
########## lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java: ########## @@ -1515,34 +1515,45 @@ else if (value instanceof Utf8) { } - /* + /** * Called to create new array instances. Subclasses may override to use a - * different array implementation. By default, this returns a {@link - * GenericData.Array}. + * different array implementation. By default, this returns a + * {@link GenericData.Array}. + * + * @param old the old array instance to reuse, if possible. If the old array + * is an appropriate type, it may be cleared and returned. + * @param size the size of the array to create. + * @param schema the schema of the array elements. Review Comment: Checking the schema of the returned container is a nice option, but I don't know if it's generally more expensive to do a full equality check as opposed to creating a new collection. I'd refrain from a change like this until we know (and then I fully agree with it). As to other collection types: these should all implement the `Collection` interface anyway. -- 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: issues-unsubscr...@avro.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org