GitHub user jaikiran opened a pull request:
https://github.com/apache/ant/pull/68
bz-62655 throw a BuildException from augment task
Reference https://bz.apache.org/bugzilla/show_bug.cgi?id=62655
The manual of the augment task[1] states that it's supposed to throw a
`BuildException` if the referenced id value isn't known. I admit that the
bugzilla is more about the id attribute not being specified whereas the manual
seems to talk about the value of id being unknown reference, but I think the
issue itself can be considered valid.
The referenced bugzilla issue shows that it throws an
`IllegalStateException`. That exception then does indeed get thrown as a
BuildException[2] but the `reason` that gets reported to the build listeners[3]
is the original cause (in this case the `IllegalStateException`).
The commit here is trivial and it throws the `BuildException` from the
`augment` task when either `id` isn't specified or it points to an unknown
reference. However, given that it appears that this task has always been in
this manner, I wanted to make sure there isn't any specific reason of its
current implementation.
There's already tests for this task which pass both with and without this
change[4]
[1] https://ant.apache.org/manual/Tasks/augment.html
[2]
https://github.com/apache/ant/blob/1.9.x/src/main/org/apache/tools/ant/Task.java#L360
[3]
https://github.com/apache/ant/blob/1.9.x/src/main/org/apache/tools/ant/Task.java#L368
[4]
https://github.com/apache/ant/blob/1.9.x/src/tests/antunit/taskdefs/augment-test.xml
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jaikiran/ant bz-62655-19x
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ant/pull/68.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #68
commit 21de7add9a935c4ae61716cce269f58db26e949a
Author: Jaikiran Pai
Date: 2018-08-25T11:43:31Z
bz-62655 throw a BuildException from augment task if the id attribute isn't
specified or if the value points to an unknown reference
---
-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org