Skip to content

Commit

Permalink
Store installationTokens in a ConcurrentHashMap (#195)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mitchhentgesspotify authored Jul 10, 2024
1 parent 55ad5a3 commit 8a9f799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/spotify/github/v3/clients/GitHubClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
import java.lang.invoke.MethodHandles;
import java.net.URI;
import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import javax.ws.rs.core.HttpHeaders;
Expand Down Expand Up @@ -145,7 +145,7 @@ private GitHubClient(
this.privateKey = privateKey;
this.appId = appId;
this.installationId = installationId;
this.installationTokens = new HashMap<>();
this.installationTokens = new ConcurrentHashMap<>();
}

/**
Expand Down

0 comments on commit 8a9f799

Please sign in to comment.