| Summary: | @noreference should not exclude all overriding methods from API change analysis | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Markus Keller <markus.kell.r> | ||||||
| Component: | API Tools | Assignee: | Vikas Chandra <Vikas.Chandra> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Vikas.Chandra | ||||||
| Version: | 4.7 | ||||||||
| Target Milestone: | 4.7 M5 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 265830 [details]
Fix
If a method addition is overriding a method ( with no reference restriction), it will not be treated like an overriden delta but a new method addition delta. That will ensure normal API tool analysis on it ( like since tag etc).
All the 2500+ tests run fine with this but this scenario warrants a test case. I will add it later.
Created attachment 265844 [details]
Fix with test case
All test cases run fine with the fix with updated test case. Fixed via http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=06356d4863cb71d796fdb8e989d93fc46085d14d Verified on Version: Oxygen (4.7) Build id: I20170123-2000 |
I20161116-2000 @noreference should not exclude all overriding methods from API change analysis. Example: - Add this method to an API class (e.g. SWT's class Device): /** * * @noreference This method is not intended to be referenced by clients. */ public void newMethod() { } - Add this method to an API subclass of the above class (e.g. SWT's Printer): @Override public void newMethod() { super.newMethod(); } => The new method in the subclass is an API method. Its Javadoc doesn't tell anything about being non-API, and an invocation from another bundle confirms this. E.g. this client in JFace: void use(Device d, Printer p) { d.newMethod(); // illegally references method Device.newMethod() p.newMethod(); // no problem! } API Tools needs to treat the subclass method as if the @noreference superclass method wouldn't exist. The subclass method needs either an @since or an @noreference tag.