github: add assertion
authorAleksey Pivovarov <Aleksey.Pivovarov@jetbrains.com>
Fri, 21 Feb 2014 07:14:51 +0000 (11:14 +0400)
committerAleksey Pivovarov <Aleksey.Pivovarov@jetbrains.com>
Fri, 21 Feb 2014 08:38:03 +0000 (12:38 +0400)
plugins/github/src/org/jetbrains/plugins/github/api/GithubApiUtil.java

index 86a0ca0cf8bdf3ff9fb7b351a69f865a14958d1b..aad06e1f24f75cf6a7360e6cef56e0dc89483f8d 100644 (file)
@@ -33,12 +33,14 @@ import org.jetbrains.plugins.github.util.GithubUtil;
 import sun.security.validator.ValidatorException;
 
 import javax.net.ssl.SSLHandshakeException;
+import java.awt.*;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.List;
 
 /**
  * @author Kirill Likhodedov
@@ -91,6 +93,8 @@ public class GithubApiUtil {
                                       @Nullable String requestBody,
                                       @NotNull Collection<Header> headers,
                                       @NotNull HttpVerb verb) throws IOException {
+    LOG.assertTrue(!EventQueue.isDispatchThread(), "Network operation in EDT");
+    EventQueue.isDispatchThread();
     HttpMethod method = null;
     try {
       String uri = GithubUrlUtil.getApiUrl(auth.getHost()) + path;