Community
Participate
Working Groups
Build ID: I20080207-1530 Steps To Reproduce: I have the following Java annotation definition package qq; public @interface TestA { public abstract java.lang.Class[] value(); } If the following snippet is present in the Java code @TestA(value={null}) When I try to get value from IMemberValuePair that corresponds to "value" argument of the annotation I get Double.NaN back. This is definitely unexpected since there is no mention of Double type anywhere in the annotation definition. I would much rather get "null" as a string value or something like that. More information:
This is an error case. Could you please describe how you retrieve the IMemberValuePair. Thanks.
Well, in my code I get IAnnotation from IType, by calling getAnnotations, after that I call IMemberValuePair[] members = ann.getMemberValuePairs(); and then call getValue for each IMemberValuePair object. Nothing fancy
Jerome - would you be answering back Constant.NotAConstant ? (by mistake)
Created attachment 91278 [details] Proposed fix and regression test Indeed the constant of the NullLiteral (Constant.NotAConstant) was returned by mistake. With the fix a K_UNKNOWN member value pair is returned with a null value (as specified by IMemberValuePair#K_UNKNOWN).
Fix and test released for 3.4M6
Verified for 3.4M6 using build I20080324-1300.