You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wagon-commits@maven.apache.org by tr...@apache.org on 2005/09/21 20:25:12 UTC
svn commit: r290775 -
/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java
Author: trygvis
Date: Wed Sep 21 11:25:08 2005
New Revision: 290775
URL: http://svn.apache.org/viewcvs?rev=290775&view=rev
Log:
o Adding null checks in all IoUtils.close() methods.
Modified:
maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java
Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java
URL: http://svn.apache.org/viewcvs/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java?rev=290775&r1=290774&r2=290775&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/util/IoUtils.java Wed Sep 21 11:25:08 2005
@@ -111,7 +111,6 @@
* each row may correspond to up to 4 methods.
*
*/
-
public final class IoUtils
{
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
@@ -720,7 +719,10 @@
{
try
{
- outputStream.close();
+ if ( outputStream != null )
+ {
+ outputStream.close();
+ }
}
catch ( IOException ex )
{
@@ -737,7 +739,10 @@
{
try
{
- reader.close();
+ if ( reader != null )
+ {
+ reader.close();
+ }
}
catch ( IOException ex )
{
@@ -748,13 +753,16 @@
/**
* A IOException ignoring method that simply closes the stream.
*
- * @param wrtier The writer to close.
+ * @param writer The writer to close.
*/
public static void close( Writer writer )
{
try
{
- writer.close();
+ if ( writer != null )
+ {
+ writer.close();
+ }
}
catch ( IOException ex )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org