Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Annotation error in OCL development environment
Annotation error in OCL development environment [message #1861771] Thu, 02 November 2023 20:34 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
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
@NotNull
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 09:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 #1861794 is a reply to message #1861772] Fri, 03 November 2023 20:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
This should all be fixed. If you are using 2023-06 there is a variant 6.18.0 (2023-06) with the source fix.
Re: Annotation error in OCL development environment [message #1861795 is a reply to message #1861794] Fri, 03 November 2023 20:51 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
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 21:19]

Report message to a moderator

Re: Annotation error in OCL development environment [message #1861799 is a reply to message #1861795] Sat, 04 November 2023 09:50 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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.
Previous Topic:Non-deterministic error with OCL validation in Xtext project
Next Topic:Current Maven/ Gradle Repository for OCL
Goto Forum:
  


Current Time: Sun May 05 17:21:52 GMT 2024

Powered by FUDForum. Page generated in 0.03605 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top