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

ClassCastException when validating UML model with ecore.util.Diagnostician #98

Open
eclipse-uml2-bot opened this issue Nov 14, 2024 · 0 comments

Comments

@eclipse-uml2-bot
Copy link

| --- | --- |
| Bugzilla Link | 562703 |
| Status | UNCONFIRMED |
| Importance | P3 normal |
| Reported | May 01, 2020 13:43 EDT |
| Modified | May 01, 2020 13:43 EDT |
| Version | 5.5.0 |
| Reporter | Hoang Lam Nguyen |

Description

Created attachment 282659
complete project including test program and error-producing models

Hello,

the validation of certain UML models through ecore.util.Diagnostician (instead of directly using the UMLValidator) results in a ClassCastException (attempting to cast to a StateMachine), as follows:

Exception in thread "main" java.lang.ClassCastException: org.eclipse.uml2.uml.internal.impl.FunctionBehaviorImpl cannot be cast to org.eclipse.uml2.uml.StateMachine
at org.eclipse.uml2.uml.internal.operations.StateMachineOperations.isConsistentWith(StateMachineOperations.java:360)
at org.eclipse.uml2.uml.internal.impl.StateMachineImpl.isConsistentWith(StateMachineImpl.java:495)
at org.eclipse.uml2.uml.internal.operations.RedefinableElementOperations.validateRedefinitionConsistent(RedefinableElementOperations.java:125)
at org.eclipse.uml2.uml.internal.impl.ClassifierImpl.validateRedefinitionConsistent(ClassifierImpl.java:1624)
at org.eclipse.uml2.uml.util.UMLValidator.validateRedefinableElement_validateRedefinitionConsistent(UMLValidator.java:6752)
at org.eclipse.uml2.uml.util.UMLValidator.validateFunctionBehavior(UMLValidator.java:13321)
at org.eclipse.uml2.uml.util.UMLValidator.validate(UMLValidator.java:4488)
at org.eclipse.emf.ecore.util.EObjectValidator.validate(EObjectValidator.java:324)
at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:257)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:244)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:201)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:155)
at repro.UML2ValidatorTest.main(UML2ValidatorTest.java:38)

In the attachment you can find a project containing the test program and three UML models to reproduce the error. I am running Eclipse Modeling Tools 2020-03 (4.15.0) with Java 1.8.0_171.

Best regards,
Hoang Lam Nguyen

:compression: BugReport.zip

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

No branches or pull requests

1 participant