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

Bug 402915

Summary: Enable API tools for the e4.ui bundles
Product: [Eclipse Project] Platform Reporter: Michael Rennie <Michael_Rennie>
Component: UIAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, daniel_megert, emoffatt, john.arthorne, markus.kell.r, pwebster
Version: 4.3   
Target Milestone: 4.3 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 403190    
Bug Blocks:    
Attachments:
Description Flags
patch none

Description Michael Rennie CLA 2013-03-11 10:32:14 EDT
With all of the new API work happening for M6 and M7 we should enable API tools to make sure the API we are creating is correct - i.e. properly tagged, not leaking internal types, etc.

I enabled the tooling in my workspace for only the *.e4.ui.* bundles and there are 51 API errors, 9 of which are the incorrect use of API tools javadoc tags.

http://wiki.eclipse.org/ApiTools_Architecture#API_Javadoc_Tags
Comment 1 Michael Rennie CLA 2013-03-11 10:40:40 EDT
The ones I have enabled so far:

/org.eclipse.e4.ui.bindings
/org.eclipse.e4.ui.css.core
/org.eclipse.e4.ui.css.swt
/org.eclipse.e4.ui.css.swt.theme
/org.eclipse.e4.ui.di
/org.eclipse.e4.ui.model.workbench
/org.eclipse.e4.ui.services
/org.eclipse.e4.ui.widgets
/org.eclipse.e4.ui.workbench
/org.eclipse.e4.ui.workbench.addons.swt
/org.eclipse.e4.ui.workbench.renderers.swt
/org.eclipse.e4.ui.workbench.renderers.swt.cocoa
/org.eclipse.e4.ui.workbench.swt
/org.eclipse.e4.ui.workbench3
Comment 2 John Arthorne CLA 2013-03-11 11:10:22 EDT
To start with we should just enable it in bundles where we have API that we want to declare for Kepler (the list we went over on the wiki).
Comment 3 Michael Rennie CLA 2013-03-11 11:14:04 EDT
Most of the invalid tag uses are using the @noreference tag on types, when it is only intended to be used on members. 

I can see that it is being used with the intention to say "don't reference this type at all", and that it would be a pain to add the tag to each member of a class, so perhaps we could just correct the type tags and add some additional verbage about what we plan to do with the type?

For example EMenuService:

/**
 * Provide for management of different menus.
 * 
 * This interface will be removed in a future version of Eclipse and should not
 * be referenced, instead clients should use {@link MenuService} directly.
 * 
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 * 
 * @see MenuService
 */
Comment 4 Michael Rennie CLA 2013-03-11 11:33:04 EDT
(In reply to comment #2)
> To start with we should just enable it in bundles where we have API that we
> want to declare for Kepler (the list we went over on the wiki).

I guess that would be the following then:

/org.eclipse.e4.ui.bindings
/org.eclipse.e4.ui.model.workbench
/org.eclipse.e4.ui.services
/org.eclipse.e4.ui.workbench
/org.eclipse.e4.ui.workbench.swt
/org.eclipse.e4.ui.workbench.addons.swt
/org.eclipse.e4.ui.workbench.renderers.swt.cocoa
Comment 5 Markus Keller CLA 2013-03-11 11:42:44 EDT
> Most of the invalid tag uses are using the @noreference tag on types, when
> it is only intended to be used on members. 

Bug 235618.
Comment 6 Michael Rennie CLA 2013-03-20 12:16:38 EDT
Created attachment 228723 [details]
patch

Attaching a patch of the changes so I don't lose them - have to reset my local repo and my git config is all messed up...
Comment 7 Michael Rennie CLA 2013-03-21 11:39:00 EDT
Pushed to: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=dfd5402dd4ee7138075c5070789cbc0982d1e51e

by default all API use problems except for invalid EE accesses are set to warning to avoid peoples workspaces filling with errors when they sync up.
Comment 8 Paul Webster CLA 2013-03-22 09:02:21 EDT
Deleting my external plugins folder and then doing a clean build, I see the following 7 errors.  I got 7 errors in /org.eclipse.e4.ui.workbench.addons.swt.  I added API filters for them and then did Project>Clean all to do a full build.


But the full build fails with 48 errors, API analysis aborted for "X" since its build path is incomplete.
Comment 9 Dani Megert CLA 2013-03-22 09:09:17 EDT
(In reply to comment #8)
> Deleting my external plugins folder and then doing a clean build, I see the
> following 7 errors.  I got 7 errors in
> /org.eclipse.e4.ui.workbench.addons.swt.  I added API filters for them and
> then did Project>Clean all to do a full build.

Your baseline is probably not correct (R4.2 or R4.2.1 instead of R4.2.2). The project is OK.
Comment 10 Dani Megert CLA 2013-06-05 05:18:26 EDT
Filed bug 409934 for the core bundles.