Skip to content

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

Merged
nnicolee merged 12 commits into
mainfrom
feat/jspecify-generator-annotations
Jul 23, 2026
Merged

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

Merge branch 'main' into feat/jspecify-generator-annotations

6e18ad9
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / [gapic-generator-java-root] SonarCloud Code Analysis failed Jul 23, 2026 in 1m 43s

Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Annotations

Check warning on line 419 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'toValExpr' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYHWvRucpnsdSfeQ&open=AZ9sFYHWvRucpnsdSfeQ&pullRequest=13769

Check warning on line 186 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'formatAsJavaDocComment' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYYrvRucpnsdSfer&open=AZ9sFYYrvRucpnsdSfer&pullRequest=13769

Check warning on line 183 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/ResourceNameParser.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'setParentMessageName' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_Rfvhlaxwr_h2CZ&open=AZ9hB_Rfvhlaxwr_h2CZ&pullRequest=13769

Check warning on line 1858 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'setConditionExpr' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYNlvRucpnsdSfec&open=AZ9sFYNlvRucpnsdSfec&pullRequest=13769

Check warning on line 260 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'formatAsJavaDocComment' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYYrvRucpnsdSfeo&open=AZ9sFYYrvRucpnsdSfeo&pullRequest=13769

Check warning on line 120 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'setReference' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB-9fvhlaxwr_h2B3&open=AZ9hB-9fvhlaxwr_h2B3&pullRequest=13769

Check warning on line 830 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'createMethodArgValue' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYGNvRucpnsdSfeO&open=AZ9sFYGNvRucpnsdSfeO&pullRequest=13769

Check warning on line 774 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'toUpperCamelCase' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYIQvRucpnsdSfeU&open=AZ9sFYIQvRucpnsdSfeU&pullRequest=13769

Check warning on line 892 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'createSimpleMessageBuilderValue' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYWjvRucpnsdSfem&open=AZ9sFYWjvRucpnsdSfem&pullRequest=13769

Check warning on line 72 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ThrowExpr.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "true"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_CXvhlaxwr_h2CA&open=AZ9hB_CXvhlaxwr_h2CA&pullRequest=13769

Check warning on line 940 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'withValue' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYi-vRucpnsdSfeu&open=AZ9sFYi-vRucpnsdSfeu&pullRequest=13769

Check warning on line 202 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'isAssignableFrom' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB-9fvhlaxwr_h2B4&open=AZ9hB-9fvhlaxwr_h2B4&pullRequest=13769

Check warning on line 1513 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "false"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_Khvhlaxwr_h2CJ&open=AZ9hB_Khvhlaxwr_h2CJ&pullRequest=13769

Check warning on line 172 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'expressions' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_EEvhlaxwr_h2CF&open=AZ9hB_EEvhlaxwr_h2CF&pullRequest=13769

Check warning on line 1199 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'setFieldInfoFormat' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_Pdvhlaxwr_h2CW&open=AZ9hB_Pdvhlaxwr_h2CW&pullRequest=13769

Check warning on line 177 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/VariableExpr.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'isReferenceType' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_Dwvhlaxwr_h2CE&open=AZ9hB_Dwvhlaxwr_h2CE&pullRequest=13769

Check warning on line 701 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'setType' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYNlvRucpnsdSfed&open=AZ9sFYNlvRucpnsdSfed&pullRequest=13769

Check warning on line 205 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/MethodSignatureParser.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'parseResourceNames' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYsBvRucpnsdSfe3&open=AZ9sFYsBvRucpnsdSfe3&pullRequest=13769

Check warning on line 75 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ThrowExpr.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "false"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_CXvhlaxwr_h2CB&open=AZ9hB_CXvhlaxwr_h2CB&pullRequest=13769

Check warning on line 399 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'withValue' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYIQvRucpnsdSfeV&open=AZ9sFYIQvRucpnsdSfeV&pullRequest=13769

Check warning on line 1519 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "false"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_Khvhlaxwr_h2CL&open=AZ9hB_Khvhlaxwr_h2CL&pullRequest=13769

Check warning on line 573 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "true"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYl5vRucpnsdSfex&open=AZ9sFYl5vRucpnsdSfex&pullRequest=13769

Check warning on line 619 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'createSimpleMessageBuilderValue' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYWjvRucpnsdSfel&open=AZ9sFYWjvRucpnsdSfel&pullRequest=13769

Check warning on line 675 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Annotate the parameter with @javax.annotation.Nullable in method 'withReference' declaration, or make sure that null can not be passed as argument.

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9sFYi-vRucpnsdSfev&open=AZ9sFYi-vRucpnsdSfev&pullRequest=13769

Check warning on line 142 in sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/AnnotationNode.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / [gapic-generator-java-root] SonarCloud Code Analysis

Remove this expression which always evaluates to "false"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_generator&issues=AZ9hB_BBvhlaxwr_h2B8&open=AZ9hB_BBvhlaxwr_h2B8&pullRequest=13769