diff --git a/src/main/org/apache/tools/ant/util/ChainedMapper.java b/src/main/org/apache/tools/ant/util/ChainedMapper.java index 635a05387..6e07aa6c9 100644 --- a/src/main/org/apache/tools/ant/util/ChainedMapper.java +++ b/src/main/org/apache/tools/ant/util/ChainedMapper.java @@ -35,6 +35,9 @@ public class ChainedMapper extends ContainerMapper { public String[] mapFileName(String sourceFileName) { List inputs = new ArrayList(); List results = new ArrayList(); + // we do this even if the sourceFileName is null. Some + // resources have a null name and users may use a mapper like + // MergeMapper to provide a name for it. results.add(sourceFileName); FileNameMapper mapper = null; diff --git a/src/main/org/apache/tools/ant/util/FileNameMapper.java b/src/main/org/apache/tools/ant/util/FileNameMapper.java index bbd826141..ec85f9d5d 100644 --- a/src/main/org/apache/tools/ant/util/FileNameMapper.java +++ b/src/main/org/apache/tools/ant/util/FileNameMapper.java @@ -52,7 +52,9 @@ public interface FileNameMapper { * omit the source file in question.

* * @param sourceFileName the name of the source file relative to - * some given basedirectory. + * some given basedirectory. Might be {@code + * null} for resources that don't provide a + * name. * @return an array of strings if the rule applies to the source file, or * null if it does not. */