Skip to content

Commit 6c131f2

Browse files
committed
Replace javax ThreadSafe annotation with errorprone ThreadSafe annotation
1 parent 15788b7 commit 6c131f2

File tree

63 files changed

+78
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+78
-81
lines changed

api/src/main/java/io/grpc/Channel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
19+
import com.google.errorprone.annotations.ThreadSafe;
2020

2121
/**
2222
* A virtual connection to a conceptual endpoint, to perform RPCs. A channel is free to have zero or

api/src/main/java/io/grpc/ChannelLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
19+
import com.google.errorprone.annotations.ThreadSafe;
2020

2121
/**
2222
* A Channel-specific logger provided by GRPC library to {@link LoadBalancer} implementations.

api/src/main/java/io/grpc/ClientInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
19+
import com.google.errorprone.annotations.ThreadSafe;
2020

2121
/**
2222
* Interface for intercepting outgoing calls before they are dispatched by a {@link Channel}.

api/src/main/java/io/grpc/ClientStreamTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

2121
import com.google.common.base.MoreObjects;
22-
import javax.annotation.concurrent.ThreadSafe;
22+
import com.google.errorprone.annotations.ThreadSafe;
2323

2424
/**
2525
* {@link StreamTracer} for the client-side.

api/src/main/java/io/grpc/CompressorRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import static com.google.common.base.Preconditions.checkArgument;
2020

2121
import com.google.common.annotations.VisibleForTesting;
22+
import com.google.errorprone.annotations.ThreadSafe;
2223
import java.util.concurrent.ConcurrentHashMap;
2324
import java.util.concurrent.ConcurrentMap;
2425
import javax.annotation.Nullable;
25-
import javax.annotation.concurrent.ThreadSafe;
2626

2727
/**
2828
* Encloses classes related to the compression and decompression of messages.

api/src/main/java/io/grpc/DecompressorRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
import static com.google.common.base.Preconditions.checkNotNull;
2121

2222
import com.google.common.base.Joiner;
23+
import com.google.errorprone.annotations.ThreadSafe;
2324
import java.nio.charset.Charset;
2425
import java.util.Collections;
2526
import java.util.HashSet;
2627
import java.util.LinkedHashMap;
2728
import java.util.Map;
2829
import java.util.Set;
2930
import javax.annotation.Nullable;
30-
import javax.annotation.concurrent.ThreadSafe;
3131

3232
/**
3333
* Encloses classes related to the compression and decompression of messages.

api/src/main/java/io/grpc/HandlerRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
package io.grpc;
1818

19+
import com.google.errorprone.annotations.ThreadSafe;
1920
import java.util.Collections;
2021
import java.util.List;
2122
import javax.annotation.Nullable;
22-
import javax.annotation.concurrent.ThreadSafe;
2323

2424
/**
2525
* Registry of services and their methods used by servers to dispatching incoming calls.

api/src/main/java/io/grpc/LoadBalancer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.common.base.MoreObjects;
2323
import com.google.common.base.Objects;
2424
import com.google.common.base.Preconditions;
25+
import com.google.errorprone.annotations.ThreadSafe;
2526
import java.util.ArrayList;
2627
import java.util.Arrays;
2728
import java.util.Collections;
@@ -32,7 +33,6 @@
3233
import javax.annotation.Nullable;
3334
import javax.annotation.concurrent.Immutable;
3435
import javax.annotation.concurrent.NotThreadSafe;
35-
import javax.annotation.concurrent.ThreadSafe;
3636

3737
/**
3838
* A pluggable component that receives resolved addresses from {@link NameResolver} and provides the
@@ -64,7 +64,7 @@
6464
* allows implementations to schedule tasks to be run in the same Synchronization Context, with or
6565
* without a delay, thus those tasks don't need to worry about synchronizing with the balancer
6666
* methods.
67-
*
67+
*
6868
* <p>However, the actual running thread may be the network thread, thus the following rules must be
6969
* followed to prevent blocking or even dead-locking in a network:
7070
*
@@ -417,7 +417,7 @@ public void handleSubchannelState(
417417
*
418418
* <p>This method should always return a constant value. It's not specified when this will be
419419
* called.
420-
*
420+
*
421421
* <p>Note that this method is only called when implementing {@code handleResolvedAddresses()}
422422
* instead of {@code acceptResolvedAddresses()}.
423423
*
@@ -640,7 +640,7 @@ private PickResult(
640640
* stream is created at all in some cases.
641641
* @since 1.3.0
642642
*/
643-
// TODO(shivaspeaks): Need to deprecate old APIs and create new ones,
643+
// TODO(shivaspeaks): Need to deprecate old APIs and create new ones,
644644
// per https://github.com/grpc/grpc-java/issues/12662.
645645
public static PickResult withSubchannel(
646646
Subchannel subchannel, @Nullable ClientStreamTracer.Factory streamTracerFactory) {
@@ -1332,7 +1332,7 @@ public MetricRecorder getMetricRecorder() {
13321332
}
13331333

13341334
/**
1335-
* A logical connection to a server, or a group of equivalent servers represented by an {@link
1335+
* A logical connection to a server, or a group of equivalent servers represented by an {@link
13361336
* EquivalentAddressGroup}.
13371337
*
13381338
* <p>It maintains at most one physical connection (aka transport) for sending new RPCs, while

api/src/main/java/io/grpc/LoadBalancerRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static com.google.common.base.Preconditions.checkNotNull;
2121

2222
import com.google.common.annotations.VisibleForTesting;
23+
import com.google.errorprone.annotations.ThreadSafe;
2324
import java.util.ArrayList;
2425
import java.util.Collections;
2526
import java.util.LinkedHashMap;
@@ -30,7 +31,6 @@
3031
import java.util.logging.Level;
3132
import java.util.logging.Logger;
3233
import javax.annotation.Nullable;
33-
import javax.annotation.concurrent.ThreadSafe;
3434

3535
/**
3636
* Registry of {@link LoadBalancerProvider}s. The {@link #getDefaultRegistry default instance}

api/src/main/java/io/grpc/ManagedChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package io.grpc;
1818

19+
import com.google.errorprone.annotations.ThreadSafe;
1920
import java.util.concurrent.TimeUnit;
20-
import javax.annotation.concurrent.ThreadSafe;
2121

2222
/**
2323
* A {@link Channel} that provides lifecycle management.

0 commit comments

Comments
 (0)