Community
Participate
Working Groups
Created attachment 282659 [details] 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