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

Error propagation in feature group type result in errors. #2408

Closed
philip-alldredge opened this issue Aug 12, 2020 · 4 comments · Fixed by #2554
Closed

Error propagation in feature group type result in errors. #2408

philip-alldredge opened this issue Aug 12, 2020 · 4 comments · Fixed by #2554
Assignees
Labels
Milestone

Comments

@philip-alldredge
Copy link
Collaborator

Summary

Expected and Current Behavior

It should be possible to define an error propagation in a feature group type. This currently results in an error.

Steps to Reproduce

  1. Define an emv2 error propagation in a feature group type.
  2. Errors regarding being unable to resolve the feature and the error are reported.
package emv2_test
public
	feature group fgt
	features 
		ip1: in data port;
		
		annex emv2 {**
			use types ErrorLibrary;
			error propagations
				ip1: in propagation {ServiceError};
			end propagations;
		**};
	end fgt;	

end emv2_test;
@philip-alldredge
Copy link
Collaborator Author

For reference: E.4 (L1), (L3), (21), and (22). Page 69 in the official SAE PDF is the portions of the standard that reference feature group types having error propagations.

@lwrage lwrage added this to the 2.9.1 milestone Oct 2, 2020
@joeseibel
Copy link
Contributor

joeseibel commented Oct 6, 2020

There are a few different problems here that need to be fixed. First of all, the validator throws a ClassCastException when a subclause exists in a feature group type, even if the subclause is empty. Here is the exception:

java.lang.ClassCastException: org.osate.aadl2.impl.FeatureGroupTypeImpl cannot be cast to org.osate.aadl2.ComponentClassifier
	at org.osate.xtext.aadl2.errormodel.validation.ErrorModelValidator.checkDuplicateSubclause(ErrorModelValidator.java:558)
	at org.osate.xtext.aadl2.errormodel.validation.ErrorModelValidator.caseErrorModelSubclause(ErrorModelValidator.java:296)
	...

Secondly, the scope provider does not resolve the references to ip1 and ServiceError.

Thirdly, the validator throws another ClassCastException when an error propagation is in a feature group type:

java.lang.ClassCastException: org.osate.aadl2.impl.FeatureGroupTypeImpl cannot be cast to org.osate.aadl2.ComponentClassifier
	at org.osate.xtext.aadl2.errormodel.util.EMV2Util.getAssociatedClassifier(EMV2Util.java:203)
	at org.osate.xtext.aadl2.errormodel.util.EMV2Util.getAllContainingClassifierEMV2Subclauses(EMV2Util.java:176)
	at org.osate.xtext.aadl2.errormodel.util.EMV2Util.findErrorContainment(EMV2Util.java:381)
	at org.osate.xtext.aadl2.errormodel.validation.ErrorModelValidator.checkTypePropagationAndContainment(ErrorModelValidator.java:530)
	at org.osate.xtext.aadl2.errormodel.validation.ErrorModelValidator.caseErrorPropagation(ErrorModelValidator.java:209)
	...

These stack traces show that the validator and EMV2Util assume that a subclause is always in a ComponentClassifier. There are probably lots and lots of places in EMV2 code that make this assumption.

@lwrage lwrage added the emv2 label Oct 7, 2020
@lwrage
Copy link
Contributor

lwrage commented Oct 7, 2020

It is not clear if this construct really makes sense. See saeaadl/emv2#50.

@lwrage
Copy link
Contributor

lwrage commented Jan 15, 2021

We don't support error model annex subclauses in feature group types any longer.

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

Successfully merging a pull request may close this issue.

3 participants