Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractServiceCallableFactoryClassComposer implements ClassComposer {
private final TransportContext transportContext;
Expand Down Expand Up @@ -93,6 +94,7 @@ public GapicClass generate(GapicContext context, Service service) {

protected List<AnnotationNode> createClassAnnotations(Service service, TypeStore typeStore) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(typeStore.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(typeStore.get("BetaApi")));
}
Expand Down Expand Up @@ -349,7 +351,8 @@ private TypeStore createTypes(Service service) {
UnaryCallSettings.class,
UnaryCallable.class,
Generated.class,
UnsupportedOperationException.class);
UnsupportedOperationException.class,
NullMarked.class);
return new TypeStore(concreteClazzes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractServiceClientClassComposer implements ClassComposer {
private static final String CALLABLE_NAME_PATTERN = "%sCallable";
Expand Down Expand Up @@ -193,6 +194,7 @@ public GapicClass generate(GapicContext context, Service service) {

private static List<AnnotationNode> createClassAnnotations(Service service, TypeStore typeStore) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(typeStore.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(typeStore.get("BetaApi")));
}
Expand Down Expand Up @@ -1786,6 +1788,7 @@ private static TypeStore createTypes(Service service, Map<String, Message> messa
InterruptedException.class,
IOException.class,
MoreExecutors.class,
NullMarked.class,
Objects.class,
Operation.class,
OperationFuture.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractServiceSettingsClassComposer implements ClassComposer {
private static final String BUILDER_CLASS_NAME = "Builder";
Expand Down Expand Up @@ -204,6 +205,7 @@ private static List<CommentStatement> createClassHeaderComments(

private static List<AnnotationNode> createClassAnnotations(Service service) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi")));
}
Expand Down Expand Up @@ -847,7 +849,8 @@ private static TypeStore createStaticTypes() {
StreamingCallSettings.class,
StubSettings.class,
TransportChannelProvider.class,
UnaryCallSettings.class);
UnaryCallSettings.class,
NullMarked.class);
return new TypeStore(concreteClazzes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractServiceStubClassComposer implements ClassComposer {

Expand Down Expand Up @@ -93,6 +94,7 @@ public GapicClass generate(GapicContext context, Service service) {

private static List<AnnotationNode> createClassAnnotations(Service service, TypeStore typeStore) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(typeStore.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(typeStore.get("BetaApi")));
}
Expand Down Expand Up @@ -270,7 +272,8 @@ private static TypeStore createTypes(Service service, Map<String, Message> messa
OperationCallable.class,
ServerStreamingCallable.class,
UnaryCallable.class,
UnsupportedOperationException.class);
UnsupportedOperationException.class,
NullMarked.class);
TypeStore typeStore = new TypeStore(concreteClazzes);

typeStore.put("com.google.longrunning.stub", "OperationsStub");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
import java.util.stream.Collectors;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractServiceStubSettingsClassComposer implements ClassComposer {
private static final Statement EMPTY_LINE_STATEMENT = EmptyLineStatement.create();
Expand Down Expand Up @@ -411,6 +412,7 @@ protected MethodDefinition createApiClientHeaderProviderBuilderMethod(

private List<AnnotationNode> createClassAnnotations(Service service) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi")));
}
Expand Down Expand Up @@ -2217,7 +2219,8 @@ private static TypeStore createStaticTypes() {
SuppressWarnings.class,
TransportChannelProvider.class,
UnaryCallSettings.class,
UnaryCallable.class);
UnaryCallable.class,
NullMarked.class);
return new TypeStore(concreteClazzes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
import java.util.stream.Collectors;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.jspecify.annotations.NullMarked;

public abstract class AbstractTransportServiceStubClassComposer implements ClassComposer {
private static final List<String> AIP_STANDARDS_METHODS =
Expand Down Expand Up @@ -152,7 +153,8 @@ private static TypeStore createStaticTypes() {
TimeUnit.class,
TypeRegistry.class,
UnaryCallable.class,
UnsupportedOperationException.class);
UnsupportedOperationException.class,
NullMarked.class);
return new TypeStore(concreteClazzes);
}

Expand Down Expand Up @@ -548,6 +550,7 @@ private VariableExpr getOperationCallableExpr(Method protoMethod, String callabl

protected List<AnnotationNode> createClassAnnotations(Service service) {
List<AnnotationNode> annotations = new ArrayList<>();
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("NullMarked")));
if (!PackageChecker.isGaApi(service.pakkage())) {
annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

public class ResourceNameHelperClassComposer {
private static final String CLASS_NAME_PATTERN = "%sName";
Expand Down Expand Up @@ -152,6 +153,7 @@ public GapicClass generate(ResourceName resourceName, GapicContext context) {

private static List<AnnotationNode> createClassAnnotations() {
return Arrays.asList(
AnnotationNode.withType(FIXED_TYPESTORE.get("NullMarked")),
AnnotationNode.builder()
.setType(FIXED_TYPESTORE.get("Generated"))
.setDescription("by gapic-generator-java")
Expand Down Expand Up @@ -1704,7 +1706,8 @@ private static TypeStore createStaticTypes() {
PathTemplate.class,
Preconditions.class,
com.google.api.resourcenames.ResourceName.class,
ValidationException.class);
ValidationException.class,
NullMarked.class);
return new TypeStore(concreteClazzes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.google.types.testing.stub.NestedMessageServiceStubSettings;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -95,6 +96,7 @@ import javax.annotation.Generated;
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@NullMarked
@Generated("by gapic-generator-java")
public class NestedMessageServiceClient implements BackgroundResource {
private final NestedMessageServiceSettings settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -76,6 +77,7 @@ import javax.annotation.Generated;
* Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
* retries.
*/
@NullMarked
@Generated("by gapic-generator-java")
@SuppressWarnings("CanonicalDuration")
public class EchoWithVersionStubSettings extends StubSettings<EchoWithVersionStubSettings> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -98,6 +99,7 @@ import javax.annotation.Generated;
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public class BookshopClient implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.google.testdata.v1.stub.DeprecatedServiceStubSettings;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -110,6 +111,7 @@ import javax.annotation.Generated;
*
* @deprecated This class is deprecated and will be removed in the next major version update.
*/
@NullMarked
@Deprecated
@Generated("by gapic-generator-java")
public class DeprecatedServiceClient implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.google.testdata.v1.stub.DeprecatedServiceStubSettings;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -68,6 +69,7 @@ import javax.annotation.Generated;
*
* @deprecated This class is deprecated and will be removed in the next major version update.
*/
@NullMarked
@Deprecated
@Generated("by gapic-generator-java")
public class DeprecatedServiceSettings extends ClientSettings<DeprecatedServiceSettings> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.google.api.gax.rpc.UnaryCallable;
import com.google.protobuf.Empty;
import com.google.testdata.v1.FibonacciRequest;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand All @@ -14,6 +15,7 @@ import javax.annotation.Generated;
*
* @deprecated This class is deprecated and will be removed in the next major version update.
*/
@NullMarked
@Deprecated
@Generated("by gapic-generator-java")
public abstract class DeprecatedServiceStub implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import java.io.IOException;
import java.time.Duration;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -80,6 +81,7 @@ import javax.annotation.Generated;
*
* @deprecated This class is deprecated and will be removed in the next major version update.
*/
@NullMarked
@Deprecated
@Generated("by gapic-generator-java")
@SuppressWarnings("CanonicalDuration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -260,6 +261,7 @@ import javax.annotation.Generated;
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public class EchoClient implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.google.selective.generate.v1beta1.stub.EchoServiceShouldGenerateParti
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -155,6 +156,7 @@ import javax.annotation.Generated;
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import com.google.api.gax.rpc.UnaryCallable;
import com.google.selective.generate.v1beta1.EchoRequest;
import com.google.selective.generate.v1beta1.EchoResponse;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Base stub class for the EchoServiceShouldGeneratePartialUsual service API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public abstract class EchoServiceShouldGeneratePartialUsualStub implements BackgroundResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.google.selective.generate.v1beta1.stub.EchoServiceShouldGenerateParti
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -70,6 +71,7 @@ import javax.annotation.Generated;
* Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
* retries.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public class EchoServiceShouldGeneratePartialUsualSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.google.selective.generate.v1beta1.EchoResponse;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -82,6 +83,7 @@ import javax.annotation.Generated;
* Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
* retries.
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
@SuppressWarnings("CanonicalDuration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.google.showcase.v1beta1.stub.EchoStubSettings;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.jspecify.annotations.NullMarked;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
Expand Down Expand Up @@ -98,6 +99,7 @@ import javax.annotation.Generated;
* .build();
* }</pre>
*/
@NullMarked
@BetaApi
@Generated("by gapic-generator-java")
public class EchoSettings extends ClientSettings<EchoSettings> {
Expand Down
Loading
Loading