Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353093

Summary: IMethod#getAnnotations() doesn't return @SafeVarargs of java.util.Arrays#asList(T...)
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, deepakazad, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Proposed fix + regression test markus.kell.r: review-

Description Markus Keller CLA 2011-07-26 06:48:59 EDT
BETA_JAVA7, follow-up to bug 352464 comment 5

IMethod#getAnnotations() doesn't return the @SafeVarargs annotation of java.util.Arrays#asList(T...).

This can be seen in the Javadoc hover, which doesn't show the annotation on this method.
Comment 1 Olivier Thomann CLA 2011-07-26 07:54:27 EDT
Should be trivial to fix.
Comment 2 Olivier Thomann CLA 2011-07-26 11:24:54 EDT
Created attachment 200369 [details]
Proposed fix
Comment 3 Olivier Thomann CLA 2011-07-26 11:25:12 EDT
I'll add a regression test.
Comment 4 Olivier Thomann CLA 2011-07-26 12:31:15 EDT
Created attachment 200376 [details]
Proposed fix + regression test

Same patch with a regression test.
Comment 5 Markus Keller CLA 2011-07-26 13:04:52 EDT
The fix looks and behaves well.

But the code changes had that certain smell, so I opened bug 353137 ;-).
Comment 6 Olivier Thomann CLA 2011-07-26 13:11:28 EDT
I was about to go over all usages to check if we missed some. I found the one in BinaryIndexer, but I didn't want to add them there as part of that patch.
Comment 7 Markus Keller CLA 2011-07-26 13:14:51 EDT
Comment on attachment 200376 [details]
Proposed fix + regression test

Hold on, this patch is not good. In ClassFileInfo, the removal of JAVA_LANG_ANNOTATION_INHERITED is wrong.

It e.g. makes the @Inherited annotation on javax.xml.ws.ServiceMode non-existent in the JavaElement view.
Comment 8 Olivier Thomann CLA 2011-07-26 13:18:42 EDT
This was unintended :-(. Thanks for the fix.
Comment 9 Olivier Thomann CLA 2011-07-26 13:42:50 EDT
Released in BETA_JAVA7 branch only.
Comment 10 Ayushman Jain CLA 2011-08-02 10:06:22 EDT
Verified for 3.8M1 using build I20110729-1200