You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2018/08/25 08:26:00 UTC

[Bug 62655] New: Augment task: IllegalStateException when "id" attribute is missing

https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

            Bug ID: 62655
           Summary: Augment task: IllegalStateException when "id"
                    attribute is missing
           Product: Ant
           Version: 1.10.1
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: rohanpadhye@cs.berkeley.edu
  Target Milestone: ---

Minimum working repro for 'build.xml':

```
<project><augment></augment><target name="init"></target></project>
```

$ ant
Buildfile: /path/to/build.xml

BUILD FAILED
/path/to/build.xml:1: java.lang.IllegalStateException: augment attribute 'id'
unset
        at
org.apache.tools.ant.taskdefs.AugmentReference.hijackId(AugmentReference.java:66)
        at
org.apache.tools.ant.taskdefs.AugmentReference.getProxy(AugmentReference.java:45)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:494)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:464)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:202)
        at
org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:200)
        at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:164)
        at org.apache.tools.ant.Task.perform(Task.java:347)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
        at org.apache.tools.ant.Main.runBuild(Main.java:832)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62655] Augment task: IllegalStateException when "id" attribute is missing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.10.6
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jaikiran Pai <ja...@apache.org> ---
This has now been fixed in master and 1.9.x branches of Ant. The task will now
throw a BuildException as stated in its manual. This will be available 1.10.6
and 1.9.14 releases (whenever they happen).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62655] Augment task: IllegalStateException when "id" attribute is missing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

--- Comment #2 from Rohan Padhye <ro...@cs.berkeley.edu> ---
(In reply to Jaikiran Pai from comment #1)
> As per the manual of this task[1] "id" is a mandatory attribute that you
> need to set. The build.xml sample, you posted doesn't have that attribute
> and hence that error.
> 
> [1] https://ant.apache.org/manual/Tasks/augment.html

@Jaikiran Pai: There is a difference between a build error that is reported
with a simple message and an IllegalStateException being thrown by the core.

Specifically, the core method org.apache.tools.ant.ProjectHelper.parse() should
throw a BuildException when presented with such a build.xml file as referenced
in the manual. However, an unchecked IllegalStateException is thrown instead.
This makes programmatic use of the Ant core API difficult.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62655] Augment task: IllegalStateException when "id" attribute is missing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

--- Comment #4 from Rohan Padhye <ro...@cs.berkeley.edu> ---
(In reply to Jaikiran Pai from comment #3)
> I see. I misunderstood the original report. You are right, unlike as stated
> in the manual, this currently isn't throwing a BuildException and indeed
> appears to be a bug.

Thanks for the quick response and confirmation!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62655] Augment task: IllegalStateException when "id" attribute is missing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

--- Comment #3 from Jaikiran Pai <ja...@apache.org> ---
I see. I misunderstood the original report. You are right, unlike as stated in
the manual, this currently isn't throwing a BuildException and indeed appears
to be a bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62655] Augment task: IllegalStateException when "id" attribute is missing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62655

--- Comment #1 from Jaikiran Pai <ja...@apache.org> ---
As per the manual of this task[1] "id" is a mandatory attribute that you need
to set. The build.xml sample, you posted doesn't have that attribute and hence
that error.

[1] https://ant.apache.org/manual/Tasks/augment.html

-- 
You are receiving this mail because:
You are the assignee for the bug.