eclipse-emf / org.eclipse.emf

Eclipse Public License 2.0
10 stars 13 forks source link

codegen.ecore is not generating @Override annotations in Java 10+ compliance levels #3

Closed subagergely closed 1 year ago

subagergely commented 1 year ago

It seems the reason of this issue is in GenModelImpl.getComplianceLevel(URI uri) function, which is not handling Java 10+ compliance levels. It returns the default Java 5 compliance level in these cases:

https://github.com/eclipse-emf/org.eclipse.emf/blob/6ca43ae229d4bcabf61628e4c381300801181dfd/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelImpl.java#L11049

merks commented 1 year ago

Note that you can modify the generated .genmodel or specify in the .xcore the compliance level. This method only computes a good default form the information in the project.

When this build finishes:

https://ci.eclipse.org/emf/job/build/job/master/148/

the fix will be available here:

https://download.eclipse.org/modeling/emf/emf/builds/nightly/latest

subagergely commented 1 year ago

Thanks for the quick answer and solution! Following your suggestion, the xcore complianceLevel setting also solved the problem: @GenModel(complianceLevel="17.0")