[patch] use fileutils.close

2005-06-29 Thread Kev Jackson
- close with fileutils.close instead of manually Kev Index: BaseFilterReader.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/filters/BaseFilterReader.java,v retrieving revision 1.18 diff -u -r1.18

Re: FileUtils.close()

2005-06-23 Thread Stefan Bodewig
On Wed, 22 Jun 2005, Jesse Glick <[EMAIL PROTECTED]> wrote: > That's one option. Another is to just assume the worst and throw the > IOException from whatever.close() One of the problems in addition to changing a whole lot of method signatures is that we want to close files even in the error case

Re: FileUtils.close()

2005-06-22 Thread Alexey Solofnenko
gt; Not sure there was a consensus (or that anyone cared enough). > > > Whenever FileUtils.close() is used, any resulting exceptions are > > swallowed and no logging is performed. I'd like to propose that > > instead of this "silent death" for close, that there is i

Re: FileUtils.close()

2005-06-22 Thread Jesse Glick
Kev Jackson wrote: This came up before, but I forgot what the consensus was Not sure there was a consensus (or that anyone cared enough). Whenever FileUtils.close() is used, any resulting exceptions are swallowed and no logging is performed. I'd like to propose that instead of this &q

Re: FileUtils.close()

2005-06-22 Thread Steve Loughran
Kev Jackson wrote: Alexey N. Solofnenko wrote: Maybe just ioex.printStackTrace()? I thought it would be better to log to the specific calling task (although getting the error message from the exception makes perfect sense). I seem to recall a complaint about close silent behaviour with a

Re: FileUtils.close()

2005-06-21 Thread Kev Jackson
Alexey N. Solofnenko wrote: Maybe just ioex.printStackTrace()? I thought it would be better to log to the specific calling task (although getting the error message from the exception makes perfect sense). I seem to recall a complaint about close silent behaviour with a full filesystem and

Re: FileUtils.close()

2005-06-21 Thread Alexey N. Solofnenko
Maybe just ioex.printStackTrace()? - Alexey. Kev Jackson wrote: This came up before, but I forgot what the consensus was (been a while since I've had time to play with Ant). Whenever FileUtils.close() is used, any resulting exceptions are swallowed and no logging is performed. I'

FileUtils.close()

2005-06-21 Thread Kev Jackson
This came up before, but I forgot what the consensus was (been a while since I've had time to play with Ant). Whenever FileUtils.close() is used, any resulting exceptions are swallowed and no logging is performed. I'd like to propose that instead of this "silent death" fo

Re: Purpose of FileUtils.close(...)

2005-03-04 Thread Peter Reilly
Matt Benson wrote: PING... --- Matt Benson <[EMAIL PROTECTED]> wrote: [SNIP] In talking about whether caught Exceptions should at least be logged, Jesse mentioned "disk full" as an example. We actually have a bugrep (32676) about full directories, and I found a blog today on which a German fell

Re: Purpose of FileUtils.close(...)

2005-03-03 Thread Matt Benson
eWriter to > use > an instance of (hypothetically) oata.util.FOS and > force the Exception on full disk. Any more opinions on this? We could add this to LazyFileOutputStream and check whether performance degrades as Jesse has mentioned he fears. > But it won't help > anything unless we log

Re: Purpose of FileUtils.close(...)

2005-01-29 Thread Jesse Glick
Matt Benson wrote: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4338871 Normal application code should not have to go around making special low-level calls like this. Now, Jesse, that's all well and good to say, but I find it hard to believe you have spent several years working on NetBeans wi

Re: Purpose of FileUtils.close(...)

2005-01-28 Thread Matt Benson
--- Jesse Glick <[EMAIL PROTECTED]> wrote: > Matt Benson wrote: > > [...] the Exception won't be thrown unless you > explicitly sync() the > > FileDescriptor; otherwise the write will take > place in cache and the > > result on disk later will be a zero-byte file. > [...] > > So close() is not e

Re: Purpose of FileUtils.close(...)

2005-01-28 Thread Jesse Glick
Matt Benson wrote: [...] the Exception won't be thrown unless you explicitly sync() the FileDescriptor; otherwise the write will take place in cache and the result on disk later will be a zero-byte file. [...] So close() is not enough, you have to sync()? If true this sounds like a bug in the JRE

Re: Purpose of FileUtils.close(...)

2005-01-25 Thread Matt Benson
--- Jesse Glick <[EMAIL PROTECTED]> wrote: > Matt Benson wrote: > > [...] In talking about whether caught Exceptions > should at least be > > logged, Jesse mentioned "disk full" as an example. > [...] I found a > > blog today [with] a workaround to detect this > condition when writing > > with a F

Re: Purpose of FileUtils.close(...)

2005-01-25 Thread Jesse Glick
Matt Benson wrote: [...] In talking about whether caught Exceptions should at least be logged, Jesse mentioned "disk full" as an example. [...] I found a blog today [with] a workaround to detect this condition when writing with a FOS, using the sync() method of the descriptor available from the str

Re: AspectJ logging was [Re: Purpose of FileUtils.close(...)]

2005-01-20 Thread Steve Loughran
been thinking about the logging within Ant for a while now, and whilst people are suggesting solutions, here's my take. - Log4j works perfectly well for logging, so long as the developer puts the call in at the appropriate place. - FileUtils.close() seems to swallow problems that occur wh

AspectJ logging was [Re: Purpose of FileUtils.close(...)]

2005-01-20 Thread Kev Jackson
t the logging within Ant for a while now, and whilst people are suggesting solutions, here's my take. - Log4j works perfectly well for logging, so long as the developer puts the call in at the appropriate place. - FileUtils.close() seems to swallow problems that occur when closing files - For

Re: Purpose of FileUtils.close(...)

2005-01-19 Thread Matt Benson
nstance of (hypothetically) oata.util.FOS and force the Exception on full disk. But it won't help anything unless we log Exceptions from FileUtils.close(*)... So I am for at least writing to System.err . Another thought: We could create an AntThread class to tie a Thread to a Project. Most places

Re: Purpose of FileUtils.close(...)

2005-01-04 Thread Steve Loughran
(I'm just catching up on 3 weeks worth of mail, sorry for joining in late) >> So what exactly *is* the intention of this method? [...] We wrote it because we were repeating the same code throughout exception handling logic: closing files and swallowing exceptions. try { file=myfile.open(); ...

Re: Purpose of FileUtils.close(...)

2004-12-18 Thread Jesse Glick
Kev Jackson wrote: So what exactly *is* the intention of this method? [...] 1. My intention was only to uniform the codebase around the helper methods that were presumably created for this sort of task. Yes, I was really addressing other committers generally, sorry for the confusion. I should ad

Re: Purpose of FileUtils.close(...)

2004-12-17 Thread Kev Jackson
n tries to close() stream/reader - and this can be replaced by one line FileUtils.close(), then surely this is more readable? OutputStream os = null; try { os = new FileOutputStream(...); printStuffToStream(os); } catch (IOException e) { throw new BuildException(e);

Purpose of FileUtils.close(...) (was: Re: [Patch] FileUtils more minor changes)

2004-12-16 Thread Jesse Glick
Kev Jackson wrote: As an aside, I went through the entire codebase last night and replaced every try { somthing.close() } catch (IOException e) { //swallow exception } with FileUtils.close() So what exactly *is* the intention of this method? IMHO, if an IOException was thrown when some