feat(gapic-generator): Add NullMarked annotation to generated classes#13584
feat(gapic-generator): Add NullMarked annotation to generated classes#13584nnicolee wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds the org.jspecify:jspecify dependency to multiple pom.xml files across various Google Cloud Java proto modules. However, in the java-bigtable modules, the dependency was incorrectly placed inside the <dependencyManagement> block instead of the <dependencies> block. Additionally, since these pom.xml files are auto-generated, manual edits should be avoided to prevent them from being overwritten; instead, the generator or source metadata should be updated.
| <dependency> | ||
| <groupId>org.jspecify</groupId> | ||
| <artifactId>jspecify</artifactId> | ||
| </dependency> |
There was a problem hiding this comment.
Avoid manually editing auto-generated files like pom.xml in generated client libraries because changes will be overwritten. To ensure the jspecify dependency is correctly placed in the <dependencies> block instead of <dependencyManagement>, please modify the generator or the source metadata instead.
References
- Avoid manually editing auto-generated files (such as pom.xml in generated client libraries) because changes will be overwritten. Modify the generator or the source metadata instead.
| <dependency> | ||
| <groupId>org.jspecify</groupId> | ||
| <artifactId>jspecify</artifactId> | ||
| </dependency> |
There was a problem hiding this comment.
Avoid manually editing auto-generated files like pom.xml in generated client libraries because changes will be overwritten. To ensure the jspecify dependency is correctly placed in the <dependencies> block instead of <dependencyManagement>, please modify the generator or the source metadata instead.
References
- Avoid manually editing auto-generated files (such as pom.xml in generated client libraries) because changes will be overwritten. Modify the generator or the source metadata instead.
9c4d5d9 to
3bb9a98
Compare
|
|





This PR updates the gapic-generator-java to add the JSpecify @NullMarked annotation to all generated class declarations. Adding @NullMarked at the class level defines the class scope as null-safe, establishing that all unannotated types in method signatures (parameters and return types) are nonnull able by default. This is the first phase in onboarding the generated client libraries to compile-time safety validation, see design doc for more details: go/sdk:java-jspecify-null-annotations-gapic
Classes Annotated:
Implementation Changes:
Verification/Testing:
Revisions:
Next Steps: