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

Bug 488494

Summary: [null] external annotations should apply to project dependencies, too
Product: [Eclipse Project] JDT Reporter: Stephan Herrmann <stephan.herrmann>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, manoj.palat, stephan.herrmann
Version: 4.6   
Target Milestone: 4.6 M6   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/67381
https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=c96202cbcb2ef06c10430e9d0f011fe30e627a82
Whiteboard:

Description Stephan Herrmann CLA 2016-02-25 15:13:45 EST
Follow-up from bug 486868:

When Project A depends on B, external annotations can be attached to B.jar, but they are effectless when B is referenced as a project in the workspace.

Apparently, also ClasspathDirectory needs to support an annotationPath (just like ClasspathJar).
Comment 1 Stephan Herrmann CLA 2016-02-25 16:08:07 EST
For the builder this is straight-forward, but unfortunately the reconciler prefers reading source files from dependent projects. For those we have no mechanism in place to overlay external annotations.
Comment 2 Eclipse Genie CLA 2016-02-25 18:25:06 EST
New Gerrit change created: https://git.eclipse.org/r/67381
Comment 3 Stephan Herrmann CLA 2016-02-25 18:46:26 EST
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/67381

Initial draft, several FIXMEs remain, no tests yet, but for simple scenarios this already works. 

Basic strategy for the reconciler: pipe the externalAnnotationPath and eventually an ExternalAnnotationProvider all the way into SourceTypeBinding, where resolveTypesFor(MethodBinding) / resolveTypeFor(FieldBinding) will "improve" the resolved types using an ITypeAnnotationWalker. (A visitor for deeply annotating still needs to be constructed, but the direction seems clear already).


Jay, FYI: this change once more increases builder.State.VERSION.
Comment 5 Stephan Herrmann CLA 2016-02-28 12:37:47 EST
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/67381 was merged to [master].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=c96202cbcb2ef06c10430e9d0f011fe30e627a82
> 

Release for 4.6 M6

Implementation:
- feed info about external annotation location through more call chains
- invented new ExternalAnnotationSuperimposer to massage STB, too.

(incl. some minor bug fixes concerning external annotations here and there).
Comment 6 Manoj N Palat CLA 2016-03-16 05:26:40 EDT
Verified for Eclipse Neon 4.6 M6 with Build id: I20160315-2000