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

Add @Generated annotation to Java code generated from the compiler #5855

Closed
kasecato opened this issue Apr 25, 2024 · 3 comments
Closed

Add @Generated annotation to Java code generated from the compiler #5855

kasecato opened this issue Apr 25, 2024 · 3 comments

Comments

@kasecato
Copy link
Contributor

kasecato commented Apr 25, 2024

Use case

As a NullAway user using Apollo Kotlin from Java, I want @Generated annotation added to the code generated by apollo-compiler. So that enables the NullAway option, which omits null checking of the generated Java code.

Describe the solution you'd like

We can add @Generated to class around JavaCodegen.kt

@BoD
Copy link
Contributor

BoD commented Apr 30, 2024

Thanks for the feature request!

I didn't know about @Generated and it sounds reasonable to apply it, but I'm concerned that javax.annotation.Generated requires a specific dependency, whereas javax.annotation.processing.Generated is in the JDK starting from version 9 while Apollo Kotlin has a minimal version of 8.

Could you maybe use ErrorProne's -XepExcludedPaths flag instead?

@BoD BoD added ⚙️ Codegen ⌛ Waiting for info More information is required ☕ Java labels Apr 30, 2024
@kasecato
Copy link
Contributor Author

kasecato commented May 1, 2024

I have two suggestions, but no strong opinions and let me close this request

  1. Use jakarta.annotation.Generated at compileOnly
  2. Create a custom @Generated in apollo-annotations
    • Overkill

@kasecato kasecato closed this as completed May 1, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.

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

No branches or pull requests

2 participants