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

JaMoPP Parser combined with Java2UML Reactions leads to Exception #166

Open
SofiaAnanieva opened this issue Sep 22, 2021 · 0 comments
Open
Labels
Java Related to Java Applications or Java Domain UML Related to UML Applications or UML Domain

Comments

@SofiaAnanieva
Copy link

SofiaAnanieva commented Sep 22, 2021

The JaMoPP parser does not create package elements, but instead only adds a prefix to all compilation unit names. Consequently, when using the JaMoPP parser and executing Java2UML reactions, the packages are not propagated to UML and the following exception occurs:

java.lang.IllegalStateException: The object org.eclipse.uml2.uml.internal.impl.ClassImpl@f4e74b0 (name: String, visibility: public) (isLeaf: false, isAbstract: false, isFinalSpecialization: true) (isActive: false) is part of a correspondence to [[org.emftext.language.java.classifiers.impl.ClassImpl@15cf976f (name: String)], [org.emftext.language.java.containers.impl.CompilationUnitImpl@7b667c59 (name: java.lang.String.java) (namespaces: [java, lang])]] but not in any resource

There are two options to circumvent this error and propagate packages correctly:

  1. After creating the Java model instance with JaMoPP, packages must be added manually, similar to the following test case: https://github.com/vitruv-tools/Vitruv-Applications-ComponentBasedSystems/blob/a75[…]/applications/umljava/tests/java2uml/JavaToUmlPackageTest.xtend

  2. package-info.java files are placed in every package. The reactions process these files to create respective UML packages, even without package elements in the Java model instance.

A possible fix could be to adapt the reactions and have them create containing packages during class transformations.

@JanWittler JanWittler added Java Related to Java Applications or Java Domain UML Related to UML Applications or UML Domain labels Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Related to Java Applications or Java Domain UML Related to UML Applications or UML Domain
Projects
None yet
Development

No branches or pull requests

2 participants