bz-62655 throw a BuildException from augment task if the id attribute isn't specified or if the value points to an unknown reference
Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/21de7add Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/21de7add Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/21de7add Branch: refs/heads/master Commit: 21de7add9a935c4ae61716cce269f58db26e949a Parents: 41e6b2c Author: Jaikiran Pai <jaiki...@apache.org> Authored: Sat Aug 25 17:13:31 2018 +0530 Committer: Jaikiran Pai <jaiki...@apache.org> Committed: Sat Aug 25 17:13:31 2018 +0530 ---------------------------------------------------------------------- src/main/org/apache/tools/ant/taskdefs/AugmentReference.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/21de7add/src/main/org/apache/tools/ant/taskdefs/AugmentReference.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/AugmentReference.java b/src/main/org/apache/tools/ant/taskdefs/AugmentReference.java index 637795f..7402d44 100644 --- a/src/main/org/apache/tools/ant/taskdefs/AugmentReference.java +++ b/src/main/org/apache/tools/ant/taskdefs/AugmentReference.java @@ -17,6 +17,7 @@ */ package org.apache.tools.ant.taskdefs; +import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.RuntimeConfigurable; import org.apache.tools.ant.Task; @@ -48,7 +49,7 @@ public class AugmentReference extends Task implements TypeAdapter { log("project reference " + id + "=" + String.valueOf(result), Project.MSG_DEBUG); return result; } - throw new IllegalStateException("Unknown reference \"" + id + "\""); + throw new BuildException("Unknown reference \"" + id + "\""); } /** @@ -63,7 +64,7 @@ public class AugmentReference extends Task implements TypeAdapter { RuntimeConfigurable wrapper = getWrapper(); id = wrapper.getId(); if (id == null) { - throw new IllegalStateException(getTaskName() + " attribute 'id' unset"); + throw new BuildException(getTaskName() + " attribute 'id' unset"); } wrapper.setAttribute("id", null); wrapper.removeAttribute("id");