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

Bug 353137

Summary: [1.7] Make sure TagBits.AnnotationSafeVarargs and AnnotationPolymorphicSignature are handled everywhere
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: deepakazad, Olivier_Thomann, satyam.kandula
Version: 3.7Flags: satyam.kandula: review+
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Proposed fix + regression test none

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