feat(gapic-generator): add JSpecify Null annotations to the generator classes#13769
feat(gapic-generator): add JSpecify Null annotations to the generator classes#13769nnicolee wants to merge 12 commits into
Conversation
…leapis/google-cloud-java into feat/jspecify-generator-annotations
…leapis/google-cloud-java into feat/jspecify-generator-annotations
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces JSpecify nullness annotations (@NullMarked and @Nullable) across the codebase to improve null-safety and static analysis. The review feedback highlights a potential nullness analysis error in Writer.java, where the gapicPackageInfo parameter of the write method should be explicitly annotated with @Nullable because it can receive null values from Composer.composePackageInfo.
|
|





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