Skip to content

feat(gapic-generator): add JSpecify Null annotations to the generator classes#13769

Draft
nnicolee wants to merge 7 commits into
mainfrom
feat/jspecify-generator-annotations
Draft

feat(gapic-generator): add JSpecify Null annotations to the generator classes#13769
nnicolee wants to merge 7 commits into
mainfrom
feat/jspecify-generator-annotations

Conversation

@nnicolee

Copy link
Copy Markdown
Contributor

This PR continues the onboarding of the gapic-generator-java project to JSpecify null-safety. Specifically, it applies the @NullMarked annotation to all modified source and test classes in this branch to declare them non-null by default.

Annotations Applied

  • @NullMarked Class Declarations: Applied at the class level to all modified source and test classes to establish a non-null by default context.
  • @nullable Type Annotations: Applied to specific methods, fields, and parameters to explicitly denote where null values are accepted/returned.

Automation Method
To apply the class-level annotations efficiently, we leveraged Chris's Error Prone automation tool (custom BugChecker plugin under com.google.errorprone.bugpatterns.nullness) to run AST-based refactoring and automatically insert the JSpecify @NullMarked annotations across the codebase.

Verification/Testing

  • Please refer to this doc: (link tba)

@nnicolee nnicolee requested a review from lqiu96 July 14, 2026 14:20
@nnicolee nnicolee added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 14, 2026
gemini-code-assist[bot]

This comment was marked as resolved.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
B Maintainability Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant