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

AVRO-4119: [java] Make Nullable and NotNull annotations configurable #3312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benediktwerner
Copy link
Contributor

@benediktwerner benediktwerner commented Feb 14, 2025

What is the purpose of the change

This pull request adds the nullSafeAnnotationNullable and nullSafeAnnotationNotNull configuration options to the Java code generator, making it possible to specify the exact annotations to use when createNullSafeAnnotations is enabled.

This allows using nullability annotations besides the JetBrains annotations (which remain the default for backward compatibility), fixing AVRO-4119.

Verifying this change

This change added tests and can be verified as follows:

  • Added test that validates that JSpecify instead of JetBrains annotations are generated when the new configuration values are set appropriately.

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

Add nullSafeAnnotationNullable and nullSafeAnnotationNotNull
configuration options to allow specifying the exact annotations
to use when createNullSafeAnnotations is enabled.

This allows using annotations besides the JetBrains annotations
(which remain the default for backward-compatibility).
@github-actions github-actions bot added Java Pull Requests for Java binding build labels Feb 14, 2025
Copy link
Contributor

@opwvhk opwvhk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but there's one file that should also be removed (see previous comment).

@benediktwerner
Copy link
Contributor Author

Is the failing interop test relevant? Tbh I'm not sure I understand what the problem with it is.

@opwvhk
Copy link
Contributor

opwvhk commented Feb 22, 2025

Is the failing interop test relevant? Tbh I'm not sure I understand what the problem with it is.

Looks like a classpath issue: it seems to use an old version of the compiler (without your change).

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

Successfully merging this pull request may close these issues.

2 participants