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

PropertyIsModalException in validator #2417

Closed
joeseibel opened this issue Aug 21, 2020 · 0 comments · Fixed by #2437
Closed

PropertyIsModalException in validator #2417

joeseibel opened this issue Aug 21, 2020 · 0 comments · Fixed by #2437

Comments

@joeseibel
Copy link
Contributor

When the validator looks up Classifier_Matching_Rule on a connection, it assumes that the property is not modal. If it is modal then the validator should instead complain that the Classifier_Matching_Rule property should not be modal.

Example model:

package pkg1
public
  system s
    modes
      m1: initial mode;
      m2: mode;
  end s;

  system implementation s.i
    subcomponents
      sub1: abstract a;
      sub2: abstract a;
    connections
      conn1: port sub1.p -> sub2.p {
        Classifier_Matching_Rule => Classifier_Match in modes (m1), Subset in modes (m2);
      };
  end s.i;

  abstract a
    features
      p: in out data port d;
  end a;

  data d
  end d;
end pkg1;

Stack trace:

org.osate.aadl2.properties.PropertyIsModalException: A non-modal property lookup method was called for a modal property.  This occurred when looking up Property Classifier_Matching_Rule on NamedElement conn1.
	at org.osate.aadl2.impl.NamedElementImpl.getNonModalPropertyValue(NamedElementImpl.java:424)
	at org.osate.aadl2.impl.NamedElementImpl.getSimplePropertyValue(NamedElementImpl.java:369)
	at org.osate.xtext.aadl2.properties.util.PropertyUtils.getSimplePropertyValue(PropertyUtils.java:861)
	at org.osate.xtext.aadl2.properties.util.PropertyUtils.getEnumLiteral(PropertyUtils.java:314)
	at org.osate.xtext.aadl2.properties.util.GetProperties.getClassifierMatchingRuleProperty(GetProperties.java:2111)
	at org.osate.xtext.aadl2.validation.Aadl2JavaValidator.checkPortConnectionClassifiers(Aadl2JavaValidator.java:5311)
	at org.osate.xtext.aadl2.validation.Aadl2JavaValidator.casePortConnection(Aadl2JavaValidator.java:390)
	at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:127)
	at org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:318)
	at org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:71)
	at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:150)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:299)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:245)
	at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:40)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:200)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:142)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:146)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:124)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:90)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:91)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:1)
	at org.eclipse.xtext.util.concurrent.CancelableUnitOfWork.exec(CancelableUnitOfWork.java:26)
	at org.eclipse.xtext.util.concurrent.WrappingCancelableUnitOfWork.exec(WrappingCancelableUnitOfWork.java:57)
	at org.eclipse.xtext.util.concurrent.CancelableUnitOfWork.exec(CancelableUnitOfWork.java:26)
	at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:91)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:524)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:496)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:135)
	at org.eclipse.xtext.util.concurrent.IReadAccess.tryReadOnly(IReadAccess.java:49)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(ValidationJob.java:86)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:67)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants