[ 
https://issues.apache.org/jira/browse/AVRO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982858#action_12982858
 ] 

Doug Cutting commented on AVRO-730:
-----------------------------------

I think remove() should not insert a null at the end of the array.  The primary 
difference between GenericData.Array and ArrayList is that GenericData.Array 
supports reuse: if you're reading a series of List<Foo> in a loop, passing the 
same List<Foo> instance to each call to read() for reuse, you'd like the Foo 
elements to be reused too.  ArrayList won't let you easily achieve this, since 
it always nulls out items past the end and that behavior cannot be overidden.


> Implement set and remove methods from List interface on GenericData.Array
> -------------------------------------------------------------------------
>
>                 Key: AVRO-730
>                 URL: https://issues.apache.org/jira/browse/AVRO-730
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Chase Bradford
>            Assignee: Chase Bradford
>             Fix For: 1.5.0
>
>         Attachments: AVRO-730.patch
>
>
> GenericData.Array throws an UnsupportedOperationException when set() or 
> remove() are used on an instance of it.  I think it's reasonable for those 
> methods to work though, since their implementation is simple and inline with 
> most other List types.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to