Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EEF] FeatureMap entry binary name
[EEF] FeatureMap entry binary name [message #656513] Sat, 26 February 2011 01:43 Go to next message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
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);


I have about 300 of these errors in my build, but have exhausted my ideas about how to repair the problem. Has anyone else solved an issue like this?
Re: [EEF] FeatureMap entry binary name [message #656514 is a reply to message #656513] Sat, 26 February 2011 02:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
Matt,

It sounds like a bug. In the generated Java source, the "$" should be
replaced with a ".". EMF's generator's importer would have produced
FeatureMap.Entry.


Matt Barry wrote:
> 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.getFe ature())
> && basePart != null) {
> if (msg.getEventType() == Notification.ADD)
>
> basePart.addToMixed((org.eclipse.emf.ecore.util.FeatureMap$E ntry)
> msg.getNewValue());
> else if (msg.getEventType() == Notification.REMOVE)
> basePart.removeToMixed
I would have expected removeFrom not removeTo for more meaningful English...
> ((org.eclipse.emf.ecore.util.FeatureMap$Entry) msg.getNewValue());
> }
>
> if
> (AmlPackage.eINSTANCE.getAnnotation_Id().equals(msg.getFeatu re())
I would have expected == to be used for feature comparison (it performs
better and must be equivalent), and for
AmlPackage.LITERALS.ANNOTATION__ID to be used (if available) for better
performance
> && basePart != null){
> if (msg.getNewValue() != null) {
>
> basePart.setId(EcoreUtil.convertToString(XMLTypePackage.eINS TANCE.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);
>
>
> I have about 300 of these errors in my build, but have exhausted my
> ideas about how to repair the problem. Has anyone else solved an
> issue like this?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EEF] FeatureMap entry binary name [message #658177 is a reply to message #656514] Mon, 07 March 2011 10:03 Go to previous messageGo to next message
Goulwen Le Fur is currently offline Goulwen Le FurFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Matt,

Ed is right, it's a bug. I'm sorry, I can't give you a work around. Can
you open a bug, I will fix it for 1.0.

Regards,

--
Goulwen Le Fur - goulwen.lefur@obeo.fr

Le 26/02/2011 03:21, Ed Merks a écrit :
> Matt,
>
> It sounds like a bug. In the generated Java source, the "$" should be
> replaced with a ".". EMF's generator's importer would have produced
> FeatureMap.Entry.
>
>
> Matt Barry wrote:
>> 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.getFe ature())
>> && basePart != null) {
>> if (msg.getEventType() == Notification.ADD)
>> basePart.addToMixed((org.eclipse.emf.ecore.util.FeatureMap$E ntry)
>> msg.getNewValue());
>> else if (msg.getEventType() == Notification.REMOVE)
>> basePart.removeToMixed
> I would have expected removeFrom not removeTo for more meaningful
> English...
>> ((org.eclipse.emf.ecore.util.FeatureMap$Entry) msg.getNewValue());
>> }
>>
>> if (AmlPackage.eINSTANCE.getAnnotation_Id().equals(msg.getFeatu re())
> I would have expected == to be used for feature comparison (it performs
> better and must be equivalent), and for
> AmlPackage.LITERALS.ANNOTATION__ID to be used (if available) for better
> performance
>> && basePart != null){
>> if (msg.getNewValue() != null) {
>> basePart.setId(EcoreUtil.convertToString(XMLTypePackage.eINS TANCE.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);
>>
>>
>> I have about 300 of these errors in my build, but have exhausted my
>> ideas about how to repair the problem. Has anyone else solved an issue
>> like this?
Re: [EEF] FeatureMap entry binary name [message #658284 is a reply to message #658177] Mon, 07 March 2011 17:32 Go to previous message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
Submitted as bug 339123.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=339123
Previous Topic:[EEF] NPE when selecting to add a relation
Next Topic:EMF Editors Integration
Goto Forum:
  


Current Time: Tue Mar 19 11:32:51 GMT 2024

Powered by FUDForum. Page generated in 0.03138 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top