Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353093 - IMethod#getAnnotations() doesn't return @SafeVarargs of java.util.Arrays#asList(T...)
Summary: IMethod#getAnnotations() doesn't return @SafeVarargs of java.util.Arrays#asLi...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-26 06:48 EDT by Markus Keller CLA
Modified: 2011-08-02 10:06 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (3.62 KB, patch)
2011-07-26 11:24 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (5.38 KB, patch)
2011-07-26 12:31 EDT, Olivier Thomann CLA
markus.kell.r: review-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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