Browse Source

Expand tasks did not behave as expected with PatternSets.

PR: 11100
Submitted by: gudnabrsam@yahoo.com


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273572 13f79535-47bb-0310-9956-ffa450edef68
master
Magesh Umasankar 22 years ago
parent
commit
e2d3dfc0c9
2 changed files with 6 additions and 8 deletions
  1. +1
    -0
      WHATSNEW
  2. +5
    -8
      src/main/org/apache/tools/ant/taskdefs/Expand.java

+ 1
- 0
WHATSNEW View File

@@ -19,6 +19,7 @@ Changes that could break older environments:


Fixed bugs: Fixed bugs:
----------- -----------
* Expand tasks did not behave as expected with PatternSets.


* <property environment=... /> now works on OS/400. * <property environment=... /> now works on OS/400.




+ 5
- 8
src/main/org/apache/tools/ant/taskdefs/Expand.java View File

@@ -182,14 +182,13 @@ public class Expand extends Task {
String name = entryName; String name = entryName;
boolean included = false; boolean included = false;
for (int v = 0; v < patternsets.size(); v++) { for (int v = 0; v < patternsets.size(); v++) {
included = true;
PatternSet p = (PatternSet) patternsets.elementAt(v); PatternSet p = (PatternSet) patternsets.elementAt(v);
String[] incls = p.getIncludePatterns(getProject()); String[] incls = p.getIncludePatterns(getProject());
if (incls != null) { if (incls != null) {
for (int w = 0; w < incls.length; w++) { for (int w = 0; w < incls.length; w++) {
boolean isIncl =
DirectoryScanner.match(incls[w], name);
if (isIncl) {
included = true;
included = DirectoryScanner.match(incls[w], name);
if (included) {
break; break;
} }
} }
@@ -197,10 +196,8 @@ public class Expand extends Task {
String[] excls = p.getExcludePatterns(getProject()); String[] excls = p.getExcludePatterns(getProject());
if (excls != null) { if (excls != null) {
for (int w = 0; w < excls.length; w++) { for (int w = 0; w < excls.length; w++) {
boolean isExcl =
DirectoryScanner.match(excls[w], name);
if (isExcl) {
included = false;
included = !(DirectoryScanner.match(excls[w], name));
if (!included) {
break; break;
} }
} }


Loading…
Cancel
Save