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

Maven Plugin: inconsistent logging of ClassAlreadyExistsException #1555

Closed
tonketonky opened this issue Aug 11, 2023 · 1 comment · Fixed by #1597
Closed

Maven Plugin: inconsistent logging of ClassAlreadyExistsException #1555

tonketonky opened this issue Aug 11, 2023 · 1 comment · Fixed by #1597

Comments

@tonketonky
Copy link

Hi!

within this commit logging of ClassAlreadyExistsException was added to EnumRule.java. This makes it inconsistent with other *Rule.java clasess. For instance ObjectRule.java does not do it (see here).

I am not sure if such logging of ClassAlreadyExistsException is desired but suddenly getting following errors only for enums after upgrade is quite confusing:

[INFO] --- jsonschema2pojo:1.2.1:generate (default) @ my-module ---
[ERROR] Could not create enum.
org.jsonschema2pojo.exception.ClassAlreadyExistsException: com.my.package.MyEnum
    at org.jsonschema2pojo.rules.EnumRule.createEnum (EnumRule.java:349)
    at org.jsonschema2pojo.rules.EnumRule.apply (EnumRule.java:116)
    at org.jsonschema2pojo.rules.EnumRule.apply (EnumRule.java:68)
    at org.jsonschema2pojo.rules.SchemaRule.apply (SchemaRule.java:81)
    at org.jsonschema2pojo.rules.SchemaRule.apply (SchemaRule.java:76)
    ...

Thanks for taking a look at this!

@joelittlejohn
Copy link
Owner

Yes, it looks like this branch is within the normal flow of things and not an exception that should be logged.

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