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

@Generated annotation is not added to the generated classes #1162

Closed
sergeykad opened this issue Sep 18, 2020 · 2 comments
Closed

@Generated annotation is not added to the generated classes #1162

sergeykad opened this issue Sep 18, 2020 · 2 comments

Comments

@sergeykad
Copy link

sergeykad commented Sep 18, 2020

The @Generated annotation is handy to quickly spot generated classes.
In addition, some tools like Google Error Prone, rely on it to distinguish between the regular and generated code. The missing annotation makes Error Prone practically unusable since hundreds of errors are reported for the code generated by jsonschema2pojo.

@joelittlejohn
Copy link
Owner

joelittlejohn commented Sep 18, 2020

You might be interested in this solution: #835 (comment). You can remove the paths that contain generated output from Error Prone's scanning.

We originally removed @Generated because it caused hassle for Android users: #577. Their classes would not compile without adding an additional library and it caused a lot of questions.

I do agree though, it's a lot nicer to annotate these generated classes correctly because a lot of tools will read that annotation.

We still support Java 8 though so I think we need to add javax.annotation.Generated or javax.annotation.processing.Generated depending on what we find is available.

@sergeykad
Copy link
Author

Thanks for the detailed explanation. Looks like I inadvertently duplicated an issue. I am closing this one and will add comments to the #835

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

No branches or pull requests

2 participants