Skip to content

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).

@benediktwerner
Copy link
Contributor Author

Hey, so, is there still something left for me to do to get this merged?

@opwvhk
Copy link
Contributor

opwvhk commented Apr 29, 2025

Some recent changes to main fixed the failing check, and there have been no conflicting changes. I propose to merge this near the end of the week unless someone objects.

@opwvhk opwvhk merged commit 067c440 into apache:main May 3, 2025
8 checks passed
opwvhk added a commit that referenced this pull request Jun 13, 2025
…3312)

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).

Co-authored-by: Oscar Westra van Holthe - Kind <opwvhk@apache.org>
(cherry picked from commit 067c440)
opwvhk added a commit to opwvhk/avro that referenced this pull request Sep 5, 2025
…pache#3312)

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).

Co-authored-by: Oscar Westra van Holthe - Kind <opwvhk@apache.org>
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