diff --git a/servicetalk-grpc-protoc/src/main/java/io/servicetalk/grpc/protoc/Generator.java b/servicetalk-grpc-protoc/src/main/java/io/servicetalk/grpc/protoc/Generator.java index edbf04c7e2..e2c3d286f2 100644 --- a/servicetalk-grpc-protoc/src/main/java/io/servicetalk/grpc/protoc/Generator.java +++ b/servicetalk-grpc-protoc/src/main/java/io/servicetalk/grpc/protoc/Generator.java @@ -601,6 +601,11 @@ private TypeSpec.Builder addServiceFactory(final State state, final TypeSpec.Bui serviceBuilderSpecBuilder.addMethod(methodBuilder(addService) .addModifiers(PUBLIC) .addAnnotation(Deprecated.class) + .addJavadoc("Adds a {@link $T} implementation." + lineSeparator(), state.blockingServiceClass) + .addJavadoc(lineSeparator()) + .addJavadoc(JAVADOC_PARAM + service + " the {@link $T} implementation to add." + lineSeparator(), + state.blockingServiceClass) + .addJavadoc(JAVADOC_RETURN + "this." + lineSeparator()) .addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T)}." + lineSeparator(), addBlockingService, state.blockingServiceClass) .returns(builderClass) @@ -873,14 +878,13 @@ private TypeSpec.Builder addClientInterfaces(final State state, final TypeSpec.B printJavaDocs, (methodName, b) -> { ClassName inClass = messageTypesMap.get(clientMetaData.methodProto.getInputType()); b.addModifiers(ABSTRACT).addParameter(clientMetaData.className, metadata) - .addAnnotation(Deprecated.class) - .addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T,$T)}." + lineSeparator(), - methodName, - GrpcClientMetadata, clientMetaData.methodProto.getClientStreaming() ? - Publisher : inClass); + .addAnnotation(Deprecated.class); if (printJavaDocs) { extractJavaDocComments(state, methodIndex, b); - b.addJavadoc(JAVADOC_PARAM + metadata + + b.addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T,$T)}." + lineSeparator(), + methodName, GrpcClientMetadata, + clientMetaData.methodProto.getClientStreaming() ? Publisher : inClass) + .addJavadoc(JAVADOC_PARAM + metadata + " the metadata associated with this client call." + lineSeparator()); } return b; @@ -910,13 +914,13 @@ private TypeSpec.Builder addClientInterfaces(final State state, final TypeSpec.B printJavaDocs, (methodName, b) -> { ClassName inClass = messageTypesMap.get(clientMetaData.methodProto.getInputType()); b.addModifiers(ABSTRACT).addParameter(clientMetaData.className, metadata) - .addAnnotation(Deprecated.class) - .addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T,$T)}." + lineSeparator(), - methodName, GrpcClientMetadata, clientMetaData.methodProto.getClientStreaming() ? - Types.Iterable : inClass); + .addAnnotation(Deprecated.class); if (printJavaDocs) { extractJavaDocComments(state, methodIndex, b); - b.addJavadoc(JAVADOC_PARAM + metadata + + b.addJavadoc(JAVADOC_DEPRECATED + "Use {@link #$L($T,$T)}." + lineSeparator(), + methodName, GrpcClientMetadata, + clientMetaData.methodProto.getClientStreaming() ? Types.Iterable : inClass) + .addJavadoc(JAVADOC_PARAM + metadata + " the metadata associated with this client call." + lineSeparator()); } return b; @@ -1041,8 +1045,7 @@ private static MethodSpec newRpcMethodSpec( if (flags.contains(BLOCKING)) { if (clientSteaming) { if (flags.contains(CLIENT)) { - methodSpecBuilder.addParameter(ParameterizedTypeName.get(ClassName.get(Iterable.class), - inClass), request, mods); + methodSpecBuilder.addParameter(ParameterizedTypeName.get(Types.Iterable, inClass), request, mods); if (printJavaDocs) { methodSpecBuilder.addJavadoc(JAVADOC_PARAM + request + " used to send a stream of type {@link $T} to the server." + lineSeparator(), inClass);