This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 509868 - Mark MInput and MInputPart for deletion
Summary: Mark MInput and MInputPart for deletion
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.9 M3   Edit
Assignee: Olivier Prouvost CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 530772 562813
  Show dependency tree
 
Reported: 2017-01-03 11:36 EST by Olivier Prouvost CLA
Modified: 2020-05-05 04:48 EDT (History)
7 users (show)

See Also:


Attachments
Requested model (757.94 KB, text/plain)
2019-02-25 13:49 EST, Ed Willink CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Prouvost CLA 2017-01-03 11:36:23 EST
See bug #416399. 

With Oxygen version, it could be cool to remove it definitively ?
Comment 1 Lars Vogel CLA 2018-02-06 07:09:21 EST
I agree it would be good to mark them for deletion. 

We need to add @noreference, @noextend and @noimplement w annotation to the generated class / methods. See https://wiki.eclipse.org/Eclipse/API_Central/API_Removal_Process

Olivier, do you know how to do this for the generated classes?
Comment 2 Olivier Prouvost CLA 2018-02-06 08:35:58 EST
If we remove those classes we have to remove their definitions also from the UIElements.ecore and regenerate the code... 

The class UIEvents must be partially regenerated (see the comment line 32 about GenTopic).
Comment 3 Lars Vogel CLA 2018-02-06 08:41:19 EST
We first have to mark it for deletion before removing it, see wiki from Comment 1. Do you know how to add the annotations to the generated code?
Comment 4 Thomas Schindl CLA 2018-02-06 08:55:08 EST
Don't for get to visualize that they are deprecated in the e4xmi-Editor
Comment 5 Olivier Prouvost CLA 2018-02-06 09:24:06 EST
I don't know how to add annotations in the EMF generated code. 

But I think the good way would be : 

- Remove the Class from the UIElements.ecore
- Keep the old generated Input classes and annotate them manually
- Regenerate the EMF code (it will not delete the Input classes)

I think it would be the good process...
Comment 6 Olivier Prouvost CLA 2018-02-06 09:43:43 EST
Actually : 

- MInput has been annotated as deprecated by Lars in August 2015
- MInputPart has been annotated as deprecated, and no implement by Paul Elder in 2013 in the java doc and in 2015 by Lars before interface definition. 

So could we say that the deprecation has been done for a while and that we can remove them now ? 

It means : 

- Remove both EClasses in the model
- Remove usage in UIEvents
- Remove References in editors if any

Do you agree ?
Comment 7 Lars Vogel CLA 2018-02-06 09:47:49 EST
(In reply to Olivier Prouvost from comment #6)
> Actually : 
> 
> - MInput has been annotated as deprecated by Lars in August 2015
> - MInputPart has been annotated as deprecated, and no implement by Paul
> Elder in 2013 in the java doc and in 2015 by Lars before interface
> definition. 

IIRC I did not mark them for deletion. Deprecation is unfortunately not the same as marking it for deletion. I think we have to follow your suggestion from Comment 5. 

First step is to ask PMC for deletion approval. I do this later in our PMC call.
Comment 8 Dani Megert CLA 2018-02-06 11:37:48 EST
We discussed this in the PMC.

Before approving to mark them for deletion, someone has to investigate how much work needs to be done to do it. Both have over 50 references.
Comment 9 Olivier Prouvost CLA 2018-02-06 13:27:02 EST
I started to investigate by removing MInput, MInputPart and all methods related to these classes. 

Nevertheless, there are still some impacts in EPartService where there is still a legacy method : 

   Collection<MInputPart> getInputParts(String inputUri)

this method has never been annotated with @deprecated while MInputPart was. Can we remove it anyway or shall we wait still for 2 years ? 

So in this first commit I will keep the 2 interfaces, remove all implementations and set the getInputParts as deprecated. I will also remove all EMF constants related to INPUT and INPUT_PART and fix a lot of different UI in ui.tools... 

Impacts are in this 2 projects : (-> There will be 2 reviews to synchronize...)

eclipse.platform.ui
eclipse.platform.ui.tools
Comment 10 Eclipse Genie CLA 2018-02-06 13:29:12 EST
New Gerrit change created: https://git.eclipse.org/r/116811
Comment 11 Lars Vogel CLA 2018-02-06 13:30:29 EST
Collection<MInputPart> getInputParts(String inputUri) can also be marked for deletion.
Comment 12 Eclipse Genie CLA 2018-02-06 13:33:25 EST
New Gerrit change created: https://git.eclipse.org/r/116812
Comment 13 Lars Vogel CLA 2018-02-06 14:38:18 EST
Oliver, according to https://wiki.eclipse.org/Eclipse/API_Central/API_Removal_Process you need to:

1.) Annotate all APIs that are to be removed with @noreference, @noextend and @noimplement where applicable, update deprecation comment. If applicable do the same for API that depends on it. The comment should contain a link to the bug report to allow feedback from API adopters.

2.) Add an entry in the porting guide.

Could you update your patches to follow 1.)?
Comment 14 Lars Vogel CLA 2018-02-06 14:59:03 EST
FYI Olivier, I send an email to cross announcing the plan to mark this API for deletion.

Thank you for your work here.
Comment 17 Lars Vogel CLA 2018-02-13 11:47:35 EST
We also need an entry to our migration guide. Let me try to contribute that.
Comment 18 Lars Vogel CLA 2018-02-13 11:52:57 EST
Btw, in the Gerrit change I do not see MInput. Should that also be marked with @noreference?
Comment 19 Eclipse Genie CLA 2018-02-13 11:54:15 EST
New Gerrit change created: https://git.eclipse.org/r/117289
Comment 20 Olivier Prouvost CLA 2018-02-13 11:56:32 EST
MInput is only marked as deprecated and the MInputPart has a coreference annotation. 

I can add one on MInput
Comment 21 Lars Vogel CLA 2018-02-13 11:58:12 EST
(In reply to Olivier Prouvost from comment #20)
> I can add one on MInput

+1
Comment 22 Eclipse Genie CLA 2018-02-13 11:58:23 EST
New Gerrit change created: https://git.eclipse.org/r/117291
Comment 25 Dani Megert CLA 2018-02-14 05:24:30 EST
Especially when touching APIs it is really important to set the API baaseline. Doing so will show you errors. Those need to be filtered with API problem filters.
Comment 26 Lars Vogel CLA 2018-02-14 05:35:40 EST
(In reply to Dani Megert from comment #25)
> Especially when touching APIs it is really important to set the API
> baaseline. Doing so will show you errors. Those need to be filtered with API
> problem filters.

Olivier, can you have a look?
Comment 27 Olivier Prouvost CLA 2018-02-14 09:19:28 EST
I could have a look if I knew how to proceed this ! But I don't know how to manage API base lines sorry.
Comment 28 Lars Vogel CLA 2018-02-14 09:24:49 EST
Olivier, this should explain it:http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#configure-api-baseline

Let me know if you still have issues.
Comment 29 Dani Megert CLA 2018-02-14 09:32:49 EST
(In reply to Lars Vogel from comment #28)
> Olivier, this should explain
> it:http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#configure-api-baseline
> 
> 
> Let me know if you still have issues.

As baseline you have to use 4.7.2:
http://download.eclipse.org/eclipse/downloads/drops4/R-4.7.2-201711300510/
Comment 30 Olivier Prouvost CLA 2018-02-14 10:51:12 EST
Ok. I set an API Baseline and I have errors... I get 3 quick fixes : 

* create a commented compatibility problem filter for MInputPart
* create a compatibility problem filter for MInputPart
* Configure compatibility problem severity..

I guess the first quick fix ask for a Filter name and the second set the default name ... And it produces a .api_filter file that must be committed in the .settings of the project. 

So I should create the default filter (quick fix 2), for all problems detected and then commit the .api_filter files ? 

Is that right ?
Comment 31 Lars Vogel CLA 2018-02-14 10:59:28 EST
(In reply to Olivier Prouvost from comment #30)
> Ok. I set an API Baseline and I have errors... I get 3 quick fixes : 
> 
> * create a commented compatibility problem filter for MInputPart
> * create a compatibility problem filter for MInputPart
> * Configure compatibility problem severity..
> 
> I guess the first quick fix ask for a Filter name and the second set the
> default name ... And it produces a .api_filter file that must be committed
> in the .settings of the project. 
> 
> So I should create the default filter (quick fix 2), for all problems
> detected and then commit the .api_filter files ? 
> 
> Is that right ?

I suggest to add a commented filter for everything EXCEPT "The major version should ..." for the MANIFEST.

Once you add a API filter for the individual problems, this one should go away. I usually trigger at least twice a rebuild, as the API tooling has a tendency to not update its error markers at save.
Comment 32 Eclipse Genie CLA 2018-02-14 11:20:25 EST
New Gerrit change created: https://git.eclipse.org/r/117371
Comment 33 Lars Vogel CLA 2018-02-14 11:43:16 EST
Olivier, I see three warnings:

Description	Resource	Path	Location	Type
Tag '@noreference' is unsupported on a private field	BasicPackageImpl.java	/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/application/ui/basic/impl	line 4950	Unsupported Tag Problem
Tag '@noreference' is unsupported on a private field	BasicPackageImpl.java	/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/application/ui/basic/impl	line 5035	Unsupported Tag Problem
Tag '@noreference' is unsupported on a private field	BasicPackageImpl.java	/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/application/ui/basic/impl	line 5048	Unsupported Tag Problem

Can you remove the annotations for these private fields?
Comment 34 Olivier Prouvost CLA 2018-02-14 11:44:11 EST
Sure
Comment 36 Eclipse Genie CLA 2018-02-14 11:54:20 EST
New Gerrit change created: https://git.eclipse.org/r/117373
Comment 38 Eclipse Genie CLA 2018-02-15 01:19:23 EST
New Gerrit change created: https://git.eclipse.org/r/117411
Comment 40 Lars Vogel CLA 2018-12-10 03:43:51 EST
We also need to add the planned deletion of our migration guide.
Comment 41 Lars Vogel CLA 2019-02-19 03:31:04 EST
Mass change, please reset target if you still planning to fix this for 4.11.
Comment 42 Lars Vogel CLA 2019-02-19 03:35:01 EST
(In reply to Lars Vogel from comment #41)
> Mass change, please reset target if you still planning to fix this for 4.11.

Sorry, just noticed that the entry does exists since a while.
Comment 43 Ed Willink CLA 2019-02-19 05:03:36 EST
(In reply to Lars Vogel from comment #31)
> Once you add a API filter for the individual problems, this one should go
> away. I usually trigger at least twice a rebuild, as the API tooling has a
> tendency to not update its error markers at save.

It looks as if you are hitting the problem that EMF code generation and API tooling are incompatible. See 543621.

If you want to reduce your incompatibilities per change you need to eliminate the "not-API" public static ints most of which are not actually needed. Eclipse OCL has some variant templates that achieve this.

@noreference is not really appropriate since any EMF model that extends the platform model must reference the FEATURE_COUNT ints. If they are x-friend limited then @noreference is redundant. If they are public API then @noreference is wrong.
Comment 44 Ed Willink CLA 2019-02-25 08:04:08 EST
It appears that MInput is defined by Input in UIElements.ecore. It has the http://www.eclipse.org/ui/2010/UIModel/application/ui nsURI.

Pedantically any change to the model should change the nsURI (the model version). But a change in nsURI breaks everything, necessitating a multi-nsURI loader.

Pragmatically evolution is acceptable, since additions do not often break backward compatibility. Deletions/renames are not acceptable.

A model API is much stronger than a Java API which applies to calls to the current code in the current code.

A model may be written using an older version of the code. Consequently if any attempt is made to load an old workbench.xmi on a new Eclipse, the EMF loading will fail. The default in EMF is akin to a crash, although skilled users can configure a record unknown features facility to absorb now-illegal features.

Opening my current workbench.xmi I find

     tooltip=&quot;org.eclipse.e4.ui.model.application.ui.MInput&quot;

It therefore appears that MInput is not obsolete for me.

I strongly recommend that model elements are NOT deleted, just leave them deprecated until a new nsURI can be tolerated for "e5". If necessary put in some @generated NOT code to log the dead elements to the Error Log.
Comment 45 Lars Vogel CLA 2019-02-25 08:21:02 EST
Es, as by request of the community we do not increase versions for planned deletions. So we will not increase the nsULR for this deletion nor the major bundle version.
Comment 46 Ed Willink CLA 2019-02-25 08:31:08 EST
I wrote that pedantiaclly you should increase the nsURI, but that pragmatically you can evolve. Deleting model elements really naughty, particularly if they are still in use (by my workbench.xmi).
Comment 47 Olivier Prouvost CLA 2019-02-25 12:15:51 EST
Hi Ed, 

Could you explain us how you use your MInput and MInputPart ? I would bet that you are the only one on earth using it :).

If we opened this bug 2 years ago to put it as deprecated it is because it is useless, confusing and noisy in the model. Like the MDialog and MWizard (see bug #531054).

We followed the Eclipse process to set something deprecated so as to let people migrate to the new version and to limit the usage of the deprecated stuff during 2 years. In addition we removed the MInput choice (bug also MWizard and MDialog) from the model editor and the model fragment editor. So nobody since 2 years can add this kind of objects, unless they use a very old version of the Eclipse 4 runtime. 

If, unfortunately, some people still use these objects, I would like to know why and how ? The code Migration for MInputPart should be easy by renaming MInputPart to MPart... Even in the runtime code it is not used internally. 

If we change the nsURI we will break everything and nothing will be compatible with the new API version. All the code will have to be updated and the runtime should be upgraded to 5.0 release.  That would be a huge change for a lot of developers that try to use E4. It is may be not a THE pure practice and not like you proceed for all of your important work on the model projects, I agree, but it is a pragmatic choice as nobody should use that for while. 

If people want to keep MInput in their model, they can, but they will have to use an older runtime. 

May be another solution would be to regenerate the MInput and MInputPart classes as 'dynamic' EClass so as to keep them available from the factory but not directly with the code. But this choice would let these useless classes in the API and it would be confusing. 

So for me, I would 'vote' to remove if definitively from the API. 

PS : you did not mention MDialog and MWizardDialog (see bug #531054) which are concerned also by the deletion... may be you don't use them ?
Comment 48 Ed Willink CLA 2019-02-25 12:51:50 EST
I have no idea how/if I use them. I'm not sure that I have ever done any e4 as opposed to 3.x UI coding. I just opened my workbench.xmi to check on the nsURI to see if I was looking at the right *.ecore and was astonished to notice the 

tooltip=&quot;org.eclipse.e4.ui.model.application.ui.MInput&quot;

My guess is that my workbench.xmi has acquired some magic content as a result of being used on at least 5 milestones per year since Feb 2015. e.g. it has the magic content that causes it to create GIT repository views on startup in the wrong perspective. My workspace has also advanced backwards and forwards across major platform releases.
Comment 49 Olivier Prouvost CLA 2019-02-25 13:10:41 EST
Could you attach your model in this bug ?
Comment 50 Ed Willink CLA 2019-02-25 13:49:46 EST
Created attachment 277682 [details]
Requested model
Comment 51 Olivier Prouvost CLA 2019-02-25 16:59:43 EST
Ok, 

The reference to the MInput is done in the persistedState part of the MApplication. I don't know how you use your application, but if you restart it using the -clearPersistedState argument (no value to set, only this argument), this line <persistedState> will disappear at startup and start with a new cleaned persisted state.

Then after exiting the application it would be interesting to check if the 'MInput' reference is still there (as the model is saved on exit, the line should reappear). If not, it was an old value stored with an old version of the runtime.
Comment 52 Ed Willink CLA 2019-02-26 10:06:17 EST
The "tooltip" seems to persist some "recent" history and so since I had searched my code for "org.eclipse.e4.ui.model.application.ui.MInput" the workspace had the 'problem' text. A few searches later and it goes away.

I tried searching my many workspaces for "MInput" and got no hits, but Windows Search is total SH1T these days so that may not mean anything. I tried setting up an Eclipse search, but Eclipse search seems reluctant to look inside .metadata folders.
Comment 53 Dani Megert CLA 2019-02-26 10:45:18 EST
(In reply to Ed Willink from comment #52)
> Eclipse search seems reluctant to look inside .metadata folders.
Can you elaborate on this? Steps? Please file a bug report.
Comment 54 Ed Willink CLA 2019-02-26 10:55:13 EST
I recall someone telling me that Eclipse search was pruned. Obviously it should exclude Java's bin folders and maven's target folders. But where are the preferences that specify this? I tried ensuring that ".xxx" files are shown. Maybe the 100 results filter clicks in stupidly.
Comment 55 Dani Megert CLA 2019-02-26 10:59:40 EST
(In reply to Ed Willink from comment #54)
> I recall someone telling me that Eclipse search was pruned. Obviously it
> should exclude Java's bin folders and maven's target folders. But where are
> the preferences that specify this? I tried ensuring that ".xxx" files are
> shown. Maybe the 100 results filter clicks in stupidly.
No, nothing is filtered out of the box, except for the 1000 (not 100) limit.

Please ignore "someone" and file a bug report with steps ;-).
Comment 56 Dani Megert CLA 2019-02-26 11:22:18 EST
(In reply to Dani Megert from comment #55)
> No, nothing is filtered out of the box, except for the 1000 (not 100) limit.
Note that this is out of the box. Maybe you checked to ignore binary files and/or derived resources.
Comment 57 Ed Willink CLA 2019-02-26 12:21:13 EST
Ignoring binary/derived resources is very sensibly the default; hence my perception that there is pruning. m2e fails to mark the target tree as derived. Bug 384356 reopened.

I was fooled by a perverse search collation order. The same as the Package Explorer so probably too late to report a bug.

In Eclipse, "_" before "." before letter although "_" is a pseudo letter and after "." in ASCII. Unusually, Windows is more consistent; "." before "_" before letter.

I failed to spot ".metadata" in the middle of a long list of folders.
Comment 58 Olivier Prouvost CLA 2019-11-06 05:25:55 EST
Is it time to remove all of this definitively ?
Comment 59 Lars Vogel CLA 2019-11-06 05:34:09 EST
(In reply to Olivier Prouvost from comment #58)
> Is it time to remove all of this definitively ?

June 2020, see https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fporting%2Fremovals.html
Comment 60 Christoph Laeubrich CLA 2019-12-30 03:05:26 EST
Sorry to post on this resolved bug, but it was the closest reference to a problem I'm currently encounter, I'm currently upgrading an application from Neon to Photon and after changing the SDK version getting 

> Class 'InputPart' is not found or is abstract

Is this related to this change? What is the replacement for InputPart? I also want to mention that https://wiki.eclipse.org/Eclipse4/RCP/FAQ still recommends using InputPart

> Eclipse 4 instead distinguishes between a Part and an InputPart.
> An input part has a URI to provide the input and can also be marked as dirty

Also https://wiki.eclipse.org/E4/UI/Modeled_UI#InputPart still mentions InputPart and I don't see any documentation what to use instead... can a simple Part be used (and marked as dirty)?
Comment 61 Lars Vogel CLA 2020-01-27 07:03:05 EST
(In reply to Christoph Laeubrich from comment #60)
> Sorry to post on this resolved bug, but it was the closest reference to a
> problem I'm currently encounter, I'm currently upgrading an application from
> Neon to Photon and after changing the SDK version getting 
> 
> > Class 'InputPart' is not found or is abstract
> 
> Is this related to this change? What is the replacement for InputPart? I
> also want to mention that https://wiki.eclipse.org/Eclipse4/RCP/FAQ still
> recommends using InputPart

You can use a Part and its persistedState. See https://www.vogella.com/tutorials/Eclipse4Services/article.html#mpart-and-multiple-editors for the info or an extended example our commercial training at https://learn.vogella.com/courses/details/rich-client-platform (sorry the exercise is not public available).



> > Eclipse 4 instead distinguishes between a Part and an InputPart.
> > An input part has a URI to provide the input and can also be marked as dirty
> 
> Also https://wiki.eclipse.org/E4/UI/Modeled_UI#InputPart still mentions
> InputPart and I don't see any documentation what to use instead... can a
> simple Part be used (and marked as dirty)?

Yes, see above.
Comment 62 Christoph Laeubrich CLA 2020-01-27 07:53:46 EST
(In reply to Lars Vogel from comment #61)
> You can use a Part and its persistedState.

Thanks I'll try that, in Neon "setDirty" has only  effect if a part is an EditorPart so that the only reason we used that there as we are saving all data to files/database but good to hear that persitedState is also possible.

Still wondering if someone has the insight to update the docs as its a little bit confusing.
Comment 63 Lars Vogel CLA 2020-05-05 04:46:51 EDT
(In reply to Christoph Laeubrich from comment #62)
> (In reply to Lars Vogel from comment #61)
> > You can use a Part and its persistedState.
> 
> Thanks I'll try that, in Neon "setDirty" has only  effect if a part is an
> EditorPart so that the only reason we used that there as we are saving all
> data to files/database but good to hear that persitedState is also possible.
> 
> Still wondering if someone has the insight to update the docs as its a
> little bit confusing.

https://wiki.eclipse.org/E4/UI/Modeled_UI updated