Re: [aspectwerkz-dev] important patch for AnnotationCTask

the_mindstorm <[email protected]> Sun, 31 Oct 2004 23:24:04 +0200
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
Quote [Alexandre Vasseur]:
> Hi
> 
> Would it be possible to have a sample / a test that shows the issue
> first ? How can I reproduce it on my side ?
> 

Hi Alex.

The way to scenario reproducing the problem is about defining custom annotations (I think 
test/annotation).
If you convert the samples:annotationc task to use instead the AnnotationCTask the test will not 
work anymore as the annotations are not injected (you will get a ClassCastException from 
AnnotationManager.instantiateAnnotation method: Annotation class was loaded by Ant specific 
classloader and the custom annotation class is loaded by the URLClassLoader which is a sibling and 
not a child of Ant classloader). This problem is the same as the one with AspectWerkzCTask.

Pls let me know if you can reproduce it the way explained above. Otherwise I think I can send you 
some short sample.

:the_mindstorm

> Thx
> Alex
> 
> 
> On Thu, 28 Oct 2004 23:59:20 +0300, the_mindstorm
> <[email protected]> wrote:
>> Hi!
>> 
>> Playing around with the ant tasks for annotation and offline weaving I have found a problem while
>> compiling custom annotations.
>> It was again a problem regarding the classloaders: the classloader used for annotations was a
>> sibling of Ant class loader this giving some ClassCastExceptions in AnnotationManager.
>> 
>> Attached is the patched version which uses the same mechanism as the one used for setting the class
>> loaders for AspectWerkzCTask.
>> 
>> Please let me know what you think.
>> 
>> :the_mindstorm
>> 
>> 
>>
>