Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325566

Summary: GenModel.runtimeVersion="2.4" with Ecore::constraints results in XxxValidator compiler errors
Product: [Modeling] EMF Reporter: Adrian Price <adrianp.quatinus>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Adrian Price CLA 2010-09-17 06:24:54 EDT
Build Identifier: 2.6.0.v20100614-1136

The generated code won't compile if the ecore model contains any Ecore EAnnotations with constraints -> ..., on account of the generator having emitted calls to EMF-2.6-specific EObjectValidator.validate_EveryBidirectionalReferenceIsPaired(...) method. There's a bug in GenClass.getIntrinsicConstraints() line 2978:

	else if (runtimeVersion < GenRuntimeVersion.EMF25_VALUE)
	{
      result.remove("NoCircularContainment");
	}
	else if (runtimeVersion < GenRuntimeVersion.EMF26_VALUE)
//      ^ need to remove this else
	{
      result.remove("EveryBidirectionalReferenceIsPaired");

Reproducible: Always
Comment 1 Adrian Price CLA 2010-09-17 06:44:31 EDT
Actually, looks like both elses should be removed, because you'll get the same problem with runtimeVersion="2.1-" and NoCircularContainment in addition.
Comment 2 Ed Merks CLA 2010-09-17 12:15:28 EDT
It's fixed in both streams already.

*** This bug has been marked as a duplicate of bug 324207 ***