Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 392119 - [1.8][compiler] Annotations with hybrid SE7 & SE8 targets don't make it to class files.
Summary: [1.8][compiler] Annotations with hybrid SE7 & SE8 targets don't make it to cl...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 287648
  Show dependency tree
 
Reported: 2012-10-16 16:57 EDT by Stephan Herrmann CLA
Modified: 2012-10-17 01:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2012-10-16 16:57:33 EDT
In head of BETA_JAVA8 I see 38 regressions (9 in NullAnnotationTest times 4 compliance levels + 2 in AnnotationDependencyTests).

Contrary to my first impression this is not necessarily caused by bug 391331 but a simple bug in Annotation.isRuntimeInvisible().

Fix to follow shortly.
Comment 1 Stephan Herrmann CLA 2012-10-16 17:06:36 EDT
Mh, maybe this is a redish herring, the regression occurred only because in my workspace I had changed @NonNull by adding Target TYPE_USE.

Reverting this change fixed the tests. Still this snippet in Annotation.isRuntimeInvisible() looks fishy to me:

		if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
			return false;
		}

If an annotation can be used as either SE7 or type annotation it will no longer be written to class files, currently.
May initial guess was we should change to

		if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) != 0) {
			return false;
		}

Which fixed most regressions but cause new problems elsewhere :(

Not sure, what will be the result once type annotations are written.

Reducing severity and removing the block regarding 392099 but leaving it open for now for comments.
Comment 2 Srikanth Sankaran CLA 2012-10-17 01:45:32 EDT
(In reply to comment #1)

> If an annotation can be used as either SE7 or type annotation it will no
> longer be written to class files, currently.

This is a bug.

> May initial guess was we should change to
> 
> 		if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) != 0) {
> 			return false;
> 		}

It should actually be:

		// we need to filter out only "pure" type use and type parameter annotations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=392119
		if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
			if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0) {  // not a hybrid target. 
				return false;
			}
		}

Fix and tests will follow shortly.

Thanks for catching this Stephan. 


> Which fixed most regressions but cause new problems elsewhere :(
> 
> Not sure, what will be the result once type annotations are written.
> 
> Reducing severity and removing the block regarding 392099 but leaving it
> open for now for comments.