Bug 19386 - <filesmatch> condition evaluates to true when both files cannot be found
Summary: <filesmatch> condition evaluates to true when both files cannot be found
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.5.1
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2003-04-28 14:53 UTC by Dominique Devienne
Modified: 2008-11-24 03:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Devienne 2003-04-28 14:53:36 UTC
This clearly contradicts the doc that says:

Nonexistence of either file results in "false".

Which by extension means it should result in "false" if both files are 
nonexistent. --DD
Comment 1 Stefan Bodewig 2003-04-29 12:41:36 UTC
unless "either" means "exclusive or".

Looking at the code, this happens on purpose.  No file equals No file has a certain
kind of logic.  Maybe we need to clarify the docs?
Comment 2 Dominique Devienne 2003-04-29 14:29:16 UTC
I personnally think it's a mistake, and often time comparing two non-existent 
files is simply a mistake, as it was for me. But I guess I'm not surprised I'm 
the only one who thinks different. So now I have experience with <filesmatch>, 
and I'll simply leave the next guy fall into the same trap I did, but at least 
s/he will have the benefit of some doc to explain the counter-intuitive 
behavior that goes against the principle of least surprise.

Thanks Stefan, and nevermid. --DD
Comment 3 Stefan Bodewig 2003-04-30 15:47:42 UTC
Who said it was just you?

How about an additional attribute to control the behavior?  I can see use cases
for both results if both files do not exist.
Comment 4 Steve Loughran 2003-08-01 06:15:26 UTC
Thinking about this, I think the default for nonexistent files is false too. It
makes more sense using this as a test in a condition to decide whether to do
something. If neither file is there, there isnt a match,.