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

If in the JAVA code I use a List of Enum but in the model I only have the reference to the Enum, the plugin didn't complain about it. #7

Open
juan-conca opened this issue Dec 13, 2022 · 1 comment

Comments

@juan-conca
Copy link

Describe the bug
When I define a CommandEvent that has a reference to an attribute in the java code but is not the same type, the plugging didn't complain.

To Reproduce
Create your own CommandEvent in the model:

enum UserRole {
           USER_ROLE_1,
           USER_ROLE_2,
           USER_ROLE_3,
           USER_ROLE_4
}

CommandEvent UserChangeRolesCommand {
           - UserId userId;
           - UserRole userRoles;
           - UserId submittedBy;
}

Then in your JAVA code, you make the error to define a list of enums, not just an enum:

@Command
@DomainRing
public final class UserChangeRolesCommand {

    private final UserId userId;
    private final List<UserRole> userRoles;
    private final UserId submittedBy;
    ...

And when compile, the plugging is not complaining about the difference of types

Expected behaviour
I expect that If I define a list in the JAVA code and is not the same type in the model, the plugging complains

IDE and Plugin (please complete the following information):

IntelliJ IDEA 2022.3 (Ultimate Edition)
Build #IU-223.7571.182, built on November 29, 2022
Runtime version: 17.0.5+1-b653.14 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.0.1
GC: G1 Young Generation, G1 Old Generation
Non-Bundled Plugins:
com.intellij.kubernetes (223.7571.188)
com.dubreuia (2.3.0)
de.docksnet.puml.syntaxchecker (0.2.0)
PlantUML integration (5.20)
org.asciidoctor.intellij.asciidoc (0.38.3)
org.mapstruct.intellij (1.4.0)
com.haulmont.jpab (2022.5.1-223)
org.sonarlint.idea (7.2.1.58118)

Kotlin: 223-1.7.20-release-201-IJ7571.182

@stefan-ka
Copy link
Member

Thanks for reporting this one as well @juan-conca!
Yes, we should implement some type checking, at least there where an easy mapping between CML and Java is possible 👍

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

No branches or pull requests

2 participants