Skip to content

Commit 8a9f799

Browse files
Store installationTokens in a ConcurrentHashMap (#195)
Hopefully this is sufficient to make `GitHubClient` thread-safe. No other usages of `HashMap` or `ArrayList` were found, except for `Languages` which is a return structure, so is less necessary to be thread-safe.
1 parent 55ad5a3 commit 8a9f799

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/spotify/github/v3/clients/GitHubClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
import java.lang.invoke.MethodHandles;
4949
import java.net.URI;
5050
import java.time.ZonedDateTime;
51-
import java.util.HashMap;
5251
import java.util.List;
5352
import java.util.Map;
5453
import java.util.Objects;
5554
import java.util.Optional;
5655
import java.util.concurrent.CompletableFuture;
56+
import java.util.concurrent.ConcurrentHashMap;
5757
import java.util.concurrent.atomic.AtomicBoolean;
5858
import java.util.function.Consumer;
5959
import javax.ws.rs.core.HttpHeaders;
@@ -145,7 +145,7 @@ private GitHubClient(
145145
this.privateKey = privateKey;
146146
this.appId = appId;
147147
this.installationId = installationId;
148-
this.installationTokens = new HashMap<>();
148+
this.installationTokens = new ConcurrentHashMap<>();
149149
}
150150

151151
/**

0 commit comments

Comments
 (0)