You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/05/04 15:22:03 UTC

[commons-io] branch master updated: Resue ClosedWriter.CLOSED_WRITER.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new c14b996  Resue ClosedWriter.CLOSED_WRITER.
c14b996 is described below

commit c14b996cb61708f9aa66f5ad0ddabed9ef8b672e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon May 4 11:21:59 2020 -0400

    Resue ClosedWriter.CLOSED_WRITER.
---
 src/test/java/org/apache/commons/io/output/TaggedWriterTest.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/output/TaggedWriterTest.java b/src/test/java/org/apache/commons/io/output/TaggedWriterTest.java
index 4e5652b..1d2d848 100644
--- a/src/test/java/org/apache/commons/io/output/TaggedWriterTest.java
+++ b/src/test/java/org/apache/commons/io/output/TaggedWriterTest.java
@@ -103,8 +103,7 @@ public class TaggedWriterTest  {
     @Test
     public void testOtherException() throws Exception {
         final IOException exception = new IOException("test exception");
-        try (final Writer closed = new ClosedWriter();
-                final TaggedWriter writer = new TaggedWriter(closed)) {
+        try (final TaggedWriter writer = new TaggedWriter(ClosedWriter.CLOSED_WRITER)) {
 
             assertFalse(writer.isCauseOf(exception));
             assertFalse(writer.isCauseOf(new TaggedIOException(exception, UUID.randomUUID())));