Repository: logging-log4j2
Updated Branches:
  refs/heads/gelf-layout-gc-free 821e6201d -> a2b5ed02f


Use ByteBuffer properly


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a2b5ed02
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a2b5ed02
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a2b5ed02

Branch: refs/heads/gelf-layout-gc-free
Commit: a2b5ed02f6b31de9926f9db3e0094a543e490c11
Parents: 821e620
Author: Mikael StÃ¥ldal <[email protected]>
Authored: Wed Mar 9 10:06:13 2016 +0100
Committer: Mikael StÃ¥ldal <[email protected]>
Committed: Wed Mar 9 10:06:13 2016 +0100

----------------------------------------------------------------------
 .../apache/logging/log4j/test/appender/EncodingListAppender.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a2b5ed02/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
 
b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
index 810e18f..2e93a1c 100644
--- 
a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
+++ 
b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
@@ -47,14 +47,14 @@ public class EncodingListAppender extends ListAppender {
             Destination content = new Destination();
             content.byteBuffer.put(layout.getHeader());
             layout.encode(event, content);
-            content.getByteBuffer().rewind();
+            content.getByteBuffer().flip();
             byte[] record = new byte[content.getByteBuffer().remaining()];
             content.getByteBuffer().get(record);
             data.add(record);
         } else {
             Destination content = new Destination();
             layout.encode(event, content);
-            content.getByteBuffer().rewind();
+            content.getByteBuffer().flip();
             byte[] record = new byte[content.getByteBuffer().remaining()];
             content.getByteBuffer().get(record);
             write(record);

Reply via email to