Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having the same property association as a contained property association and direct association causes instantiation exception #2259

AaronGreenhouse opened this issue Mar 27, 2020 · 1 comment · Fixed by #2261


Copy link

Discovered this when I accidentally made the same property association to bind a connection to bus twice:

  1. As a direct property association on the connection declaration
  2. As a contained property association on the whole system.
package Broken
	with SEI;

	-- Some basics
	data D8
			Data_Size => 8 Bytes;
	end D8;
	-- buses
	bus MyBus
	end MyBus;
	system S1
			out1: out data port D8;
	end S1;

	system S2
			in1: in data port D8;
	end S2;

	-- assembled system
	system top
	end top;
	system implementation top.i
			sub1: system s1;
			sub2: system s2;
			theBus: bus MyBus;
			conn1: port sub1.out1 -> sub2.in1 {
				Actual_Connection_Binding => (reference (theBus));
			-- Bind the connections
			Actual_Connection_Binding => (reference (theBus)) applies to conn1;		
	end top.i;
end Broken;

When you instantiate the system instance top.i you get an exception:

	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(
	at org.eclipse.emf.common.util.AbstractEList$
	at org.osate.aadl2.instantiation.CachePropertyAssociationsSwitch.cacheConnectionPropertyAssociations(
	at org.osate.aadl2.instantiation.CachePropertyAssociationsSwitch$1.caseConnectionInstance(
	at org.osate.aadl2.instantiation.CachePropertyAssociationsSwitch$1.caseConnectionInstance(
	at org.osate.aadl2.instance.util.InstanceSwitch.doSwitch(
	at org.eclipse.emf.ecore.util.Switch.doSwitch(
	at org.eclipse.emf.ecore.util.Switch.doSwitch(
	at org.osate.aadl2.modelsupport.modeltraversal.AadlProcessingSwitch.process(
	at org.osate.aadl2.modelsupport.modeltraversal.ForAllElement.processObject(
	at org.osate.aadl2.modelsupport.modeltraversal.PreOrderTraversal.visitRoot(
	at org.osate.aadl2.modelsupport.modeltraversal.PreOrderTraversal.visitRoot(
	at org.osate.aadl2.modelsupport.modeltraversal.ForAllElement.processPreOrderAll(
	at org.osate.aadl2.instantiation.InstantiateModel.getUsedPropertyDefinitions(
	at org.osate.aadl2.instantiation.InstantiateModel.fillSystemInstance(
	at org.osate.aadl2.instantiation.InstantiateModel.createSystemInstanceInt(
	at org.osate.aadl2.instantiation.InstantiateModel.createSystemInstance(
	at org.osate.aadl2.instantiation.InstantiateModel.buildInstanceModelFile(
	at org.osate.ui.handlers.InstantiationHandler$InstantiationJob.runInWorkspace(

Now obviously this model is broken, but it should not result in a Java exception

@lwrage lwrage self-assigned this Mar 30, 2020
@lwrage lwrage added this to the 2.7.1 milestone Mar 30, 2020
lwrage added a commit that referenced this issue Mar 30, 2020
Copy link

lwrage commented Mar 30, 2020

Fixing this shows another bug: now the binding is duplicated in the instance model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging a pull request may close this issue.

2 participants