ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <>
Subject Re: Selector examples
Date Wed, 01 May 2002 19:20:35 GMT
At 01:04 PM 5/1/2002 -0400, Erik Hatcher wrote:
>You mean <copy includeemptydirs="true">, right?  <fileset> does not support
>that attribute.

Yep. Should have said that these examples were off the top of my head and 
not tested.

>Also, I was just briefly looking at the code to get a feel for it.  I see in
>ContainsSelector.isSelected that it returns true without closing the file.
>I'm assuming that it should, right?

It should always be closed by the finally block. The question for me in 
that code is whether catching an exception on close should throw an 
exception. If the close fails because the creation of the stream threw an 
exception, this throw may hide the real problem. OTOH, empty catch blocks 
are generally considered bad karma.

What does the combined wisdom of the Ant Dev mailing list think about this 

At 01:23 PM 5/1/2002 -0400, Erik Hatcher wrote:
>They cannot be pre-defined and applied to multiple <fileset>'s, can they?
>It doesn't appear this was taken into account though.

Well, some thought was given to it and there is some code to support it 
within containers. Your question caused me to write some tests for it and 
it turns out to be buggy, though. I've attached an updated which solves part of the problem, but for some 
reason the contained object fails as not being initialized. I can wrap all 
the calls to all attributes so that they check for references if that is 
necessary, but is it? Shouldn't the set of objects returned already have 
their attributes set? Colour me confused on this one. I've attached an 
updated build.xml to demonstrate the problem. With the corrected 
BaseSelectorContainer, test.ref.2 claims that the "contains" attribute 
hasn't been set.

Separate from this is whether selectors should be in 
types/ If that is considered a good thing, I think 
there should be a single container (<selector> which allows only one 
selector within it) rather than the full set of selectors defined under 
<project>. That is trivially done if desired. Perhaps for 1.6, though?

View raw message