You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/08/10 02:43:59 UTC

logging-log4j2 git commit: Manager resource using try-with-resource.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 0d20cea8e -> b0e892ee9


Manager resource using try-with-resource.

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

Branch: refs/heads/master
Commit: b0e892ee946b44cdb7ff78bf4727bc78564d8873
Parents: 0d20cea
Author: ggregory <gg...@apache.org>
Authored: Sun Aug 9 17:43:58 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Sun Aug 9 17:43:58 2015 -0700

----------------------------------------------------------------------
 .../apache/logging/log4j/io/AbstractLoggerWriterTest.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b0e892ee/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
index 8766290..c40cdf6 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
@@ -70,13 +70,13 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
         out.close();
         replay(out);
 
-        final OutputStream filteredOut =
+        try (final OutputStream filteredOut =
             IoBuilder.forLogger(getExtendedLogger())
                 .filter(out)
                 .setLevel(LEVEL)
-                .buildOutputStream();
-        filteredOut.flush();
-        filteredOut.close();
+                .buildOutputStream()) {
+        	filteredOut.flush();
+        }
         verify(out);
     }