You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/02/01 00:01:35 UTC
svn commit: r1441247 -
/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
Author: sebb
Date: Thu Jan 31 23:01:35 2013
New Revision: 1441247
URL: http://svn.apache.org/viewvc?rev=1441247&view=rev
Log:
Suppress warnings for streams deliberately left unclosed
Modified:
commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java?rev=1441247&r1=1441246&r2=1441247&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java Thu Jan 31 23:01:35 2013
@@ -93,6 +93,7 @@ public class IOUtilsWriteTestCase extend
//-----------------------------------------------------------------------
public void testWrite_byteArrayToWriter() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -106,6 +107,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_byteArrayToWriter_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -126,6 +128,7 @@ public class IOUtilsWriteTestCase extend
//-----------------------------------------------------------------------
public void testWrite_byteArrayToWriter_Encoding() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -140,6 +143,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_byteArrayToWriter_Encoding_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -159,6 +163,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_byteArrayToWriter_Encoding_nullEncoding() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -257,6 +262,7 @@ public class IOUtilsWriteTestCase extend
final CharSequence csq = new StringBuilder(new String(inData, "US-ASCII"));
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -270,6 +276,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_charSequenceToWriter_Encoding_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -375,6 +382,7 @@ public class IOUtilsWriteTestCase extend
final String str = new String(inData, "US-ASCII");
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -388,6 +396,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_stringToWriter_Encoding_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -494,6 +503,7 @@ public class IOUtilsWriteTestCase extend
final String str = new String(inData, "US-ASCII");
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -507,6 +517,7 @@ public class IOUtilsWriteTestCase extend
public void testWrite_charArrayToWriter_Encoding_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -660,6 +671,7 @@ public class IOUtilsWriteTestCase extend
final List<Object> list = Arrays.asList(data);
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -675,6 +687,7 @@ public class IOUtilsWriteTestCase extend
public void testWriteLines_Writer_nullData() throws Exception {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
@@ -690,6 +703,7 @@ public class IOUtilsWriteTestCase extend
final List<Object> list = Arrays.asList(data);
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ @SuppressWarnings("resource") // deliberately not closed
final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(baout, "US-ASCII");