commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1686460 - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/input/ main/java/org/apache/commons/io/output/ test/java/org/apache/commons/io/input/ test/java/org/apache/commons/io/output/
Date Fri, 19 Jun 2015 17:27:53 GMT
Author: krosenvold
Date: Fri Jun 19 17:27:53 2015
New Revision: 1686460

URL: http://svn.apache.org/r1686460
Log:
Revert "IO-469 Self-supression with try-with-resources"

Things are not as simple as they might seem

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BrokenInputStream.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/BrokenOutputStream.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BrokenInputStreamTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BrokenInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BrokenInputStream.java?rev=1686460&r1=1686459&r2=1686460&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BrokenInputStream.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BrokenInputStream.java
Fri Jun 19 17:27:53 2015
@@ -102,7 +102,7 @@ public class BrokenInputStream extends I
      */
     @Override
     public void close() throws IOException {
-        throw new IOException(exception.getMessage());
+        throw exception;
     }
 
 }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/BrokenOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/BrokenOutputStream.java?rev=1686460&r1=1686459&r2=1686460&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/BrokenOutputStream.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/BrokenOutputStream.java
Fri Jun 19 17:27:53 2015
@@ -79,7 +79,7 @@ public class BrokenOutputStream extends
      */
     @Override
     public void close() throws IOException {
-        throw new IOException(exception.getMessage());
+        throw exception;
     }
 
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BrokenInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BrokenInputStreamTest.java?rev=1686460&r1=1686459&r2=1686460&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BrokenInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BrokenInputStreamTest.java
Fri Jun 19 17:27:53 2015
@@ -95,18 +95,4 @@ public class BrokenInputStreamTest exten
         }
     }
 
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    public void testSelfSupressed(){
-        BrokenInputStream bis = new BrokenInputStream();
-        try {
-            bis.read();
-        } catch (IOException e) {
-            try {
-                bis.close();
-            } catch (IOException e1) {
-                e1.addSuppressed( e); // Simulates try-with resources since we're not jdk7
yet
-            }
-        }
-    }
-
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java?rev=1686460&r1=1686459&r2=1686460&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java
Fri Jun 19 17:27:53 2015
@@ -20,7 +20,6 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import junit.framework.TestCase;
-import org.apache.commons.io.input.BrokenInputStream;
 
 /**
  * JUnit Test Case for {@link BrokenOutputStream}.
@@ -78,18 +77,4 @@ public class BrokenOutputStreamTest exte
         }
     }
 
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    public void testSelfSupressed(){
-        BrokenOutputStream bos = new BrokenOutputStream();
-        try {
-            bos.write(123);
-        } catch (IOException e) {
-            try {
-                bos.close();
-            } catch (IOException e1) {
-                e1.addSuppressed( e); // Simulates try-with resources since we're not jdk7
yet
-            }
-        }
-    }
-
 }



Mime
View raw message