git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@540055 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -497,8 +497,10 @@ public class Files extends AbstractSelectorContainer | |||||
| } | } | ||||
| private boolean hasPatterns(PatternSet ps) { | private boolean hasPatterns(PatternSet ps) { | ||||
| return ps.getIncludePatterns(getProject()).length > 0 | |||||
| || ps.getExcludePatterns(getProject()).length > 0; | |||||
| String[] includePatterns = ps.getIncludePatterns(getProject()); | |||||
| String[] excludePatterns = ps.getExcludePatterns(getProject()); | |||||
| return (includePatterns != null && includePatterns.length > 0) | |||||
| || (includePatterns != null && excludePatterns.length > 0); | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,25 @@ | |||||
| <project xmlns:au="antlib:org.apache.ant.antunit" default="antunit"> | |||||
| <import file="../antunit-base.xml" /> | |||||
| <property name="existingFile" value="${basedir}/build.xml" /> | |||||
| <files id="files"> | |||||
| <include name="${existingFile}" /> | |||||
| </files> | |||||
| <target name="test-directUse" description="Bug 42397 - works fine"> | |||||
| <path id="path"> | |||||
| <files> | |||||
| <include name="${existingFile}" /> | |||||
| </files> | |||||
| </path> | |||||
| </target> | |||||
| <target name="test-refid" description="Bug 42397"> | |||||
| <path id="path"> | |||||
| <files refid="files" /> | |||||
| </path> | |||||
| </target> | |||||
| </project> | |||||