Should be fixed.

On Sat, Jul 5, 2008 at 3:26 PM, sebb <[EMAIL PROTECTED]> wrote:
> On 05/07/2008, sebb <[EMAIL PROTECTED]> wrote:
>> On 05/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>  > Author: bayard
>>  >  Date: Sat Jul  5 11:45:40 2008
>>  >  New Revision: 674223
>>  >
>>  >  URL: http://svn.apache.org/viewvc?rev=674223&view=rev
>>  >  Log:
>>  >  Null protect the stream closing
>>  >
>>  >  Modified:
>>  >     
>> commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
>>  >
>>  >  Modified: 
>> commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
>>  >  URL: 
>> http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java?rev=674223&r1=674222&r2=674223&view=diff
>>  >  
>> ==============================================================================
>>  >  --- 
>> commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
>>  (original)
>>  >  +++ 
>> commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
>>  Sat Jul  5 11:45:40 2008
>>  >  @@ -61,8 +61,12 @@
>>  >                         throw new CompressException("An IO Exception has 
>> occured", e);
>>  >                 } finally {
>>  >                         try {
>>  >  -                               tempFileOutputStream.close();
>>  >  -                               outputStream.close();
>>  >  +                if(tempFileOutputStream != null) {
>>  >  +                               tempFileOutputStream.close();
>>  >  +                }
>>  >  +                if(outputStream != null) {
>>  >  +                               outputStream.close();
>>  >  +                }
>>
>>
>> However, if the first close() throws an IOException, the second will
>>  be skipped ;-)
>>
>
> Actually, Findbugs points out that outputStream is always null at that point 
> ;-)
>
> Looks like the method is incomplete.
>
>>
>>  >                         } catch (IOException e) {
>>  >                                 throw new CompressException("An IO 
>> Exception occured while closing the streams", e);
>>  >                         }
>>  >
>>  >
>>  >
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to