Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b898284

Browse filesBrowse files
committed
Mentions thread-safety and state the goal.
Most of the objects are effectively immutable, so this should be an easy goal Fixes issue hub4j#148.
1 parent 3bb7eb2 commit b898284
Copy full SHA for b898284

File tree

Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed

‎src/main/java/org/kohsuke/github/GitHub.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GitHub.java
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.Date;
3939
import java.util.HashMap;
4040
import java.util.HashSet;
41+
import java.util.Hashtable;
4142
import java.util.List;
4243
import java.util.Map;
4344
import java.util.Set;
@@ -53,6 +54,12 @@
5354
/**
5455
* Root of the GitHub API.
5556
*
57+
* <h2>Thread safety</h2>
58+
* <p>
59+
* This library aims to be safe for use by multiple threads concurrently, although
60+
* the library itself makes no attempt to control/serialize potentially conflicting
61+
* operations to GitHub, such as updating & deleting a repository at the same time.
62+
*
5663
* @author Kohsuke Kawaguchi
5764
*/
5865
public class GitHub {
@@ -63,8 +70,8 @@ public class GitHub {
6370
*/
6471
/*package*/ final String encodedAuthorization;
6572

66-
private final Map<String,GHUser> users = new HashMap<String, GHUser>();
67-
private final Map<String,GHOrganization> orgs = new HashMap<String, GHOrganization>();
73+
private final Map<String,GHUser> users = new Hashtable<String, GHUser>();
74+
private final Map<String,GHOrganization> orgs = new Hashtable<String, GHOrganization>();
6875

6976
private final String apiUrl;
7077

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.