osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Aadl Property Viewer does not show values on virtual processor in instance model #193

Closed reteprelief closed 11 years ago

reteprelief commented 11 years ago

On the development console I get the following stack trace. It occurs when a serialize is invoked. This is probably something that needs to be fixed for the serializer.

!STACK 0 org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized. SystemInstance'Mission_System_Design_Instance'.componentInstance[3]->ComponentInstance'sa'.componentInstance[0]->ComponentInstance'MIS'.componentInstance[7]->ComponentInstance'IASE_SW_Partition'.ownedPropertyAssociation[0]->PropertyAssociation.ownedValue[0]->ModalPropertyValue.ownedValue->ListValue.ownedListElement[0]->InstanceReferenceValue: An object of type NamedValue or RealLiteral or IntegerLiteral or Operation is needed instead of InstanceReferenceValue for serialization with rule NumAlt. SystemInstance'Mission_System_Design_Instance'.componentInstance[3]->ComponentInstance'sa'.componentInstance[0]->ComponentInstance'MIS'.componentInstance[7]->ComponentInstance'IASE_SW_Partition'.ownedPropertyAssociation[0]->PropertyAssociation.ownedValue[0]->ModalPropertyValue.ownedValue->ListValue.ownedListElement[0]->InstanceReferenceValue: An object of type NamedValue or BooleanLiteral or ListValue or ComputedValue or RealLiteral or IntegerLiteral or StringLiteral or ClassifierValue or RecordValue or ReferenceValue or RangeValue is needed instead of InstanceReferenceValue for serialization with rule PropertyExpression. SystemInstance'Mission_System_Design_Instance'.componentInstance[3]->ComponentInstance'sa'.componentInstance[0]->ComponentInstance'MIS'.componentInstance[7]->ComponentInstance'IASE_SW_Partition'.ownedPropertyAssociation[0]->PropertyAssociation.ownedValue[0]->ModalPropertyValue.ownedValue->ListValue.ownedListElement[0]->InstanceReferenceValue: An object of type NamedValue or BooleanLiteral or ListValue or ComputedValue or RealLiteral or IntegerLiteral or StringLiteral or ClassifierValue or RecordValue or RangeValue is needed instead of InstanceReferenceValue for serialization with rule ConstantPropertyExpression.

at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:96)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:122)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:51)
at org.osate.ui.propertyview.PropertyViewModel.getValueAsString(PropertyViewModel.java:241)
reteprelief commented 11 years ago

The issue is that the object asked to be serialized is an InstanceReferenceValue. This is not an object that is getting parsed. Therefore, the serializer does not know how to generate text for it. So we need to do a special case for turning this value into text.

joeseibel commented 11 years ago

Fixed in f39b36bbc7b64b551ec20ec27aaf9197fc43b2c1

joeseibel commented 11 years ago

The previous fix only dealt with cases where a property value was an InstanceReferenceValue object. It did not handle lists of InstanceReferenceValue objects. Lists are now handled in 95ee4a6851b2d4f0770be1b0f2b6e2eb44fc041c.