Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 272764 - Generated model does not compile when created from an XSD containing a "FeatureID" element
Summary: Generated model does not compile when created from an XSD containing a "Featu...
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: 2.4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 247980
  Show dependency tree
 
Reported: 2009-04-17 17:11 EDT by Mircea Luchian CLA
Modified: 2009-06-25 02:49 EDT (History)
0 users

See Also:


Attachments
The XSD file to use when generating the model (37.84 KB, application/xml)
2009-04-17 17:11 EDT, Mircea Luchian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Luchian CLA 2009-04-17 17:11:58 EDT
Created attachment 132305 [details]
The XSD file to use when generating the model

Build ID: M20090211-1700

Steps To Reproduce:
1. Use the XSD attached in this bug.
2. XSD has a "FeatureID" element in definition <xs:element name="FeatureID" .... 
3. Create a "new EMF model" in an EMF project
4. Choose XML schema 
5. Browse for the XSD provided as an attachment for this bug
6. Press Next and then Finish
7. The .genmodel file is generated
8. Right clisk on the root node of the genmodel and select "Generate Model Code"
9. Compilation errors exist in files "DcamLockTypeImpl.java" line 1642 and "SmartFeatureAdrTypeImpl.java" line 548



More information:
There is an invalid comparison at the above mentioned lines. There is a sort of conflict between the "featureID" variable used internally by the EMF case and the "FeatureID" element from the XSD when we generate the code.
Comment 1 Ed Merks CLA 2009-04-18 05:13:26 EDT
The featureID field needs to be qualified with "this" in eIsSet to avoid the collision with the featureID parameter.

The fix is committed to CVS for 2.5.
Comment 2 Dave Steinberg CLA 2009-04-23 02:56:14 EDT
Fix available in HEAD: 2.5.0.I200904211800.
Comment 3 Dave Steinberg CLA 2009-06-25 02:49:17 EDT
Fix available in HEAD: 2.5.0 (R200906151043).