ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Execute.java
Date Tue, 27 Apr 2004 15:41:41 GMT
Stefan Bodewig wrote:

>On 27 Apr 2004, <mbenson@apache.org> wrote:
>
>  
>
>>           } catch (InterruptedException e) {
>>               process.destroy();
>>  +        } finally {
>>  +            try {
>>  +                process.getInputStream().close();
>>  +                process.getOutputStream().close();
>>  +                process.getErrorStream().close();
>>  +            } catch (IOException eyeOhEx) {
>>           }
>>       }
>>    
>>
>
>Is it save to call getXYZStream on a Process instance after it has
>terminated or even been destroyed?  I've never tried it and the
>Javadocs don't say anything.
>
>  
>
Also each of the closees should be in their own try-catch.
try {
   process.getInputStream().close();
} catch (Throwable t) {
    // Ignore exception
}
should work

Peter

>Stefan
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message