You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/03/22 16:26:54 UTC
[09/18] logging-log4j2 git commit: Use ByteBuffer properly
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/LOG4J2-1278-gc-free-logger
Commit: a2b5ed02f6b31de9926f9db3e0094a543e490c11
Parents: 821e620
Author: Mikael Ståldal <mi...@magine.com>
Authored: Wed Mar 9 10:06:13 2016 +0100
Committer: Mikael Ståldal <mi...@magine.com>
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);