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

Hudson commented on THRIFT-2233:
--------------------------------

SUCCESS: Integrated in Thrift #1190 (See 
[https://builds.apache.org/job/Thrift/1190/])
THRIFT-2233 Java compiler should defensively copy its binary inputs (jensg: rev 
bd05f9e06c594683c650feabf240b24834a29c5a)
* compiler/cpp/src/generate/t_java_generator.cc


> Java compiler should defensively copy its binary inputs
> -------------------------------------------------------
>
>                 Key: THRIFT-2233
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2233
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler
>    Affects Versions: 0.9
>            Reporter: Andrew Gaul
>            Assignee: Andrew Gaul
>             Fix For: 0.9.2
>
>         Attachments: THRIFT-2233.patch
>
>
> Currently if someone calls the bufferForField accessor then calls 
> ByteBuffer.get, this mutates the struct's ByteBuffer field.  Subsequent calls 
> to bufferForField return the mutated field and thus calls to ByteBuffer.get 
> return unexpected results.
> {noformat}
>     MyStruct myStruct = ...;
>     byte[] array = new byte[myStruct.bufferForValue().capacity()];
>     someStruct.bufferForValue().get(array);
>     someStruct.bufferForValue().get(array);  // previously, NPE
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to