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.
[current sources] Consider following code: AntTargetExecutor.Env env = new AntTargetExecutor.Env(); env.setLogger(out); AntTargetExecutor executor = AntTargetExecutor.createTargetExecutor(env); ExecutorTask et = executor.execute(ac, new String[] {target}); In this case, the ant module does not try to allocate the InputOutpu, and uses provided logger instead. But, in TargetExecutor.java:254 the variable "io" (which is null in this case) is used to get an input stream, and so a NullPointerException is thrown. This makes the above code unusable.
Ant is the correct component.
Right, will fix. BTW you are probably the only user of ATE.E.setLogger. Can I ask what you are using it for?
Presumably broken by recent change to support console input.
Well, my use case is probably not the correct one: I am using it to parse the errors from the output. I am planing to re-write the tasks to provide the std. notation, but I did not have time to do it yet (it does not seem trivial for me, but I did not try hard).
There is another possible use-case: (AFAIK) it is not possible to modify the name of the output tab through the API, so if anybody wants to use a special name of the tab, it is necessary to use this approach.
Definitely using this API to work around hyperlink parsing is not an intended use case; cf. #42525. It is true there is no API to specify a special tab name. That could easily be added if someone wants it (file it separately of course). Using a custom output stream is a very poor way to accomplish that though - you will lose all sorts of functionality. Actually there are no intended use cases for ATE.E.sL! It was added during the old Projects work to support the now-dead Compiler API #2.
I have created a new issue for the second use-case: issue #43072. I would suggest to make the setLogger method deprecated, so everyone will that it should not be used.
committed Up-To-Date 1.40 ant/src/org/apache/tools/ant/module/run/TargetExecutor.java Also deprecating ATE.E.sL: committed Up-To-Date 1.4 ant/src/org/apache/tools/ant/module/api/AntTargetExecutor.java
Seems OK in current sources.