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 2019/08/08 13:58:16 UTC

[commons-io] branch master updated: Better exception messages.

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 f8077a6  Better exception messages.
f8077a6 is described below

commit f8077a6e44f6f448db157b7eec3bd9387fbdfd7c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 8 09:58:12 2019 -0400

    Better exception messages.
---
 .../java/org/apache/commons/io/testtools/YellOnCloseInputStream.java  | 2 +-
 .../java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java | 2 +-
 src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java  | 2 +-
 src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java  | 2 +-
 .../apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java  | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java b/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
index 6f63879..ca8a25b 100644
--- a/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
+++ b/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
@@ -45,7 +45,7 @@ public class YellOnCloseInputStream extends ProxyInputStream {
     /** @see java.io.InputStream#close() */
     @Override
     public void close() throws IOException {
-        throw new IOException("close() was called on OutputStream");
+        throw new IOException(getClass().getSimpleName() + ".close() called.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java b/src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java
index 4737cb9..d005ad5 100644
--- a/src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java
+++ b/src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java
@@ -44,7 +44,7 @@ public class YellOnCloseOutputStream extends ProxyOutputStream {
     /** @see java.io.OutputStream#close() */
     @Override
     public void close() throws IOException {
-        throw new IOException("close() was called on OutputStream");
+        throw new IOException(getClass().getSimpleName() + ".close() called.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java b/src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java
index 8ce7075..2f91ab8 100644
--- a/src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java
+++ b/src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java
@@ -45,7 +45,7 @@ public class YellOnCloseReader extends ProxyReader {
     /** @see java.io.Reader#close() */
     @Override
     public void close() throws IOException {
-        throw new IOException("close() was called on OutputStream");
+        throw new IOException(getClass().getSimpleName() + ".close() called.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java b/src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java
index 026bef2..8ce4b71 100644
--- a/src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java
+++ b/src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java
@@ -44,7 +44,7 @@ public class YellOnCloseWriter extends ProxyWriter {
     /** @see java.io.Writer#close() */
     @Override
     public void close() throws IOException {
-        throw new IOException("close() was called on OutputStream");
+        throw new IOException(getClass().getSimpleName() + ".close() called.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java b/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
index 2660794..cbf8925 100644
--- a/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
+++ b/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
@@ -46,7 +46,7 @@ public class YellOnFlushAndCloseOutputStream extends ProxyOutputStream {
     @Override
     public void flush() throws IOException {
         if (yellOnFlush) {
-            throw new AssertionFailedError("flush() was called on OutputStream");
+            throw new AssertionFailedError(getClass().getSimpleName() + ".flush() called.");
         }
         super.flush();
     }
@@ -55,7 +55,7 @@ public class YellOnFlushAndCloseOutputStream extends ProxyOutputStream {
     @Override
     public void close() throws IOException {
         if (yellOnClose) {
-            throw new AssertionFailedError("close() was called on OutputStream");
+            throw new AssertionFailedError(getClass().getSimpleName() + ".close() called.");
         }
         super.close();
     }