Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353137 - [1.7] Make sure TagBits.AnnotationSafeVarargs and AnnotationPolymorphicSignature are handled everywhere
Summary: [1.7] Make sure TagBits.AnnotationSafeVarargs and AnnotationPolymorphicSignat...
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 12:58 EDT by Markus Keller CLA
Modified: 2011-08-02 09:48 EDT (History)
3 users (show)

See Also:
satyam.kandula: review+


Attachments
Proposed fix (4.04 KB, patch)
2011-07-26 13:36 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (9.21 KB, patch)
2011-07-26 14:15 EDT, Olivier Thomann CLA
no flags 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 12:58:34 EDT
BETA_JAVA7, follow-up to bug 353093 comment 4

The patch in that bug smelled like there could be other opportunities where TagBits.AnnotationSafeVarargs and TagBits.AnnotationPolymorphicSignature should be used.

So I went and opened a call hierarchy on AnnotationSuppressWarnings, AnnotationSafeVarargs, and AnnotationPolymorphicSignature (select the fields in the Outline view). Already the first reference to AnnotationSuppressWarnings in BinaryIndexer#addBinaryStandardAnnotations(long) looked suspicious -- and indeed the search engine doesn't find references to SafeVarargs and PolymorphicSignature.

Fix is to add this and count up the index version:

if ((annotationTagBits & TagBits.AnnotationSafeVarargs) != 0) {
	char[][] compoundName = TypeConstants.JAVA_LANG_SAFEVARARGS;
	addAnnotationTypeReference(compoundName[compoundName.length-1]);
}
if ((annotationTagBits & TagBits.AnnotationPolymorphicSignature) != 0) {
	char[][] compoundName = TypeConstants.JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE;
	addAnnotationTypeReference(compoundName[compoundName.length-1]);
}

Please also check the other references to AnnotationSuppressWarnings or the other standard annotations and make sure the new 1.7 annotations are handled properly in all places where the old standard annotations are already handled.
Comment 1 Olivier Thomann CLA 2011-07-26 13:36:07 EDT
Created attachment 200382 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2011-07-26 14:15:11 EDT
Created attachment 200385 [details]
Proposed fix + regression test

With a regression test for indexing SafeVarargs reference.
Comment 3 Olivier Thomann CLA 2011-07-26 14:15:37 EDT
Satyam, please verify.
Comment 4 Olivier Thomann CLA 2011-07-26 15:21:27 EDT
Released in BETA_JAVA7 branch only.
Comment 5 Satyam Kandula CLA 2011-07-27 01:14:02 EDT
changes are good.
Comment 6 Satyam Kandula CLA 2011-08-02 09:48:35 EDT
Verified for 3.8M1 using build I20110729-1200