You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 613a074
Browse filesBrowse the repository at this point in the historyBrowse files
This PR removes all occurrences of `javax.annotation.Nonnull` (both
imports and annotations) from the codebase of `gapic-generator-java`.
### Why this change is needed:
As part of the migration to JSpecify annotations, generator classes are
annotated with `@NullMarked`, making all unannotated types non-nullable
by default. The legacy `javax.annotation.Nonnull` annotations are
redundant and can be safely removed.
### Changes:
- Removed `import javax.annotation.Nonnull;` and `@Nonnull` from 4 files
in the generator codebase (`TypeParser.java`,
`SourceCodeInfoLocation.java`, `TryCatchStatement.java`, and
`ImportWriterVisitor.java`).
- Formatted the modified files using `fmt-maven-plugin`.
- Verified that all compilation references to `javax.annotation.Nonnull`
under `gapic-generator-java` have been eliminated.
Copy file name to clipboardExpand all lines: sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TryCatchStatement.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,6 @@
20
20
importjava.util.ArrayList;
21
21
importjava.util.Collections;
22
22
importjava.util.List;
23
-
importjavax.annotation.Nonnull;
24
23
importorg.jspecify.annotations.NullMarked;
25
24
importorg.jspecify.annotations.Nullable;
26
25
@@ -62,7 +61,7 @@ public abstract static class Builder {
Copy file name to clipboardExpand all lines: sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java
Copy file name to clipboardExpand all lines: sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/SourceCodeInfoLocation.java
Copy file name to clipboardExpand all lines: sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/TypeParser.java
0 commit comments