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

Bug 339123

Summary: Generated nested type reference incorrect
Product: [Modeling] EEF Reporter: Matt Barry <mrbcuda>
Component: GeneralAssignee: EEF Inbox <emft.eef-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jconlon, stephane.begaudeau
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Reference eefgen file
none
Reference ecore file none

Description Matt Barry CLA 2011-03-07 12:26:41 EST
Build Identifier: 20100917-0705

Running the "Generate EEF Architecture" on my eefgen file produces source with many of these errors:

The nested type org.eclipse.emf.ecore.util.FeatureMap$Entry cannot be referenced using its binary name

on code like this in in the generated components:
	/**
	 * Used to update the views
	 * 
	 */
	protected void runUpdateRunnable(final Notification msg) {
		if (AmlPackage.eINSTANCE.getAnnotation_Mixed().equals(msg.getFeature()) && basePart != null) {
			if (msg.getEventType() == Notification.ADD) 
				basePart.addToMixed((org.eclipse.emf.ecore.util.FeatureMap$Entry) msg.getNewValue());
			else if (msg.getEventType() == Notification.REMOVE) 
				basePart.removeToMixed((org.eclipse.emf.ecore.util.FeatureMap$Entry) msg.getNewValue());
		}

		if (AmlPackage.eINSTANCE.getAnnotation_Id().equals(msg.getFeature()) && basePart != null){
			if (msg.getNewValue() != null) {
				basePart.setId(EcoreUtil.convertToString(XMLTypePackage.eINSTANCE.getString(), msg.getNewValue()));
			} else {
				basePart.setId("");
			}
		}

	}


and on code like this in the generated parts:

/**
 * Add a value to the group multivalued attribute.
 * @param newValue the value to add
 */
public void addToGroup(org.eclipse.emf.ecore.util.FeatureMap$Entry newValue);


The necessary repair seems to be replacing the "$" character with a "." character everywhere.  See also discussion on forum http://www.eclipse.org/forums/index.php?t=rview&goto=658177#msg_658177.


Reproducible: Always

Steps to Reproduce:
1. Create an Ecore model with an EClass containing an EReference of type EFeatureMapEntry
2. Create its genmodel
3. Initialize EEF from the genmodel
4. Generate EEF content from its eefgen
Comment 1 Matt Barry CLA 2011-03-07 12:29:39 EST
Created attachment 190572 [details]
Reference eefgen file
Comment 2 Matt Barry CLA 2011-03-07 12:30:15 EST
Created attachment 190573 [details]
Reference ecore file
Comment 3 Stephane Begaudeau CLA 2016-05-30 10:32:32 EDT
The Eclipse EEF team has worked over the past few months on a brand new runtime using a reflective approach which can be used more easily with Eclipse Sirius. Since we do not plan to continue to work on the old runtime and its code generation approach, I will close this issue for now.

If you want to contribute, you can reopen this issue and submit a contribution to the project thanks to our Gerrit: https://git.eclipse.org/r/#/admin/projects/eef/org.eclipse.eef