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

ASF GitHub Bot commented on AVRO-2268:
--------------------------------------

thiru-apache closed pull request #382: AVRO-2268 Fix FooBarSpecificRecord case
URL: https://github.com/apache/avro/pull/382
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java 
b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
index 8f525b4cd..860669468 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
@@ -1484,9 +1484,10 @@ protected FooBarSpecificRecord genSingleRecord(Random r) 
{
       }
 
       try {
+        String[] nicknames = { randomString(r), randomString(r) };
         return FooBarSpecificRecord.newBuilder().setId(r.nextInt())
             .setName(randomString(r))
-            .setNicknames(Arrays.asList(randomString(r), randomString(r)))
+            .setNicknames(new ArrayList<String>(Arrays.asList(nicknames)))
             .setTypeEnum(typeEnums[r.nextInt(typeEnums.length)])
             .setRelatedids(relatedIds).build();
       } catch (Exception e) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Perf.java SpecificRecord input data not working
> -----------------------------------------------
>
>                 Key: AVRO-2268
>                 URL: https://issues.apache.org/jira/browse/AVRO-2268
>             Project: Apache Avro
>          Issue Type: Test
>          Components: java
>            Reporter: Raymie Stata
>            Assignee: Raymie Stata
>            Priority: Major
>
> In {{FooBarSpecificRecordTest.genSingleRecord}}, the {{nicknames}} field is 
> given an instance of what is returned by {{ArrayList.asList}}, which does 
> _not_ support the {{clear}} method.  When reusing objects during a read, the 
> {{clear}} method is used to clear the contents of array-valued fields during 
> reading, which causes an {{OperationNotSupported}} exception.  So 
> {{genSingleRecord}} needs to change to set {{nicknames}} to a type that 
> implements {{clear}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to