avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1438219 - in /avro/trunk: ./ lang/java/avro/src/main/java/org/apache/avro/io/ lang/java/avro/src/test/java/org/apache/avro/reflect/
Date Thu, 24 Jan 2013 22:03:14 GMT
Author: cutting
Date: Thu Jan 24 22:03:14 2013
New Revision: 1438219

URL: http://svn.apache.org/viewvc?rev=1438219&view=rev
Log:
AVRO-1227. Java: Large ByteBuffers can corrupt output.

Added:
    avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/TestByteBuffer.java
      - copied, changed from r1435303, avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/ByteBufferTest.java
Removed:
    avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/ByteBufferTest.java
Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/BufferedBinaryEncoder.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1438219&r1=1438218&r2=1438219&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu Jan 24 22:03:14 2013
@@ -36,6 +36,8 @@ Trunk (not yet released)
     AVRO-1233. Java: Fix InputBuffer's constructor to use the
     specified initial position. (Mark Wagner via cutting)
 
+    AVRO-1227. Java: Large ByteBuffers can corrupt output. (cutting)
+
 Avro 1.7.3 (6 December 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/BufferedBinaryEncoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/BufferedBinaryEncoder.java?rev=1438219&r1=1438218&r2=1438219&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/BufferedBinaryEncoder.java
(original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/BufferedBinaryEncoder.java
Thu Jan 24 22:03:14 2013
@@ -158,6 +158,7 @@ public class BufferedBinaryEncoder exten
   @Override
   public void writeFixed(ByteBuffer bytes) throws IOException {
     if (!bytes.hasArray() && bytes.remaining() > bulkLimit) {
+      flushBuffer();
       sink.innerWrite(bytes);                     // bypass the buffer
     } else {
       super.writeFixed(bytes);

Copied: avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/TestByteBuffer.java
(from r1435303, avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/ByteBufferTest.java)
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/TestByteBuffer.java?p2=avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/TestByteBuffer.java&p1=avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/ByteBufferTest.java&r1=1435303&r2=1438219&rev=1438219&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/ByteBufferTest.java (original)
+++ avro/trunk/lang/java/avro/src/test/java/org/apache/avro/reflect/TestByteBuffer.java Thu
Jan 24 22:03:14 2013
@@ -47,7 +47,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ByteBufferTest {
+public class TestByteBuffer {
   static class X{
     String name = "";
     ByteBuffer content;



Mime
View raw message