osate / osate2

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

Incorrect error message about property value "not consistent along connection" #819

Closed rinsley closed 7 years ago

rinsley commented 7 years ago

Consider the following AADL model:

package Example public system Root end Root;

system implementation Root.impl
    subcomponents
        A: system A;
        B: system B.impl;
        Bus1: bus;
    connections
        C1: port A.Output -> B.Input;
    properties
        Actual_Connection_Binding => (reference (Bus1)) applies to C1;
        Actual_Connection_Binding => (reference (Bus1)) applies to B.C2;
end Root.impl;

system A
    features
        Output: out data port;
end A;

system B
    features
        Input: in data port;
end B;

system implementation B.impl
    subcomponents
        T: system T;
    connections
        C2: port Input -> T.Input;
end B.impl;

system T
    features
        Input: in data port;
end T;

end Example;

If you instantiate this, there is one connection instance made up of two connections. In the text, both connections have the Actual_Connection_Binding property with the exact same value. However, you get the following error message:

"Value for property Deployment_Properties::Actual_Connection_Binding not consistent along connection"

This appears to be a bug. The value for the properties is consistent.

Ultimately, this appears to be due to ListValueImpl line 217. When the sameAs method determines if two property list values are the same, it uses .equals to compare each of the items in the lists. This should be calling .sameAs instead of .equals to compare the items. (For example, compare to RangeValueImpl.sameAs where .sameAs is used to compare the range minimum and maximum instead of .equals).

lwrage commented 7 years ago

Fixed in e94dfe5fecd179a76c96f794b19dac427cfe3040