Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-protoc addService -> addBlockingService #2143

Merged
merged 1 commit into from
Mar 10, 2022
Merged
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 @@ -1058,7 +1058,7 @@ private static TestServerContext serviceTalkServerBlocking(final ErrorMode error
.listenAndAwait(new ServiceFactory.Builder()
.bufferDecoderGroup(serviceTalkDecompression(compression))
.bufferEncoders(serviceTalkCompressions(compression))
.addService(new BlockingCompatService() {
.addBlockingService(new BlockingCompatService() {
@Override
public void bidirectionalStreamingCall(
final GrpcServiceContext ctx, final BlockingIterable<CompatRequest> request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
import static io.servicetalk.grpc.protoc.Words.Rpc;
import static io.servicetalk.grpc.protoc.Words.Service;
import static io.servicetalk.grpc.protoc.Words.To;
import static io.servicetalk.grpc.protoc.Words.addBlockingService;
import static io.servicetalk.grpc.protoc.Words.addService;
import static io.servicetalk.grpc.protoc.Words.bind;
import static io.servicetalk.grpc.protoc.Words.bufferDecoderGroup;
Expand Down Expand Up @@ -597,7 +598,17 @@ private TypeSpec.Builder addServiceFactory(final State state, final TypeSpec.Bui
.addStatement("return this")
.build());

final MethodSpec.Builder addBlockingServiceMethodSpecBuilder = methodBuilder(addService)
serviceBuilderSpecBuilder.addMethod(methodBuilder(addService)
.addModifiers(PUBLIC)
.addAnnotation(Deprecated.class)
.addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T)}." + lineSeparator(), addBlockingService,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to add a full javadoc. Otherwise, there are other warnings, like missing @param that break the build with Xwerror flag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will submit a followup

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what I meant about javadoc generation not reliably detecting issues. hopefully #2140 will help but there are protobuf issues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state.blockingServiceClass)
.returns(builderClass)
.addParameter(state.blockingServiceClass, service, FINAL)
.addStatement("return $L($L)", addBlockingService, service)
.build());

final MethodSpec.Builder addBlockingServiceMethodSpecBuilder = methodBuilder(addBlockingService)
.addModifiers(PUBLIC)
.returns(builderClass)
.addParameter(state.blockingServiceClass, service, FINAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ final class Words {
static final String rpc = "rpc";
static final String initSerializationProvider = "initSerializationProvider";
static final String addService = "addService";
static final String addBlockingService = "addBlockingService";
static final String registerRoutes = "registerRoutes";
static final String service = "service";
static final String strategy = "strategy";
Expand Down