| Summary: | Invalid Validator.validate methods generated by 2.6 if runtime version = 2.4 | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Henning Heitkoetter <hheitkoetter> |
| Component: | Tools | Assignee: | Dave Steinberg <davidms> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Ed.Merks, Kenn.Hussey |
| Version: | 2.6.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 324207 *** |
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).