In UnknownElement.execute() the variable realThing is defined to null. This makes it impossible to use BuildEvent (via BuildListener) and getTask(), e.g. public void taskFinished(BuildEvent event) { Task task = event.getTask(); if (task instanceof UnknownElement) { UnknownElement ue = (UnknownElement)task; System.out.println("UE TASK: " + ue.getTask()); // WILL PRINT NULL } } The following change in UnknownElement.execute would make this work, but I guess it creates other problems with GC?: // the task will not be reused ( a new init() will be called ) // Let GC do its job //realThing = null; ****** THIS LINE WAS REMOVE TO GET IT TO WORK!
Is it possible to investigate this bug? Currently BuildListeners does only work for doing simple things such as logging events. If this bug is fixed it would be possible for IDE:s to extract information such as classpath from the javac task and add that to IDE:s project settings. Integration between ant and IDE:s would be greatly enhanced.
The reference to GC is a warning sign, it means things must have leaked badly in the past. As such, even if we look at it (and reminding us helps) it would have to be done looking at the impact the value has on memory consumption.
The content of attachment 35241 [details] has been deleted for the following reason: bogus attempt of a hack