classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cp-patches] Re: FYI: java/io/FileInputStream.java& java/io/FileOutp


From: Jeroen Frijters
Subject: RE: [cp-patches] Re: FYI: java/io/FileInputStream.java& java/io/FileOutputStream.java
Date: Thu, 10 Mar 2005 16:14:56 +0100

Dalibor Topic wrote:
> Sent: Thursday, March 10, 2005 15:24
> To: Jeroen Frijters
> Subject: Re: [cp-patches] Re: FYI: 
> java/io/FileInputStream.java& java/io/FileOutputStream.java
> 
> Jeroen Frijters wrote:
> > Dalibor Topic wrote:
> 
> >>OK, I'll post a patch that does that, without the close() 
> part, after 
> >>some more testing and writing a muave test case. Thanks for 
> your help!
> > 
> > 
> > What exactly do you mean by "the close() part"? The fact that the fd
> > should be closed in the constructor when the exception is thrown?
> 
> Yeah. as you can see in my patch, i don't do that atm, 
> because close() 
> can throw a general IOException, which I'd then have to wrap into the 
> FileNotFoundException, too, or ignore. I wasn't sure about either 
> approach, so I let the close() out and left closing the 
> channel to the finalizer.
> 
> What's your opinion on that? Should I close() & ignore potential 
> exception thrown by close(), or wrap it within 
> FileNotFoundException, or leave closing to gc as I do now?

I would definitely call close() and ignore the exception, since you're
already throwing the FileNotFoundException it's unlikely to mask another
problem (especially since close() is very unlikely to fail in this
case).

Regards,
Jeroen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]