Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364100 - [Generator] Bad generation on "selection" attribute.
Summary: [Generator] Bad generation on "selection" attribute.
Status: CLOSED WONTFIX
Alias: None
Product: EEF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal
Target Milestone: ---   Edit
Assignee: EEF Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-17 21:40 EST by Miles Parker CLA
Modified: 2016-05-30 10:29 EDT (History)
2 users (show)

See Also:


Attachments
Projects exercising selection issue. (195.12 KB, application/zip)
2011-11-24 13:52 EST, Miles Parker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Parker CLA 2011-11-17 21:40:20 EST
I have a model with an attribute called "selection". When I tried to generate code for my model, I got a lot of bad code, for example:

	protected void addSelection() {
		TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(selection.getInput(), selectionFilters, selectionBusinessFilters,
		"selection", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
			@Override
			public void process(IStructuredSelection selection) {
				for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
					EObject elem = (EObject) iter.next();
					propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(SelectionHistoryItemPropertiesEditionPartImpl.this, ButterflyzerViewsRepository.SelectionHistoryItem.Properties.selection,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
				}
****ERRROR HERE
				selection.refresh();
			}
		};
		dialog.open();
	}

This was a bit difficult to diagnose as I also got some scary generation issues. I'll file those in a separate bug.
Comment 1 Bouchet Stéphane CLA 2011-11-24 08:58:12 EST
Hi,

Could you provide more details to be able to reproduce your problem ? 

i could not reproduce on our non regression tests cases. 
Can you provide a very small set of models ( ecore, genmodel, components and eef gen ) ? 


thanks,
Comment 2 Miles Parker CLA 2011-11-24 13:52:49 EST
Created attachment 207497 [details]
Projects exercising selection issue.

Sure. This exercises the issue. All that I'm doing here is creating a cardinality 0..-1 reference to EObject.
Comment 3 Bouchet Stéphane CLA 2011-11-25 02:54:12 EST
thanks !

we'll have a look.
Comment 4 Stephane Begaudeau CLA 2016-05-30 10:29:06 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