This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229393 - Exception when an ant task launches another
Summary: Exception when an ant task launches another
Status: RESOLVED DUPLICATE of bug 192420
Alias: None
Product: platform
Classification: Unclassified
Component: Progress (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 09:16 UTC by scanti
Modified: 2013-08-12 08:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scanti 2013-05-06 09:16:27 UTC
Out NetBeans Platform Based application relies intensively on ANT Tasks. 
Sometimes thie exception occurs: 
java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
	at java.util.Vector.elementAt(Vector.java:427)
	at javax.swing.DefaultListModel.getElementAt(DefaultListModel.java:70)
	at org.netbeans.modules.progress.spi.TaskModel.getSelectedHandle(TaskModel.java:154)
	at org.netbeans.modules.progress.spi.TaskModel.updateSelection(TaskModel.java:91)
	at org.netbeans.modules.progress.spi.Controller.toIndeterminate(Controller.java:158)
	at org.netbeans.modules.progress.spi.InternalHandle.toIndeterminate(InternalHandle.java:182)
	at org.netbeans.api.progress.ProgressHandle.switchToIndeterminate(ProgressHandle.java:106)
	at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.checkForStop(NbBuildLogger.java:204)
	at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.messageLogged(NbBuildLogger.java:583)
	at org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:2254)
	at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2290)
	at org.apache.tools.ant.Project.log(Project.java:470)
	at org.apache.tools.ant.Project.log(Project.java:459)
	at org.apache.tools.ant.PropertyHelper.setNewProperty(PropertyHelper.java:708)
	at org.apache.tools.ant.Project.setNewProperty(Project.java:553)
	at org.apache.tools.ant.taskdefs.Ant.addAlmostAll(Ant.java:646)
	at org.apache.tools.ant.taskdefs.Ant.initializeProject(Ant.java:232)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:345)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:390)
	at org.apache.tools.ant.Target.performTasks(Target.java:411)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at com.streamsim.hmscript.myant.MyBaseAntTask.execute(MyBaseAntTask.java:381)


this is why we call a task from within  a task.
This is the code of execute() in MyBaseAntTask that causes the problem
if (locals.size() > 0 && !(locals.size() == 1 && "".equals(locals.get(0)))) {
                Throwable t = null;
                try {
                    log("Entering " + antFile + "...", Project.MSG_VERBOSE);
                    newProject.fireSubBuildStarted();
                    newProject.executeTargets(locals);
                } catch (BuildException ex) {
                    t = ProjectHelper.addLocationToBuildException(ex, getLocation());
                    throw (BuildException) t;
                } finally {
                    log("Exiting " + antFile + '.', Project.MSG_VERBOSE);
                    newProject.fireSubBuildFinished(t);
                }
            }
Comment 1 Jan Peska 2013-08-12 08:13:51 UTC
This issue was already fixed in 7.2 - changeset http://hg.netbeans.org/core-main/rev/284b651d4b71

*** This bug has been marked as a duplicate of bug 192420 ***