Andrew Gaul created THRIFT-2233:
-----------------------------------
Summary: 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
Fix For: 0.9.2
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.1#6144)