@@ -156,7 +156,7 @@ public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
156156 }
157157
158158 //-----------------------------------------------------------------------
159- @ SuppressWarnings ("resource" ) // 'in' is deliberately not closed
159+ @ SuppressWarnings ({ "resource" , "deprecation" } ) // 'in' is deliberately not closed
160160 public void testCopy_inputStreamToWriter () throws Exception {
161161 InputStream in = new ByteArrayInputStream (inData );
162162 in = new YellOnCloseInputStream (in );
@@ -165,7 +165,7 @@ public void testCopy_inputStreamToWriter() throws Exception {
165165 final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream (baout , true , true );
166166 final Writer writer = new OutputStreamWriter (baout , "US-ASCII" );
167167
168- IOUtils .copy (in , writer );
168+ IOUtils .copy (in , writer ); // deliberately testing deprecated method
169169 out .off ();
170170 writer .flush ();
171171
@@ -174,6 +174,7 @@ public void testCopy_inputStreamToWriter() throws Exception {
174174 assertTrue ("Content differs" , Arrays .equals (inData , baout .toByteArray ()));
175175 }
176176
177+ @ SuppressWarnings ("deprecation" ) // deliberately testing deprecated method
177178 public void testCopy_inputStreamToWriter_nullIn () throws Exception {
178179 final ByteArrayOutputStream baout = new ByteArrayOutputStream ();
179180 final OutputStream out = new YellOnFlushAndCloseOutputStream (baout , true , true );
@@ -184,10 +185,11 @@ public void testCopy_inputStreamToWriter_nullIn() throws Exception {
184185 } catch (final NullPointerException ex ) {}
185186 }
186187
188+ @ SuppressWarnings ("deprecation" ) // deliberately testing deprecated method
187189 public void testCopy_inputStreamToWriter_nullOut () throws Exception {
188190 final InputStream in = new ByteArrayInputStream (inData );
189191 try {
190- IOUtils .copy (in , (Writer ) null );
192+ IOUtils .copy (in , (Writer ) null ); // deliberately testing deprecated method
191193 fail ();
192194 } catch (final NullPointerException ex ) {}
193195 }
@@ -249,7 +251,7 @@ public void testCopy_inputStreamToWriter_Encoding_nullEncoding() throws Exceptio
249251 }
250252
251253 //-----------------------------------------------------------------------
252- @ SuppressWarnings ("resource" ) // 'in' is deliberately not closed
254+ @ SuppressWarnings ({ "resource" , "deprecation" } ) // 'in' is deliberately not closed
253255 public void testCopy_readerToOutputStream () throws Exception {
254256 InputStream in = new ByteArrayInputStream (inData );
255257 in = new YellOnCloseInputStream (in );
@@ -258,7 +260,7 @@ public void testCopy_readerToOutputStream() throws Exception {
258260 final ByteArrayOutputStream baout = new ByteArrayOutputStream ();
259261 final OutputStream out = new YellOnFlushAndCloseOutputStream (baout , false , true );
260262
261- IOUtils .copy (reader , out );
263+ IOUtils .copy (reader , out ); // deliberately testing deprecated method
262264 //Note: this method *does* flush. It is equivalent to:
263265 // OutputStreamWriter _out = new OutputStreamWriter(fout);
264266 // IOUtils.copy( fin, _out, 4096 ); // copy( Reader, Writer, int );
@@ -270,7 +272,8 @@ public void testCopy_readerToOutputStream() throws Exception {
270272 assertTrue ("Content differs" , Arrays .equals (inData , baout .toByteArray ()));
271273 }
272274
273- public void testCopy_readerToOutputStream_nullIn () throws Exception {
275+ @ SuppressWarnings ("deprecation" )
276+ public void testCopy_readerToOutputStream_nullIn () throws Exception { // deliberately testing deprecated method
274277 final ByteArrayOutputStream baout = new ByteArrayOutputStream ();
275278 final OutputStream out = new YellOnFlushAndCloseOutputStream (baout , true , true );
276279 try {
@@ -279,13 +282,13 @@ public void testCopy_readerToOutputStream_nullIn() throws Exception {
279282 } catch (final NullPointerException ex ) {}
280283 }
281284
282- @ SuppressWarnings ("resource" ) // 'in' is deliberately not closed
285+ @ SuppressWarnings ({ "resource" , "deprecation" } ) // 'in' is deliberately not closed
283286 public void testCopy_readerToOutputStream_nullOut () throws Exception {
284287 InputStream in = new ByteArrayInputStream (inData );
285288 in = new YellOnCloseInputStream (in );
286289 final Reader reader = new InputStreamReader (in , "US-ASCII" );
287290 try {
288- IOUtils .copy (reader , (OutputStream ) null );
291+ IOUtils .copy (reader , (OutputStream ) null ); // deliberately testing deprecated method
289292 fail ();
290293 } catch (final NullPointerException ex ) {}
291294 }
0 commit comments