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

Bug 507701

Summary: @noreference should not exclude all overriding methods from API change analysis
Product: [Eclipse Project] PDE Reporter: Markus Keller <markus.kell.r>
Component: API ToolsAssignee: 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:
Description Flags
Fix
none
Fix with test case none

Description Markus Keller CLA 2016-11-17 14:10:54 EST
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.
Comment 1 Vikas Chandra CLA 2016-12-12 07:59:46 EST
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.
Comment 2 Vikas Chandra CLA 2016-12-13 05:16:41 EST
Created attachment 265844 [details]
Fix with test case
Comment 3 Vikas Chandra CLA 2016-12-13 10:05:15 EST
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
Comment 4 Vikas Chandra CLA 2017-01-24 03:18:40 EST
Verified on
Version: Oxygen (4.7)
Build id: I20170123-2000