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

Bug 483591

Summary: API Tools view should filter non-API changes (ApiComparator bug for generic methods)
Product: [Eclipse Project] PDE Reporter: Markus Keller <markus.kell.r>
Component: API ToolsAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r, Vikas.Chandra
Version: 4.6Flags: Vikas.Chandra: review+
Target Milestone: 4.6 M6   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/64594
https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=a8c6921369ba8801ab25014f3809e9a49e863063
Whiteboard:
Attachments:
Description Flags
Patch to fix issue mentioned above. none

Description Markus Keller CLA 2015-12-03 11:40:07 EST
The API Tools view should filter non-API changes.

I tried to verify the API changes for bug 478673, but the view showed too many changes for private and package-accessible members. Those are not considered API and should not be shown.

If you still want to show non-API changes, you can add a toggleable filter.
Comment 1 Markus Keller CLA 2015-12-18 06:43:54 EST
This may also be a bug in the ApiComparator when it comes to method signature changes that only affect generics. That's basically all changes in bug 478673.

org.eclipse.pde.api.tools.ui.internal.wizards.CompareOperation#run(IProgressMonitor) looks like it already should only consider externally visible APIs:

	IDelta delta = ApiComparator.compare(.., VisibilityModifiers.API, ..);
Comment 2 Vikas Chandra CLA 2016-01-04 04:51:51 EST
If a private member becomes public, then now you have an additional API and hence that should be shown in API tool view.

However, deltas involving change of private to package access or vice versa are not required.

Do you want to filter out such changes?
Comment 3 Vikas Chandra CLA 2016-01-18 05:28:28 EST
Any feedback for comment#2?
Comment 4 Markus Keller CLA 2016-01-18 13:50:18 EST
(In reply to Vikas Chandra from comment #2)
> If a private member becomes public, then now you have an additional API and
> hence that should be shown in API tool view.

Of course.

> However, deltas involving change of private to package access or vice versa
> are not required.

Yes that's this bug's subject (filter non-API changes).


Steps:

- check out org.eclipse.core.filebuffers from master of
git://git.eclipse.org/gitroot/platform/eclipse.platform.text.git

- Compare With > API Baseline... > I20151124-1000 (or earlier, e.g. 4.5.1)

=> 4 changes are shown in class TextFileBufferOperation; all for private methods.
Example: The non-abstract method org.eclipse.core.filebuffers.manipulation.TextFileBufferOperation.startRewriteSession(ITextFileBuffer) has been added

This method has not been added. Only its return type was changed from the raw Map to Map<String, IDocumentPartitioner>.


It looks like this bug has been fixed for member types (bug 227803), but it's still present for methods and fields. Non-API top-level types are also handled correctly (skipped).
Comment 5 Eclipse Genie CLA 2016-01-18 13:55:19 EST
New Gerrit change created: https://git.eclipse.org/r/64594
Comment 6 Markus Keller CLA 2016-01-18 15:04:17 EST
With https://git.eclipse.org/r/#/c/64594/3 , the API changes in the eclipse.platform.text repo look good.
Comment 7 Vikas Chandra CLA 2016-01-19 01:30:59 EST
If the private field of a @noextend class is changed to protected, do you consider it as an API change?
Comment 8 Markus Keller CLA 2016-01-19 14:08:09 EST
(In reply to Vikas Chandra from comment #7)
> If the private field of a @noextend class is changed to protected, do you
> consider it as an API change?

No. In an @noextend class, things need to be public to be API.
Comment 9 Vikas Chandra CLA 2016-01-19 23:59:31 EST
The patch doesn't address scenario in comment#7.
Comment 10 Vikas Chandra CLA 2016-01-26 00:24:47 EST
Moving to early m6
Comment 11 Vikas Chandra CLA 2016-01-29 06:37:30 EST
Created attachment 259447 [details]
Patch to fix issue mentioned above.

This patch is on top of the gerrit patch which is provided. With this change, private to protected in class like StatusLineContributionItem ( jface code) will be considered as API change and shown in API tool view whereas change of private to protected  in class like ToolBarContributionItem will be a non-API change and not shown in API tools view.
Comment 12 Markus Keller CLA 2016-02-05 06:19:56 EST
(In reply to Vikas Chandra from comment #11)
> Created attachment 259447 [details]
> Patch to fix issue mentioned above.

Yes, I think we need this, but I didn't test the patch yet.

Please insert line breaks before the top-level &&, so that the parallel expressions for access/access2 become apparent. (When you do this, you will realize that you should either disable auto-formatting on Save, or at least enable "Line Wrapping > Never join already wrapped lines".)

Shouldn't each first occurrence of this.currentDescriptorRestrictions actually be this.initialDescriptorRestrictions?
Comment 13 Markus Keller CLA 2016-02-05 06:22:33 EST
> Shouldn't each first occurrence of this.currentDescriptorRestrictions
> actually be this.initialDescriptorRestrictions?

Please release once you've verified this is OK.
Comment 14 Markus Keller CLA 2016-02-05 15:17:01 EST
I've uploaded https://git.eclipse.org/r/#/c/64594/4 with the patch and the change from comment 12. Manually verified with the protected ActionContributionItem#shortenText(...).
Comment 16 Vikas Chandra CLA 2016-02-08 04:14:39 EST
Thanks Markus !
Comment 17 Vikas Chandra CLA 2016-03-15 04:44:37 EDT
verified in
Version: Neon (4.6)
Build id: I20160314-2000