Browse Source

Stop being so optimistic; move isDeeper() to 1.7

Add @return to contentsExcluded javadoc
Remove unnecessary File.separator from endsWith comparison in contentsExcluded


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277817 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
650c0ab0b1
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/main/org/apache/tools/ant/DirectoryScanner.java

+ 3
- 2
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -1179,7 +1179,7 @@ public class DirectoryScanner
* @param pattern the pattern to check. * @param pattern the pattern to check.
* @param name the name to check. * @param name the name to check.
* @return whether the pattern is deeper than the name. * @return whether the pattern is deeper than the name.
* @since Ant 1.6.3
* @since Ant 1.7
*/ */
private boolean isDeeper(String pattern, String name) { private boolean isDeeper(String pattern, String name) {
Vector p = SelectorUtils.tokenizePath(pattern); Vector p = SelectorUtils.tokenizePath(pattern);
@@ -1216,12 +1216,13 @@ public class DirectoryScanner
/** /**
* Test whether all contents of the specified directory must be excluded. * Test whether all contents of the specified directory must be excluded.
* @param name the directory name to check. * @param name the directory name to check.
* @return whether all the specified directory's contents are excluded.
*/ */
private boolean contentsExcluded(String name) { private boolean contentsExcluded(String name) {
name = (name.endsWith(File.separator)) ? name : name + File.separator; name = (name.endsWith(File.separator)) ? name : name + File.separator;
for (int i = 0; i < excludes.length; i++) { for (int i = 0; i < excludes.length; i++) {
String e = excludes[i]; String e = excludes[i];
if (e.endsWith(File.separator + "**") && SelectorUtils.matchPath(
if (e.endsWith("**") && SelectorUtils.matchPath(
e.substring(0, e.length() - 2), name, isCaseSensitive())) { e.substring(0, e.length() - 2), name, isCaseSensitive())) {
return true; return true;
} }


Loading…
Cancel
Save