Annotation error in OCL development environment [message #1861771] |
Thu, 02 November 2023 16:34  |
Eclipse User |
|
|
|
Hi. I'm trying to do something with the OCL source and installed the dev environment using Ooomph, based on Eclipse 2023-06 (4.28) and checked out tag 6.18.0, but I get a couple of errors in the dev environment. The active target platform is the Modular Target from the Oomph setup model. The error is in `org.eclipse.ocl.pivot`, more precisely in
org.eclipse.ocl.pivot.internal.ids.AbstractTemplateableIdImpl.SpecializedValue<T>
and
org.eclipse.ocl.pivot.internal.ids.AbstractTemplateableIdImpl.SpecializedSingletonScope<T>
In both cases the error is in the annotation in the class template extended. The error is the same in both cases:
Quote:
Null constraint mismatch: The type 'T extends TemplateableId' is not a valid substitute for the type parameter '@NonNull T'
Why do I get this error, and how can I get rid of it?
Thank you
|
|
|
Re: Annotation error in OCL development environment [message #1861772 is a reply to message #1861771] |
Fri, 03 November 2023 05:08   |
Eclipse User |
|
|
|
Thanks for reporting. Seems familiar, but I can't find the associated JDT bugzilla. IIRC I just didn't use 2023-03/2023-06; certainly the problem has gone away for me on 2023-09.
(I'm impressed that you got so far. I had considerable troubles reproducing your steps; it seems that I haven't maintained ocl.setup since April 2023, so for 2023-06 you are relying on extrapolated support which fails because of the many structural Java/platform/Orbit evolutions. It would be interesting to know your precise OOMPH config steps and any workarounds.)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=582596 raised. You can follow the instructions to tweak away inherited @NonNull, or add explicit derived @NonNull, or wait for a commit.
(JDT's @NonNull annotations are very helpful in improving code quality, particularly for documenting intent. Sadly few projects have adopted the technology and so the lack of annotations in EMF/Platform/Java prevent the "Bye, Bye NPE!" potential being realised. External annotations help, but overall JDT's support is incomplete and, as you have discovered, fragile. The JDT team understandably concentrate on chasing new Java releases rather than completing the @NonNull support. I still see NPEs but they are more understandable.)
|
|
|
|
Re: Annotation error in OCL development environment [message #1861795 is a reply to message #1861794] |
Fri, 03 November 2023 16:51   |
Eclipse User |
|
|
|
Thanks. I pulled and checked out the 6.18.0_with_2023-06_source_compatibility tag. I confirm that the error goes away. There are still a couple of other errors though, in org.eclipse.ocl.examples.codegen in the template folder, all the *.javajet files have an error:
In the line
<%@ include file="../Header.javajetinc"%>
it says that the file ../Header.javajetinc cannot be read. And indeed, I don't see that file anywhere.
Also, If I select the 6.18.0 target, in addition to the above, I get errors on org.eclipse.ocl.examples.build, all of which point to a missing dependency: org.eclipse.m2m.qvt.
And as a side note, I have found several bugzillas related to the NotNull annotation and its relatives, and from what I read, the main developer in the JDT maintaining that was or is going to leave? It makes you wonder about future support for these.
Thanks
[Updated on: Fri, 03 November 2023 17:19] by Moderator
|
|
|
Re: Annotation error in OCL development environment [message #1861799 is a reply to message #1861795] |
Sat, 04 November 2023 05:50  |
Eclipse User |
|
|
|
The EMF Jet support (and Xtend Xtext support) auto-build and usually fix up everything provided you are patient. Perhaps a clean all may help.
If org..eclipse.emf.codegen.ecore is not installed, it should be, please raise a Bugzilla. Easy fixed by an Help->Install New Software... for EMF SDK.
|
|
|
Powered by
FUDForum. Page generated in 1.23203 seconds