-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange constraint evaluation failure #2333
Comments
By Ed Willink on Mar 27, 2024 05:17 Diagnostic ERROR source=org.eclipse.emf.ecore code=0 The 'Greeting::nameIsValidIdentifier' constraint result is invalid for 'Model::Greeting'
hides java.lang.IllegalArgumentException: The feature 'name' is not a valid feature from Thread [Worker-18: Validity View Validation] (Suspended (exception IllegalArgumentException)) But GreetingImpl has a name field. aargh! It's metamodel schizophrenia again. |
By Ed Willink on Mar 27, 2024 07:53 (In reply to Ed Willink from comment #1)
test.ocl imports 'platform:/plugin/org.xtext.example.mydsl/model/generated/MyDsl.ecore' with any normal EMF-based tool this would be idiot user, however the OCL tooling has a PlatformMap that is supposed to solve metamodel schizophrenia. (Changing the test.ocl import to http://www.xtext.org/example/mydsl/MyDsl and the strange validation error goes away.) Issues:
|
By Ed Willink on Mar 27, 2024 08:53 (In reply to Ed Willink from comment #2)
The MyDSL Xtext editor is running. OCL has not been activated. The OCL->Load Document action invokes the ResourceDialog constructor where the absence of prior OCL functionality creates a default that prefers the first reference. Unaware that http://www.xtext.org/example/mydsl/MyDsl was accessed by the Xtext editor, the platform:/plugin/org.xtext.example.mydsl/model/generated/MyDsl.ecore import is treated as the first reference. Xtext's SynchronizedXtextResourceSet is passed to the ResourceDialog constructor so it should be possible for the OCL activation to detect and so prefer the models already loaded by Xtext. |
By Ed Willink on Mar 28, 2024 03:48 (In reply to Ed Willink from comment #3)
The StandaloneProjectMap was designed to prepare a standalone application to be metamodel schizophrenia-proof. As such the ResourceSet was expected to be empty so that every EPackage load would be mediated. The ProjectMap extension for OSGI usage has the same expectation, that is not so sound. Changing the standard functionality to assume that whatever is already in the ResourceSet is what the user wants will cost nothing for an empty ResourceSet and may be very beneficial for a pre-existing active ResourceSet. |
By Ed Willink on May 22, 2024 04:15 (In reply to Ed Willink from comment #4)
doesn't solve the problem. (The code weas already commented to suggest this enhancement.) The OCL parser that runs on a worker thread uses the worker thread's EnvironmentFactory rather than the EnvironmentFactory passed from the main part-thread. The required attachEnvironmentFactory to configure the workder thread is present but commented out; clearly a false optimization for which no test demonstrates the necessity. |
| --- | --- |
| Bugzilla Link | 583086 |
| Status | NEW |
| Importance | P3 normal |
| Reported | Mar 27, 2024 04:05 EDT |
| Modified | May 22, 2024 04:15 EDT |
| See also | 583043 |
| Reporter | Ed Willink |
Description
Bug 583043#c20 describesa repro in which constraint evaluation fails for no evident reason and no adequate diagnostic.
The text was updated successfully, but these errors were encountered: