Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324863 - Invalid Validator.validate methods generated by 2.6 if runtime version = 2.4
Summary: Invalid Validator.validate methods generated by 2.6 if runtime version = 2.4
Status: CLOSED DUPLICATE of bug 324207
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: 2.6.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Steinberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 11:57 EDT by Henning Heitkoetter CLA
Modified: 2010-09-09 12:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning Heitkoetter CLA 2010-09-09 11:57:06 EDT
A genmodel with runtime version set to 2.4 can generate a broken validator class in EMF 2.6: a validate method references the method validate_EveryBidirectionalReferenceIsPaired, which is available only since 2.6 (?).

This happens because of the structure of the following if-statement in GenClassImpl.getIntrinsicConstraints:
	if (runtimeVersion <= GenRuntimeVersion.EMF22_VALUE)
    {
      result.remove("EveryKeyUnique");
      result.remove("EveryMapEntryUnique");
    }
	else if (runtimeVersion < GenRuntimeVersion.EMF25_VALUE)
	{
      result.remove("NoCircularContainment");
	}
	else if (runtimeVersion < GenRuntimeVersion.EMF26_VALUE)
	{
      result.remove("EveryBidirectionalReferenceIsPaired");
	}
	
To me it seems - without knowing the history - that both "else" are wrong and should be removed, so that there are three distinct if statements (emulating a switch with fall-through).
Comment 1 Ed Merks CLA 2010-09-09 12:15:57 EDT

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