Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-apt-dev] bug in Annotation proxy object

Hi,
My patch is not correct, it is only quick solution ...., but you can see the problem.
You are right, one part of this problem probably lays in classloader.
We use few jar files, and only subset of them contains processors, other contain annotations or helper classes.
Yes eclipse plugin does this job.

The problem has two part:
1) maybe classloader problem ....
2) when annotations contains array of annotations your old construct is not right.
I think that you must create proxies for all elements in array:
                    // ---- JUBU
                    if ( returnObj instanceof AnnotationMirrorImpl ) {
                        Array.set(array, i, Proxy.newProxyInstance(
                                componentType.getClassLoader(),
                                new Class[] { componentType },
                                new AnnotationInvocationHandler( (AnnotationMirrorImpl) returnObj, componentType)) );
                    } else {
                        Array.set(array, i, returnObj);
                    }
                    // --- END

else part may handle ordinary array of class instancies (maybe).

I am not sure what happens if annotation tree  like this is used:

    public @interface TestAnno1 {
        TestAnno2[] value();
    }
   
    public @interface TestAnno2 {
        TestAnno3[] value();
    }
   
    public @interface TestAnno3 {
       TestAnno4[] value();
    }
 
....

maybe that there some recursion processing is necessary.


best regards
J.Burian

p.s. I can create example, but I think that problem is clear now.


Jess Garms wrote:
Juraj - 

Thanks for the patch! We'll take a look at the underlying problem and
submit your patch if it takes care of it.

I'd like to understand why the error is occurring -- do you have a repro
you could attach to the bug? Also, are you using an external jar or an
eclipse plugin to do the annotation processing? It seems like we have a
classloader mismatch, but I'm not certain...

With regards to your question about the CVS repository, Eclipse CVS
committers have to be voted on before being granted access. The best way
to get commit rights is to submit a number of patches to fix bugs or add
features. You're on your way (thanks again for the patch), but it does
take a number of patches before a vote takes place.

Thanks,
Jess

-----Original Message-----
From: jdt-apt-dev-bounces@xxxxxxxxxxx
[mailto:jdt-apt-dev-bounces@xxxxxxxxxxx] On Behalf Of Juraj Burian
Sent: Wednesday, September 07, 2005 4:24 AM
To: Eclipse JDT Apt developers list.
Subject: Re: [jdt-apt-dev] bug in Annotation proxy object

Done,
see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=108917

I have a fix, but I  think that problem is deeper.
See attached file .... I want to work on it, but later.
Can I get  access to the CVS repository with commit rights?

Juraj

Tim Hanson wrote:

  
Please open a bugzilla entry for this.

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT

Tim


 

    
-----Original Message-----
From: jdt-apt-dev-bounces@xxxxxxxxxxx
[mailto:jdt-apt-dev-bounces@xxxxxxxxxxx]On Behalf Of Juraj Burian
Sent: Tuesday, September 06, 2005 7:42 AM
To: jdt-apt-dev@xxxxxxxxxxx
Subject: [jdt-apt-dev] bug in Annotation proxy object


Hello friends,
I want to consult a bug in apt kernel implementation.
Description:
During visiting process we are getting  instance of annotations via 
method: MethodDeclaration.getAnnotation.
Gained instance of annotation is represented by a proxy object.
This proxy object works almost fine, but  when "property" with enum 
result type is called (I found only this case) , 
ClassNotFound exception 
is throwed.
May be that there is similar bug with classes (I mean 
property returning 
a class).

Please let me known if you have a problem to simulate this bug or any 
progress in solution of this bug will happen.

best regards
J.Burian



_______________________________________________
jdt-apt-dev mailing list
jdt-apt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-apt-dev

   

      
_______________________________________________
jdt-apt-dev mailing list
jdt-apt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-apt-dev


 

    

_______________________________________________
jdt-apt-dev mailing list
jdt-apt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-apt-dev


  


Back to the top