Skip to content

Commit

Permalink
core: Remove temporary AbstractServerImplBuilder
Browse files Browse the repository at this point in the history
This breaks the ABI of the classes listed below.

Users that recompiled  their code using grpc-java [`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) (released on
Feb 23, 2021) and later, ARE NOT AFFECTED.

Users that compiled their source using grpc-java earlier than
[`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) need to
recompile when upgrading to grpc-java `v1.59.0`. Otherwise the code
will fail on runtime with `NoSuchMethodError`. For example, code:

```java
NettyServerBuilder.forPort(80).directExecutor();
```

Will fail with

> `java.lang.NoSuchMethodError: 'io.grpc.internal.AbstractServerImplBuilder
  io.grpc.netty.NettyServerBuilder.directExecutor()'`

**Affected classes**

Class `AbstractServerImplBuilder` is deleted, and no longer in the
class hierarchy of the server builders:
- `io.grpc.netty.NettyServerBuilder`
- `io.grpc.inprocess.InProcessServerBuilder`
  • Loading branch information
sergiitk committed Oct 3, 2023
1 parent 2cbc290 commit 050ae18
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 332 deletions.
5 changes: 0 additions & 5 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ plugins.withId("java") {
"io/grpc/internal/AbstractManagedChannelImplBuilder.class").get().getAsFile(),
"<T:Lio/grpc/internal/AbstractManagedChannelImplBuilder<TT;>;>Lio/grpc/ManagedChannelBuilder<TT;>;",
"<T:Lio/grpc/ManagedChannelBuilder<TT;>;>Lio/grpc/ManagedChannelBuilder<TT;>;");
project.replaceConstant(
destinationDirectory.file(
"io/grpc/internal/AbstractServerImplBuilder.class").get().getAsFile(),
"<T:Lio/grpc/internal/AbstractServerImplBuilder<TT;>;>Lio/grpc/ServerBuilder<TT;>;",
"<T:Lio/grpc/ServerBuilder<TT;>;>Lio/grpc/ServerBuilder<TT;>;");
}
}
}
Expand Down
233 changes: 0 additions & 233 deletions core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import com.google.errorprone.annotations.DoNotCall;
import io.grpc.Deadline;
import io.grpc.ExperimentalApi;
import io.grpc.ForwardingServerBuilder;
import io.grpc.Internal;
import io.grpc.ServerBuilder;
import io.grpc.ServerStreamTracer;
import io.grpc.internal.AbstractServerImplBuilder;
import io.grpc.internal.FixedObjectPool;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.InternalServer;
Expand Down Expand Up @@ -73,8 +73,7 @@
* </pre>
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1783")
public final class InProcessServerBuilder extends
AbstractServerImplBuilder<InProcessServerBuilder> {
public final class InProcessServerBuilder extends ForwardingServerBuilder<InProcessServerBuilder> {
/**
* Create a server builder that will bind with the given name.
*
Expand Down
4 changes: 2 additions & 2 deletions netty/src/main/java/io/grpc/netty/NettyServerBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
import com.google.errorprone.annotations.InlineMe;
import io.grpc.Attributes;
import io.grpc.ExperimentalApi;
import io.grpc.ForwardingServerBuilder;
import io.grpc.Internal;
import io.grpc.ServerBuilder;
import io.grpc.ServerCredentials;
import io.grpc.ServerStreamTracer;
import io.grpc.internal.AbstractServerImplBuilder;
import io.grpc.internal.FixedObjectPool;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.InternalServer;
Expand Down Expand Up @@ -67,7 +67,7 @@
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1784")
@CheckReturnValue
public final class NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> {
public final class NettyServerBuilder extends ForwardingServerBuilder<NettyServerBuilder> {

// 1MiB
public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1024 * 1024;
Expand Down

0 comments on commit 050ae18

Please sign in to comment.