You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ja...@apache.org on 2018/02/09 07:15:19 UTC
[1/3] ant git commit: Fix broken link in junitreport manual
Repository: ant
Updated Branches:
refs/heads/master c53eb2b91 -> 1899e40b2
Fix broken link in junitreport manual
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/a6429c6a
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/a6429c6a
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/a6429c6a
Branch: refs/heads/master
Commit: a6429c6aa1a713c98528da55059afe9efc2ada59
Parents: 146df36
Author: Jaikiran Pai <ja...@apache.org>
Authored: Wed Feb 7 13:01:54 2018 +0530
Committer: Jaikiran Pai <ja...@apache.org>
Committed: Wed Feb 7 13:01:54 2018 +0530
----------------------------------------------------------------------
manual/Tasks/junitreport.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/a6429c6a/manual/Tasks/junitreport.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/junitreport.html b/manual/Tasks/junitreport.html
index fea85e5..9712014 100644
--- a/manual/Tasks/junitreport.html
+++ b/manual/Tasks/junitreport.html
@@ -171,12 +171,12 @@ These tags can pass XSL parameters to the stylesheet.
<h4>classpath</h4>
<p><em>Since Ant 1.9.5.</em>
-Like for the <a href="../CoreTasks/style.html#classpath">XSLT task</a>,
+Like for the <a href="../Tasks/style.html#classpath">XSLT task</a>,
a nested <classpath> will be used to load the processor.</p>
<h4>factory</h4>
<p><em>Since Ant 1.9.5.</em>
-Like for the <a href="../CoreTasks/style.html#factory">XSLT task</a>,
+Like for the <a href="../Tasks/style.html#factory">XSLT task</a>,
a nested <factory> can be used to specify factory settings.</p>
[2/3] ant git commit: bz-62076 Make IdentityMapper follow the
"mapFileName" API contract to avoid NPE when it deals with a non-matching
source file name
Posted by ja...@apache.org.
bz-62076 Make IdentityMapper follow the "mapFileName" API contract to avoid NPE when it deals with a non-matching source file name
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/e3f52509
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/e3f52509
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/e3f52509
Branch: refs/heads/master
Commit: e3f5250916dc0d9493b45b2d8fc6efe3a0fd9fda
Parents: a6429c6
Author: Jaikiran Pai <ja...@apache.org>
Authored: Fri Feb 9 12:36:54 2018 +0530
Committer: Jaikiran Pai <ja...@apache.org>
Committed: Fri Feb 9 12:36:54 2018 +0530
----------------------------------------------------------------------
WHATSNEW | 7 +++++++
src/etc/testcases/taskdefs/pathconvert.xml | 18 ++++++++++++++++++
.../org/apache/tools/ant/util/IdentityMapper.java | 11 ++++++++++-
.../tools/ant/taskdefs/PathConvertTest.java | 11 +++++++++++
4 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/e3f52509/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 17e68ca..2d4b6f1 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -1,6 +1,13 @@
Changes from Ant 1.9.10 TO Ant 1.9.11
=====================================
+Fixed bugs:
+-----------
+
+ * Fixed NullPointerException when a mappedresource is used in pathconvert
+ Bugzilla Report 62076
+
+
Changes from Ant 1.9.9 TO Ant 1.9.10
====================================
http://git-wip-us.apache.org/repos/asf/ant/blob/e3f52509/src/etc/testcases/taskdefs/pathconvert.xml
----------------------------------------------------------------------
diff --git a/src/etc/testcases/taskdefs/pathconvert.xml b/src/etc/testcases/taskdefs/pathconvert.xml
index 1cdcc8c..5a1cdf7 100644
--- a/src/etc/testcases/taskdefs/pathconvert.xml
+++ b/src/etc/testcases/taskdefs/pathconvert.xml
@@ -17,6 +17,8 @@
-->
<project name="pathconvert">
+ <import file="../buildfiletest-base.xml"/>
+
<path id="testpath">
<pathelement path="${ant.file}" />
</path>
@@ -39,4 +41,20 @@
<pathconvert property="result" refid="testpath" />
</target>
+ <target name="test-nonmatching-mapper" description="test for bug fix bz-62076">
+ <mkdir dir="${output}/mapper-source-dir"/>
+ <!-- create 2 files, one of which will be matched/included by the globmapper
+ later in this target -->
+ <touch file="${output}/mapper-source-dir/file1.txt"/>
+ <touch file="${output}/mapper-source-dir/file2.log"/>
+
+ <pathconvert property="pc">
+ <mappedresources>
+ <fileset dir="${output}/mapper-source-dir"/>
+ <!-- we intentionally exclude one of the files -->
+ <globmapper from="*.log" to="*.txt"/>
+ </mappedresources>
+ </pathconvert>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/ant/blob/e3f52509/src/main/org/apache/tools/ant/util/IdentityMapper.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/IdentityMapper.java b/src/main/org/apache/tools/ant/util/IdentityMapper.java
index 22c6c7e..18a31e5 100644
--- a/src/main/org/apache/tools/ant/util/IdentityMapper.java
+++ b/src/main/org/apache/tools/ant/util/IdentityMapper.java
@@ -46,7 +46,16 @@ public class IdentityMapper implements FileNameMapper {
* @param sourceFileName the name to map.
* @return the source filename in a one-element array.
*/
- public String[] mapFileName(String sourceFileName) {
+ @Override
+ public String[] mapFileName(final String sourceFileName) {
+ if (sourceFileName == null) {
+ // The FileNameMapper#mapFileName contract states that:
+ // "if the given rule doesn't apply to the source file,
+ // implementation must return null"
+ // we consider a null source file name as non-matching and
+ // hence return null
+ return null;
+ }
return new String[] {sourceFileName};
}
}
http://git-wip-us.apache.org/repos/asf/ant/blob/e3f52509/src/tests/junit/org/apache/tools/ant/taskdefs/PathConvertTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/PathConvertTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/PathConvertTest.java
index 41096b6..f29dc12 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/PathConvertTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/PathConvertTest.java
@@ -57,6 +57,17 @@ public class PathConvertTest {
buildRule.executeTarget("testnotargetos");
}
+ /**
+ * Tests that if a {@code mappedresource}, that excludes certain resources, is used in a {@code pathconvert},
+ * then it doesn't lead to a {@link NullPointerException}.
+ *
+ * @see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=62076">bz-62076</a> for more details
+ */
+ @Test
+ public void testNonMatchingMapper() {
+ buildRule.executeTarget("test-nonmatching-mapper");
+ }
+
private void test(String target) {
buildRule.executeTarget(target);
assertEquals("test#" + BUILD_FILENAME, buildRule.getProject().getProperty("result"));
[3/3] ant git commit: Merge 1.9.x branch into master
Posted by ja...@apache.org.
Merge 1.9.x branch into master
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/1899e40b
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/1899e40b
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/1899e40b
Branch: refs/heads/master
Commit: 1899e40b2e3e3297fcd0561b6ad52daffbebcba5
Parents: c53eb2b e3f5250
Author: Jaikiran Pai <ja...@apache.org>
Authored: Fri Feb 9 12:44:37 2018 +0530
Committer: Jaikiran Pai <ja...@apache.org>
Committed: Fri Feb 9 12:44:37 2018 +0530
----------------------------------------------------------------------
WHATSNEW | 3 +++
src/etc/testcases/taskdefs/pathconvert.xml | 18 ++++++++++++++++++
.../org/apache/tools/ant/util/IdentityMapper.java | 10 +++++++++-
.../tools/ant/taskdefs/PathConvertTest.java | 11 +++++++++++
4 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/1899e40b/WHATSNEW
----------------------------------------------------------------------
diff --cc WHATSNEW
index 457af52,2d4b6f1..75e48ff
--- a/WHATSNEW
+++ b/WHATSNEW
@@@ -4,34 -4,12 +4,37 @@@ Changes from Ant 1.10.2 TO Ant 1.10.
Fixed bugs:
-----------
+ * Fixed NullPointerException in ChainedMapper
+ Bugzilla Report 62086
+
+ * Fixed NullPointerException when a mappedresource is used in pathconvert
+ Bugzilla Report 62076
+
-Changes from Ant 1.9.9 TO Ant 1.9.10
-====================================
+Changes from Ant 1.10.1 TO Ant 1.10.2
+=====================================
+
+Changes that could break older environments:
+-------------------------------------------
+
+ * updated the dependency of BCEL to 6.2.
+ Bugzilla Report 61196
+
+ * delete task previously would silently accept wildcard (*)
+ value for the "file" attribute. That's no longer the case
+ and an exception could get thrown by the underlying filesystem
+ for such use. Usage like:
+
+ <delete file="/foo/bar/*.something"/>
+
+ should instead be changed to use resource collections like:
+
+ <delete>
+ <fileset dir="/foo/bar/" includes="*.something"/>
+ </delete>
+
+ * Commons Net 3.6 is binary-code, but not source compatible;
+ see change list of Commons Net 3.0 for details
* The Log4jListener is marked as deprecated as the required log4j library
(in version 1.x) is not maintained any more.
http://git-wip-us.apache.org/repos/asf/ant/blob/1899e40b/src/main/org/apache/tools/ant/util/IdentityMapper.java
----------------------------------------------------------------------
diff --cc src/main/org/apache/tools/ant/util/IdentityMapper.java
index 548803d,18a31e5..dcfa023
--- a/src/main/org/apache/tools/ant/util/IdentityMapper.java
+++ b/src/main/org/apache/tools/ant/util/IdentityMapper.java
@@@ -49,7 -47,15 +49,15 @@@ public class IdentityMapper implements
* @return the source filename in a one-element array.
*/
@Override
- public String[] mapFileName(final String sourceFileName) {
+ public String[] mapFileName(String sourceFileName) {
- return new String[] { sourceFileName };
+ if (sourceFileName == null) {
+ // The FileNameMapper#mapFileName contract states that:
+ // "if the given rule doesn't apply to the source file,
+ // implementation must return null"
+ // we consider a null source file name as non-matching and
+ // hence return null
+ return null;
+ }
+ return new String[] {sourceFileName};
}
}