ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <foamd...@gmail.com>
Subject Re: svn commit: r518896 - /ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
Date Sat, 17 Mar 2007 02:09:28 GMT
> 1. In Java5, all these things implement Closeable so you only need one
> method.

I wish Java supported open classes - then this sort of trickery
wouldn't be necessary - and yes I did consider adding a
QuietlyClosable interface - but the amount of additional effort
required to refactor everything was considerable

>
> 2.  we've just the more efficient invocation for existing code
>

You mean that the original code was more efficient?  Given the
performance overhead of reflection in 1.4+ is tiny as the VM is very
aware of reflection these days and does a fairly good optimization of
it and given the vast majority of users will be on 1.4+ jdks/vms - I
don't see performance as being a major issue - especially here in
closing files - reading/writing, yes every nano-second counts, closing
a file not so much - in the entire ant build, the FileUtils.close code
was called less than 15 times.

> This doesnt mean it isnt a nice trick, but since the code was there, it
> may as well stay. Unless we can retrofit Closeable to the java1.3+
> classes, which is a serious trick indeed.

This I can accept - the 'if it isn't broke don't fix it' argument -
however I was concentrating in removing an area of duplication - and
copied code is a 'bug' IMHO.

I'm happy to rollback to the original code if that is what people want
- I'm just really interested in why you would say it's a misuse of
reflection - I want to learn more about this :)

Kev

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


Mime
View raw message