From 650c0ab0b12375ac528646794c33c9887ea539ff Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Mon, 7 Mar 2005 17:27:50 +0000 Subject: [PATCH] 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 --- src/main/org/apache/tools/ant/DirectoryScanner.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/DirectoryScanner.java b/src/main/org/apache/tools/ant/DirectoryScanner.java index 8d1e8e639..bd3563820 100644 --- a/src/main/org/apache/tools/ant/DirectoryScanner.java +++ b/src/main/org/apache/tools/ant/DirectoryScanner.java @@ -1179,7 +1179,7 @@ public class DirectoryScanner * @param pattern the pattern to check. * @param name the name to check. * @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) { Vector p = SelectorUtils.tokenizePath(pattern); @@ -1216,12 +1216,13 @@ public class DirectoryScanner /** * Test whether all contents of the specified directory must be excluded. * @param name the directory name to check. + * @return whether all the specified directory's contents are excluded. */ private boolean contentsExcluded(String name) { name = (name.endsWith(File.separator)) ? name : name + File.separator; for (int i = 0; i < excludes.length; 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())) { return true; }