Hi,
This patch fixes an odd class loading problem, where the classes used by a
BuildListener's buildFinished() method cannot be loaded. This is how the
problem happens:
- The task is loaded via an AntClassLoader (e.g. using <taskdef> with a
classpath specified).
- The AntClassLoader adds a BuildListener to the project, so that it can
clean up when the build finishes.
- When the task executes, it adds a BuildListener to its project.
- The build finishes, and a build finished event is fired.
- The AntClassLoader's buildFinished() method is called. The class loader
cleans itself up.
- The task's buildFinished() method is called. If this method uses classes
which have not been loaded, the AntClassLoader's findClass() method is
called.
- The AntClassLoader is in an unusable state, and a NPE is thrown.
This patch defers AntClassLoader (and IntrospectionHelper) cleanup until
after the build finished event has been handled by all build listeners.
Adam
|