-
Notifications
You must be signed in to change notification settings - Fork 8
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
Aadl2JavaValidator doesn't check CLASSIFIER_MATCH correctly #2344
Comments
Check that bidirectional connections are checked correctly. Add unit tests |
Errors vs warnings (per @lwrage):
|
@AaronGreenhouse This does the wrong thing for access connections. There it's not the connection direction but provides/requires that determines "source" and "destination" for the validation. see #2362 |
Well, it's a bit more complicated than that. The type can become more general towards the ultimate
should be interpreted in this case as
Easy enough. Things get trickier when checking the declarative model. We must also consider which way is traveling toward the ultimate
These are distinct from the declared directions of the connections, which indicate whether the shared component is written to or read from. So both endpoints of a declarative connection need to be looked at to determine which one should be consider the "source" and which one should be considered the "destination" for the type checking. |
Declarative checks are in and have unit tests. |
Connections in the instance model aren't so straightforward either because we allow instantiation of incomplete models. Thus, we still have to go through some gymnastics to figure out which end of the connection belongs to the provider of shared access, and which end is the requirer. The best case is when one end of the connection is a When both ends are |
@AaronGreenhouse The fix for #758 should help for the instance model case |
It's a little easier than the declarative case. If one end is a If both ends are
|
Connection instances that only go up (or down) the containment hierarchy should only be created if one end feature is at the instance model root component. All other connection instances should contain a segment that connects two sibling components. |
Checked in change to |
Don't forget to deal with |
Fixed declarative checking to handle feature groups. Updated JUnit tests. |
Testing inverse feature groups on the instantiated models. I haven't changed any code yet. The following tests works correctly:
In this case we do not check the direction of the feature in the feature group because we know the source of the connection is a subcomponent.
These work fine. These use an inverse feature group type that explicitly redeclares the features. These work because the features are going to have the correct direction because the are explicitly redeclared. The following do not work. The connection instances do not get created: Instead there are errors about the connections not having valid connections.
NB. The unnumbered case uses an inverse feature group without explicit features. The (3) case uses |
Need to fix |
Urgh. Check I added for issue #582 in
|
Updated
This fixes the connection problem (above). The featurea groups are then checked correctly on the instance model. Updated the JUnit tests for the instance model. Seems to be working. |
All the unit tests pass. |
Fixed by merging #2370 |
Aadl2JavaValidator
doesn't checkClassifier_Match
sematnics correctly in the methodtestClassifierMatchRule()
. According to the standard:But the method also allows the src to be a type and the dest to the an implementation of the type. This is well known to be unsafe.
Also, the method currently generates warnings when one classifier is a type and the other is an implementation and the implementation is not an implementation of that type. This should be an error.
The text was updated successfully, but these errors were encountered: