diff --git a/WHATSNEW b/WHATSNEW index f74830a16..99916f40f 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -214,7 +214,7 @@ Other changes: * added casesensitive attribute to and Bugzilla report 16686 -* added handledirchar attribute to and +* added handledirsep attribute to and Bugzilla report 32487 * added a new mapper diff --git a/docs/manual/CoreTypes/mapper.html b/docs/manual/CoreTypes/mapper.html index 32863ecca..9c760fc8c 100644 --- a/docs/manual/CoreTypes/mapper.html +++ b/docs/manual/CoreTypes/mapper.html @@ -70,7 +70,7 @@ directory separator of your current platform. If you need to specify this separator, use ${file.separator} instead. For the regexpmapper, ${file.separator} will not work, as on windows it is the '\' character, and this is an escape character -for regular expressions, one should use the handledirchar attribute +for regular expressions, one should use the handledirsep attribute instead.

Parameters specified as nested elements

@@ -264,7 +264,7 @@ that don't match the from pattern will be ignored.

No - handledirchar + handledirsep If this is specified, the mapper will ignore the difference between the normal directory separator characters - \ and /. @@ -479,7 +479,7 @@ jakarta-ORO and finally try jakarta-regexp. No - handledirchar + handledirsep If this is specified, the mapper will treat a \ character in a filename as a / for the purposes of matching. @@ -512,7 +512,7 @@ jakarta-ORO and finally try jakarta-regexp. <pathconvert property="hd.prop" targetos="windows"> <path path="d\e/f\j.java"/> <chainedmapper> - <regexpmapper from="${basedir}/d/e/(.*)" to="\1" handledirchar="yes"/> + <regexpmapper from="${basedir}/d/e/(.*)" to="\1" handledirsep="yes"/> </chainedmapper> </pathconvert> diff --git a/src/etc/testcases/types/mappers/globmapper.xml b/src/etc/testcases/types/mappers/globmapper.xml index 08e1f2da2..77105046b 100644 --- a/src/etc/testcases/types/mappers/globmapper.xml +++ b/src/etc/testcases/types/mappers/globmapper.xml @@ -1,9 +1,9 @@ - + - + diff --git a/src/etc/testcases/types/mappers/regexpmapper.xml b/src/etc/testcases/types/mappers/regexpmapper.xml index cf3b65f7a..903ce5d9d 100644 --- a/src/etc/testcases/types/mappers/regexpmapper.xml +++ b/src/etc/testcases/types/mappers/regexpmapper.xml @@ -7,9 +7,9 @@ - + - + diff --git a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java index 8ba9e6d61..009220550 100644 --- a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java @@ -62,17 +62,17 @@ public class GlobPatternMapper implements FileNameMapper { */ protected String toPostfix = null; - private boolean handleDirChar = false; + private boolean handleDirSep = false; private boolean caseSensitive = true; /** * Attribute specifing whether to ignore the difference * between / and \ (the two common directory characters). - * @param handleDirChar a boolean, default is false. + * @param handleDirSep a boolean, default is false. * @since Ant 1.6.3 */ - public void setHandleDirChar(boolean handleDirChar) { - this.handleDirChar = handleDirChar; + public void setHandleDirSep(boolean handleDirSep) { + this.handleDirSep = handleDirSep; } /** @@ -156,7 +156,7 @@ public class GlobPatternMapper implements FileNameMapper { if (!caseSensitive) { name = name.toLowerCase(); } - if (handleDirChar) { + if (handleDirSep) { if (name.indexOf('\\') != -1) { name = name.replace('\\', '/'); } diff --git a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java index 18ae2c785..53dfc7a1b 100644 --- a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java @@ -40,17 +40,17 @@ public class RegexpPatternMapper implements FileNameMapper { reg = (new RegexpMatcherFactory()).newRegexpMatcher(); } - private boolean handleDirChar = false; + private boolean handleDirSep = false; private int regexpOptions = 0; /** * Attribute specifing whether to ignore the difference * between / and \ (the two common directory characters). - * @param handleDirChar a boolean, default is false. + * @param handleDirSep a boolean, default is false. * @since Ant 1.6.3 */ - public void setHandleDirChar(boolean handleDirChar) { - this.handleDirChar = handleDirChar; + public void setHandleDirSep(boolean handleDirSep) { + this.handleDirSep = handleDirSep; } /** @@ -102,7 +102,7 @@ public class RegexpPatternMapper implements FileNameMapper { * null if the to pattern did not match */ public String[] mapFileName(String sourceFileName) { - if (handleDirChar) { + if (handleDirSep) { if (sourceFileName.indexOf("\\") != -1) { sourceFileName = sourceFileName.replace('\\', '/'); } diff --git a/src/testcases/org/apache/tools/ant/types/mappers/GlobMapperTest.java b/src/testcases/org/apache/tools/ant/types/mappers/GlobMapperTest.java index 11bddb477..f36cbb4de 100644 --- a/src/testcases/org/apache/tools/ant/types/mappers/GlobMapperTest.java +++ b/src/testcases/org/apache/tools/ant/types/mappers/GlobMapperTest.java @@ -34,8 +34,8 @@ public class GlobMapperTest extends BuildFileTest { public void testIgnoreCase() { executeTarget("ignore.case"); } - public void testHandleDirChar() { - executeTarget("handle.dirchar"); + public void testHandleDirSep() { + executeTarget("handle.dirsep"); } } diff --git a/src/testcases/org/apache/tools/ant/types/mappers/RegexpPatternMapperTest.java b/src/testcases/org/apache/tools/ant/types/mappers/RegexpPatternMapperTest.java index 3ad7f8bcb..92779c81d 100644 --- a/src/testcases/org/apache/tools/ant/types/mappers/RegexpPatternMapperTest.java +++ b/src/testcases/org/apache/tools/ant/types/mappers/RegexpPatternMapperTest.java @@ -34,8 +34,8 @@ public class RegexpPatternMapperTest extends BuildFileTest { public void testIgnoreCase() { executeTarget("ignore.case"); } - public void testHandleDirChar() { - executeTarget("handle.dirchar"); + public void testHandleDirSep() { + executeTarget("handle.dirsep"); } }