Community
Participate
Working Groups
This is probably another variation of #34466, but requiring at least a generalisation of the Readme for known problems, since I'm not using a custom Ant task or type. My plug-in contains a derived org.apache.tools.ant.BuildListener. It is registered via addBuildListener. For debug, the derived constructor does a cast to its interface. Class constructs ok in caller and in invocation from InternalAntRunner. But, at line 200 of InternalAntRunner project.addBuildListener((BuildListener) listener.newInstance()); a ClassCastException claims that the derived class is not an instance of its interface, although the same cast worked within its constructor. Come on now. Let's get this bug fixed.
You are correct that this is another instance of the type of problem in 34466. Loading classes with different classloaders will always cause all kinds of interesting behavior. Will be added to the README for 3.0.
Added to the 3.0 release notes / readme.
Verified.