Status: New Owner: ---- CC: anquetil...@gmail.com Labels: Type-Defect Priority-High Component-VerveineJ
New issue 714 by tudor.gi...@gmail.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
Take a look at the example below:
@XmlElement(name = "Time", required = true, type = String.class) protected Date time;
The value of the third attribute of the annotation instance is the actual source code of the String class. Instead, it should be just the string 'String.class'.
Ideally, we would get an actual reference, but the string would do for now.
Updates: Status: Fixed
Comment #1 on issue 714 by anquetil...@gmail.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
fixed and tested
Updates: Labels: Milestone-4.7
Comment #2 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
(No comment was entered for this change.)
Updates: Status: New Labels: -Milestone-4.7 Milestone-4.8
Comment #3 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
The problem seems to be back again. I just checked with the latest VerveineJ and for a code that looks like (taken from Jenkins):
@Restricted(NoExternalUse.class) public transient final NodeProvisioner overallNodeProvisioner = unlabeledNodeProvisioner;
I get an annotation instance that looks like
(FAMIX.AnnotationInstanceAttribute (id: 126) (annotationTypeAttribute (ref: 138875)) (parentAnnotationInstance (ref: 8858)) (value 'public class org.kohsuke.accmod.restrictions.NoExternalUse extends org.kohsuke.accmod.restrictions.DoNotUse /* methods */ [unresolved] public void <init>() [unresolved] public void error(Unresolved type org.kohsuke.accmod.impl.Location, Unresolved type org.kohsuke.accmod.impl.RestrictedElement, Unresolved type org.kohsuke.accmod.impl.ErrorListener)
'))
It would be so great if someone could take a look at this.
will ty to have a look over the week-end (pray for bad weather :-) )
otherwise, will look at it some time next week
nicolas
On 08/09/2013 10:59 PM, moose-technology@googlecode.com wrote:
Updates: Status: New Labels: -Milestone-4.7 Milestone-4.8
Comment #3 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
The problem seems to be back again. I just checked with the latest VerveineJ and for a code that looks like (taken from Jenkins):
@Restricted(NoExternalUse.class) public transient final NodeProvisioner overallNodeProvisioner =
unlabeledNodeProvisioner;
I get an annotation instance that looks like
(FAMIX.AnnotationInstanceAttribute (id: 126) (annotationTypeAttribute (ref: 138875)) (parentAnnotationInstance (ref: 8858)) (value 'public class org.kohsuke.accmod.restrictions.NoExternalUse extends org.kohsuke.accmod.restrictions.DoNotUse /* methods */ [unresolved] public void <init>() [unresolved] public void error(Unresolved type org.kohsuke.accmod.impl.Location, Unresolved type org.kohsuke.accmod.impl.RestrictedElement, Unresolved type org.kohsuke.accmod.impl.ErrorListener)
'))
It would be so great if someone could take a look at this.
Updates: Status: Invalid
Comment #4 on issue 714 by anquetil...@gmail.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
Flagging as Invalid because I was enabled to reproduce the error. tried (not all combinations): - library annotation, project local annotation - library class as parameter, project local class as parameter - annotation on attribute, on method, on class
Updates: Status: New
Comment #5 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
I am reopening it again, but this time I have an example project that shows the problem in the attachment.
If you parse that one with the latest VerveineJ, you get the following AnnotationInstanceAttribute:
(FAMIX.AnnotationInstanceAttribute (id: 5) (annotationTypeAttribute (ref: 14)) (parentAnnotationInstance (ref: 16)) (value '(id=NoId) public class annotationTest.InterceptorClass extends java.lang.Object /* methods */ [unresolved] public void <init>()
'))
Attachments: annotations-test.zip 21.2 KB
Updates: Status: Fixed
Comment #6 on issue 714 by anquetil...@gmail.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
OK thanks for the example I believe it fixed now
Comment #7 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
Great. I will test it right away
Updates: Status: New
Comment #8 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
I tested it and it works in the previous case, but I found another one for which it does not work properly.
Namely:
@Interceptors({InterceptorClass.class, AnotherInterceptorClass.class}) public class AnotherAnnotatedClass { }
produces:
(FAMIX.AnnotationInstanceAttribute (id: 26) (annotationTypeAttribute (ref: 9)) (parentAnnotationInstance (ref: 3)) (value 'InterceptorClass.class'))
The value should be '{InterceptorClass.class, AnotherInterceptorClass.class}'. Or we can make it such that value accepts a collection, and then value can be (value 'InterceptorClass.class' 'AnotherInterceptorClass.class')
Attachments: another-annotations-test.zip 22.9 KB
Comment #9 on issue 714 by tu...@tudorgirba.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
I forgot to mention that I attached a test project.
Updates: Status: Fixed
Comment #10 on issue 714 by anquetil...@gmail.com: VerveineJ does not produce correct values for classes in annotation instances http://code.google.com/p/moose-technology/issues/detail?id=714
This is becoming more difficult.
First I choose the solution of "{InterceptorClass.class, AnotherInterceptorClass.class}" to avoid changing FAMIX and make it unnecessarily complex
second, the problem with the previous pb was that the annotationInstanceAttribute "InterceptorClass.class" was treated as an array of one element by JDT
I corrected it by taking the first element of the array.
Now, {InterceptorClass.class, AnotherInterceptorClass.class} is also an array and it did not show correctly because verveinej took only the first element. This is easy to solve when the array has more than one element. But when it has only one element, I have no way to tell the difference between "InterceptorClass.class" and "{InterceptorClass.class}".
I choose to always consider it is the first solution (so I don't put {} around an array of one) Hope it will be acceptable to all