Skip to content

Conversation

@ehsavoie
Copy link
Collaborator

@ehsavoie ehsavoie commented Dec 9, 2025

  • upgrading nullaway and error-prone on default profile
  • fixing nullaway detection not working

Fixes #519 🦕

* upgrading nullaway and error-prone on default profile
* fixing nullaway detection not working

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ehsavoie, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs essential maintenance by upgrading the error-prone and nullaway static analysis tools to their latest versions. A critical fix is also included to ensure nullaway detection functions correctly, which was previously hindered by an incorrect compiler argument configuration. These changes enhance the project's static analysis capabilities and improve code quality by ensuring proper nullability checks.

Highlights

  • Dependency Upgrades: The error-prone dependency has been updated from version 2.43.0 to 2.45.0, and nullaway has been updated from 0.12.12 to 0.12.14.
  • NullAway Detection Fix: The configuration for the maven-compiler-plugin was adjusted to correctly pass the error-prone.flag argument, resolving an issue where nullaway detection was not working as expected.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ehsavoie ehsavoie requested review from jmesnil and kabir December 9, 2025 13:01
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully upgrades the Error Prone and NullAway dependencies and refactors the compiler arguments. However, there is a critical issue with the logic for applying the -XDaddTypeAnnotationsToSymbol=true compiler flag. It is currently enabled by default and disabled for older JDKs, which is the reverse of the required behavior. This will cause the build to fail on JDK 22 and newer, including the target JDK 25. My review comment provides details on how to correct this.

Comment on lines +344 to +345
<arg>${error-prone.flag}</arg>
<arg>-Xplugin:ErrorProne -XepDisableAllChecks -Xep:NullAway:ERROR -XepOpt:NullAway:OnlyNullMarked=true -XepOpt:NullAway:JSpecifyMode=true -XepExcludedPaths:.*/src/test/.* -XepDisableWarningsInGeneratedCode</arg>
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

While separating compiler arguments into distinct <arg> tags is a good practice, this change highlights a critical misconfiguration of the -XDaddTypeAnnotationsToSymbol=true flag, which is passed via the ${error-prone.flag} property.

According to the NullAway documentation, this flag is:

  • Required for JDK versions before 22.
  • Removed from javac in JDK 22 and later versions.

The current pom.xml logic is inverted:

  • The flag is enabled by default (defined on line 71), which will cause builds to fail on JDK 22+ (including the target JDK 25 for this PR).
  • The flag is disabled for older JDKs via the old_jdk_support profile (on line 542).

To resolve this, the logic must be reversed: the flag should be empty by default and set only within the old_jdk_support profile. This will require changes on lines 71 and 542.

Additionally, the property definition on line 71 currently includes a trailing space. When correcting the logic, this space should be removed from the property value to prevent passing an invalid argument to the compiler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are wrong gemini: the flag works properly and the version is 21.0.8 except for Oracle JDK. second the railing space is trimmed down by maven

@ehsavoie ehsavoie merged commit 5099174 into a2aproject:main Dec 9, 2025
10 checks passed
@ehsavoie ehsavoie deleted the fix_nullaway branch December 11, 2025 08:23
@jmesnil jmesnil added this to the 1.0.0 milestone Dec 11, 2025
kabir pushed a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
* upgrading nullaway and error-prone on default profile
* fixing nullaway detection not working

Fixes a2aproject#519 🦕

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
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

Successfully merging this pull request may close these issues.

[Bug]: NullAway doesn't seem to work with JDK 25

2 participants