Closed stevevestal closed 6 years ago
@stevevestal When you paste an AADL file into github, please enclose it in lines containing ``` (triple backquotes). Otherwise the formatting is messed up. You can switch to the preview tab to check the result before posting.
``` pasted AADL file goes here ```
The exception looks like a bug. Which OSATE version are you using? The SOMs have always been part of the instance model, we only changed the representation. BTW, I'd prefer to use the Google group for questions like this. The limit is currently hard coded to 1000 (see #666). Could you file a separate issue to have it changed or made a preference, please?
The exception still occurs in 2.3.1.
The exception is not just a problem on the instance model. It also happens with the declarative model. it is linked to using the "default" property association case in the property association when there is a mode list:
package Exception
public
with PS;
System S
modes
m1 : initial mode;
m2 : mode;
m3 : mode;
properties
PS::prop1 => "foo1";
PS::prop2 => "foo1" in modes (m1);
PS::prop3 => "foo1" in modes (m1), "bar1" in modes (m2);
PS::prop4 => "foo1" in modes (m1), "bar1";
end S;
System T
end T;
System implementation T.impl
subcomponents
sub: system S;
sub2: system S {
PS::prop1 => "foo3";
PS::prop2 => "foo3" in modes (m1);
PS::prop3 => "foo3" in modes (m1), "bar2" in modes (m2);
PS::prop4 => "foo3" in modes (m1), "bar2";
};
properties
PS::prop1 => "foo2" applies to sub;
PS::prop2 => "foo2" in modes (m1) applies to sub;
PS::prop3 => "foo2" in modes (m1), "bar2" in modes (m2) applies to sub;
PS::prop4 => "foo2" in modes (m1), "bar2" applies to sub;
end T.impl;
end Exception;
with the property set
property set PS is
prop1 : aadlstring applies to (system);
prop2 : aadlstring applies to (system);
prop3 : aadlstring applies to (system);
prop4 : aadlstring applies to (system);
end PS;
Here the error only occurs when you try expand the property PS::prop4
on the subcomponent sub
or sub
of T.impl
.
Interestingly, it doesn't occur if you expand the property PS::prop4
on the system type S
directly, even though that also has a "default" case in the property association.
The direct cause of this is PropertyColumnLabelProvider.getText()
, which seems to be making a bad assumption about the type of an object in the case of the modal property association. Need to better understand that this object is and what types it can actually have.
The problematic segment of code is trying to get the list of declared modes so it can find out which modes do not have an explicit property association, and thus are affected by the "default" one. The code seems to be assuming that the modelpropertyassociation comes from the property section of a classifier declaration, and thus is assuming that the object the AADL Property View is focused on is a classifier. Clearly this is a bad assumption, as it can be a subcomponent declaration. Can probably be a bunch of things, I need to figure out which ones are relevant to this situation.
Okay, so the bug was that the existing code was assumed the AADL Property View was focused on a component classifier. It wants to get the list of modes declared in that classifier. There are three cases we need to deal with:
InstanceObject
. In this case we just get the SystemInstance
object and use its list of system operation modes.Subcomponent
. In this case we get the component classifier of the subcomponent and use its list of modes.Fixed this.