Community
Participate
Working Groups
Initial help required was done on the forum thread https://www.eclipse.org/forums/index.php/t/1098961/ I generate EMF code from a UML (Papyru) model, where I use property's redefinition. The generated java code contains duplicated @Override (and so, it doesn't compile). In attachment, a model to reproduce the bug.
Created attachment 278638 [details] a model to reproduce the bug.
I'm seeing the same problem in generation of overrides for getters in a subclass that add subsets to an inherited superset feature. And I have a fix to contribute. The problem is that annotation-insertion templates for getters and setters reuse the corresponding templates for basic-setters and basic-getters, which I suppose the Ecore templates don't generate overrides for in the same way. This reuse of those templates doesn't account for the fact that the base Ecore template already generates an @Override in the getter and setter, so that we end up with two in the generated output.
New Gerrit change created: https://git.eclipse.org/r/c/uml2/org.eclipse.uml2/+/173700
I think this is the inevitable consequence when a project decides to 'improve' the EMF JET templates which have limited override capability. Too much requires copy and paste and so goes stale when EMF improves. It is also a problem that EMF has not had a coherent advance-beyond-Java-5 session. Rather I have identified a variety of problems that occur with Java > 5 and Ed has fixed some of them. Unfortunately this means that UML must re-copy the changes to avoid inconsistencies, particularly where UML has a different fix. And since it is a pain for committers to remember to review EMF changes, there need to be JUnit tests that animate as much of the user experience as possible. (OCL and QVTd have such tests for genmodel and for code generation and ongoing execution that run weekdays after a master commit, and on Sundays regardless.) (For OCL I try to have a commit that represents the unadulterated clone source so that it is easier to apply EMF changes to the clone.)
Gerrit change https://git.eclipse.org/r/c/uml2/org.eclipse.uml2/+/173700 was merged to [master]. Commit: http://git.eclipse.org/c/uml2/org.eclipse.uml2.git/commit/?id=795999f4349ffdca12f218f795e8a4a1769db7b3
New Gerrit change created: https://git.eclipse.org/r/c/uml2/org.eclipse.uml2/+/173758
Gerrit change https://git.eclipse.org/r/c/uml2/org.eclipse.uml2/+/173758 was merged to [R5_5_maintenance]. Commit: http://git.eclipse.org/c/uml2/org.eclipse.uml2.git/commit/?id=a8a9f3672e16e1d85121ce66af528e19d3cebf40
The fix has been commited to both the 'master' and 'R5_5_maintenance' branches and will be shipped in the next UML2 release (nominally 5.5.2).
The fix is now available in a milestone build towards 5.5.2.
Milestone build confirmed by installation via Papyrus Oomph profile. Thanks!