Bug 400677 - Validation of a model crashes when combined with xtext Validator
Summary: Validation of a model crashes when combined with xtext Validator
Status: CLOSED WONTFIX
Alias: None
Product: Sphinx
Classification: Automotive
Component: Validation Runtime Extensions (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 07:17 EST by Florina Craciunescu CLA
Modified: 2024-05-07 00:28 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florina Craciunescu CLA 2013-02-13 07:17:50 EST
When validating a model, the following exception is thwron:

java.lang.ClassCastException: org.eclipse.xtext.validation.CompositeEValidator cannot be cast to org.eclipse.emf.ecore.util.EObjectValidator
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.validate(ExtendedDiagnostician.java:244)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.doValidateContents(ExtendedDiagnostician.java:280)
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.validate(ExtendedDiagnostician.java:265)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.validate(ExtendedDiagnostician.java:104)
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.validate(ExtendedDiagnostician.java:206)
	at org.eclipse.sphinx.emf.validation.diagnostic.ExtendedDiagnostician.validate(ExtendedDiagnostician.java:212)
	at org.eclipse.sphinx.emf.validation.ui.actions.BasicValidateAction.validateMulti(BasicValidateAction.java:153)
Comment 1 Florina Craciunescu CLA 2013-02-13 07:56:25 EST
It seems that in ExtendedDiagnostician class, the cast from line 244, to EObjectValidator:

result = eValidator instanceof EValidatorAdapter ? ((EValidatorAdapter) eValidator).validate(eClass, eObject, diagnostics, context,
					filters) : ((EObjectValidator) eValidator).validate(eClass, eObject, diagnostics, context);

is not necessary, because the called method is actually from the implemented interface EValidator.

Both CompositeEValidator and EObjectValidator implement EValidator.
Comment 2 Balazs Grill CLA 2024-05-07 00:28:16 EDT
Closed stale issue before migration