{"action":"created","comment":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/35310859","id":35310859,"diff_hunk":"@@ -0,0 +1,49 @@\n+package scala.tools.eclipse.contribution.weaving.jdt.jdi;\n+\n+import java.util.concurrent.Callable;\n+import java.util.concurrent.TimeUnit;\n+import java.util.concurrent.locks.ReentrantLock;\n+\n+import org.eclipse.core.runtime.IStatus;\n+import org.eclipse.core.runtime.Status;\n+\n+import scala.tools.eclipse.contribution.weaving.jdt.ScalaJDTWeavingPlugin;\n+\n+/**\n+ * Used to execute sync operation(s) on JDI object(s).\n+ */\n+public final class JdiInvocationSynchronizer {\n+  private final static JdiInvocationSynchronizer INSTANCE = new JdiInvocationSynchronizer();\n+  public final static long DEFAULT_TIMEOUT_IN_SEC = 10;\n+\n+  private JdiInvocationSynchronizer() {\n+    // no need to instantiate outside\n+  }\n+\n+  private final ReentrantLock jdiLock = new ReentrantLock();","path":"org.scala-ide.sdt.aspects/src/scala/tools/eclipse/contribution/weaving/jdt/jdi/JdiInvocationSynchronizer.java","position":23,"original_position":23,"commit_id":"2fe1b15e25824e3a173ac0f504d56143bb94eb4c","original_commit_id":"2fe1b15e25824e3a173ac0f504d56143bb94eb4c","user":{"login":"wpopielarski","id":11613003,"avatar_url":"https://avatars.githubusercontent.com/u/11613003?v=3","gravatar_id":"","url":"https://api.github.com/users/wpopielarski","html_url":"https://github.com/wpopielarski","followers_url":"https://api.github.com/users/wpopielarski/followers","following_url":"https://api.github.com/users/wpopielarski/following{/other_user}","gists_url":"https://api.github.com/users/wpopielarski/gists{/gist_id}","starred_url":"https://api.github.com/users/wpopielarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpopielarski/subscriptions","organizations_url":"https://api.github.com/users/wpopielarski/orgs","repos_url":"https://api.github.com/users/wpopielarski/repos","events_url":"https://api.github.com/users/wpopielarski/events{/privacy}","received_events_url":"https://api.github.com/users/wpopielarski/received_events","type":"User","site_admin":false},"body":"A little bit defensive programming. A lock is tried to be retrieved, <code>synchronized</code> is not so wise I guess.","created_at":"2015-07-23T11:06:45Z","updated_at":"2015-07-23T11:06:45Z","html_url":"https://github.com/scala-ide/scala-ide/pull/967#discussion_r35310859","pull_request_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967","_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments/35310859"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/967#discussion_r35310859"},"pull_request":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967"}}},"pull_request":{"url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967","id":36885813,"html_url":"https://github.com/scala-ide/scala-ide/pull/967","diff_url":"https://github.com/scala-ide/scala-ide/pull/967.diff","patch_url":"https://github.com/scala-ide/scala-ide/pull/967.patch","issue_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/967","number":967,"state":"open","locked":false,"title":"Synchronize all calls into the JDI","user":{"login":"wpopielarski","id":11613003,"avatar_url":"https://avatars.githubusercontent.com/u/11613003?v=3","gravatar_id":"","url":"https://api.github.com/users/wpopielarski","html_url":"https://github.com/wpopielarski","followers_url":"https://api.github.com/users/wpopielarski/followers","following_url":"https://api.github.com/users/wpopielarski/following{/other_user}","gists_url":"https://api.github.com/users/wpopielarski/gists{/gist_id}","starred_url":"https://api.github.com/users/wpopielarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpopielarski/subscriptions","organizations_url":"https://api.github.com/users/wpopielarski/orgs","repos_url":"https://api.github.com/users/wpopielarski/repos","events_url":"https://api.github.com/users/wpopielarski/events{/privacy}","received_events_url":"https://api.github.com/users/wpopielarski/received_events","type":"User","site_admin":false},"body":"JDI calls seem to be thread unsafe. To fix it all potential invocations\r\nwith side effects to JDI must be found and synchronized.\r\n\r\nThere are four things done:\r\n - JdiEntryGuardianAspect is a tool which scans all usages of\r\n   com.sun.jdi.* invocation. This aspect needs to be deactivated\r\n   in post review rework\r\n - JdiInvocationSynchronizer just sync the calls to JDI\r\n - jdiSynchronized is scala object which wraps JdiInvocationSynchronizer\r\n\r\nIn scala-ide.log can be found potential places requiring of the sync\r\ndiscoved by Guardian aspect.\r\n\r\nFix #1002160","created_at":"2015-06-03T22:38:31Z","updated_at":"2015-07-23T11:06:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c5127d8f81eae8b1ed445ab88c7e948126d1edd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967/commits","review_comments_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967/comments","review_comment_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/967/comments","statuses_url":"https://api.github.com/repos/scala-ide/scala-ide/statuses/2fe1b15e25824e3a173ac0f504d56143bb94eb4c","head":{"label":"wpopielarski:jdi-sync","ref":"jdi-sync","sha":"2fe1b15e25824e3a173ac0f504d56143bb94eb4c","user":{"login":"wpopielarski","id":11613003,"avatar_url":"https://avatars.githubusercontent.com/u/11613003?v=3","gravatar_id":"","url":"https://api.github.com/users/wpopielarski","html_url":"https://github.com/wpopielarski","followers_url":"https://api.github.com/users/wpopielarski/followers","following_url":"https://api.github.com/users/wpopielarski/following{/other_user}","gists_url":"https://api.github.com/users/wpopielarski/gists{/gist_id}","starred_url":"https://api.github.com/users/wpopielarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpopielarski/subscriptions","organizations_url":"https://api.github.com/users/wpopielarski/orgs","repos_url":"https://api.github.com/users/wpopielarski/repos","events_url":"https://api.github.com/users/wpopielarski/events{/privacy}","received_events_url":"https://api.github.com/users/wpopielarski/received_events","type":"User","site_admin":false},"repo":{"id":32731990,"name":"scala-ide","full_name":"wpopielarski/scala-ide","owner":{"login":"wpopielarski","id":11613003,"avatar_url":"https://avatars.githubusercontent.com/u/11613003?v=3","gravatar_id":"","url":"https://api.github.com/users/wpopielarski","html_url":"https://github.com/wpopielarski","followers_url":"https://api.github.com/users/wpopielarski/followers","following_url":"https://api.github.com/users/wpopielarski/following{/other_user}","gists_url":"https://api.github.com/users/wpopielarski/gists{/gist_id}","starred_url":"https://api.github.com/users/wpopielarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpopielarski/subscriptions","organizations_url":"https://api.github.com/users/wpopielarski/orgs","repos_url":"https://api.github.com/users/wpopielarski/repos","events_url":"https://api.github.com/users/wpopielarski/events{/privacy}","received_events_url":"https://api.github.com/users/wpopielarski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wpopielarski/scala-ide","description":"Scala IDE for Eclipse","fork":true,"url":"https://api.github.com/repos/wpopielarski/scala-ide","forks_url":"https://api.github.com/repos/wpopielarski/scala-ide/forks","keys_url":"https://api.github.com/repos/wpopielarski/scala-ide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wpopielarski/scala-ide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wpopielarski/scala-ide/teams","hooks_url":"https://api.github.com/repos/wpopielarski/scala-ide/hooks","issue_events_url":"https://api.github.com/repos/wpopielarski/scala-ide/issues/events{/number}","events_url":"https://api.github.com/repos/wpopielarski/scala-ide/events","assignees_url":"https://api.github.com/repos/wpopielarski/scala-ide/assignees{/user}","branches_url":"https://api.github.com/repos/wpopielarski/scala-ide/branches{/branch}","tags_url":"https://api.github.com/repos/wpopielarski/scala-ide/tags","blobs_url":"https://api.github.com/repos/wpopielarski/scala-ide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wpopielarski/scala-ide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wpopielarski/scala-ide/git/refs{/sha}","trees_url":"https://api.github.com/repos/wpopielarski/scala-ide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wpopielarski/scala-ide/statuses/{sha}","languages_url":"https://api.github.com/repos/wpopielarski/scala-ide/languages","stargazers_url":"https://api.github.com/repos/wpopielarski/scala-ide/stargazers","contributors_url":"https://api.github.com/repos/wpopielarski/scala-ide/contributors","subscribers_url":"https://api.github.com/repos/wpopielarski/scala-ide/subscribers","subscription_url":"https://api.github.com/repos/wpopielarski/scala-ide/subscription","commits_url":"https://api.github.com/repos/wpopielarski/scala-ide/commits{/sha}","git_commits_url":"https://api.github.com/repos/wpopielarski/scala-ide/git/commits{/sha}","comments_url":"https://api.github.com/repos/wpopielarski/scala-ide/comments{/number}","issue_comment_url":"https://api.github.com/repos/wpopielarski/scala-ide/issues/comments{/number}","contents_url":"https://api.github.com/repos/wpopielarski/scala-ide/contents/{+path}","compare_url":"https://api.github.com/repos/wpopielarski/scala-ide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wpopielarski/scala-ide/merges","archive_url":"https://api.github.com/repos/wpopielarski/scala-ide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wpopielarski/scala-ide/downloads","issues_url":"https://api.github.com/repos/wpopielarski/scala-ide/issues{/number}","pulls_url":"https://api.github.com/repos/wpopielarski/scala-ide/pulls{/number}","milestones_url":"https://api.github.com/repos/wpopielarski/scala-ide/milestones{/number}","notifications_url":"https://api.github.com/repos/wpopielarski/scala-ide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wpopielarski/scala-ide/labels{/name}","releases_url":"https://api.github.com/repos/wpopielarski/scala-ide/releases{/id}","created_at":"2015-03-23T12:51:34Z","updated_at":"2015-04-21T07:14:47Z","pushed_at":"2015-07-21T15:10:39Z","git_url":"git://github.com/wpopielarski/scala-ide.git","ssh_url":"git@github.com:wpopielarski/scala-ide.git","clone_url":"https://github.com/wpopielarski/scala-ide.git","svn_url":"https://github.com/wpopielarski/scala-ide","homepage":"www.scala-ide.org","size":145264,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-ide:master","ref":"master","sha":"8c98828baa34dfe09d410b2a0ee5c1e37f439d06","user":{"login":"scala-ide","id":1026788,"avatar_url":"https://avatars.githubusercontent.com/u/1026788?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-ide","html_url":"https://github.com/scala-ide","followers_url":"https://api.github.com/users/scala-ide/followers","following_url":"https://api.github.com/users/scala-ide/following{/other_user}","gists_url":"https://api.github.com/users/scala-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-ide/subscriptions","organizations_url":"https://api.github.com/users/scala-ide/orgs","repos_url":"https://api.github.com/users/scala-ide/repos","events_url":"https://api.github.com/users/scala-ide/events{/privacy}","received_events_url":"https://api.github.com/users/scala-ide/received_events","type":"Organization","site_admin":false},"repo":{"id":2510011,"name":"scala-ide","full_name":"scala-ide/scala-ide","owner":{"login":"scala-ide","id":1026788,"avatar_url":"https://avatars.githubusercontent.com/u/1026788?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-ide","html_url":"https://github.com/scala-ide","followers_url":"https://api.github.com/users/scala-ide/followers","following_url":"https://api.github.com/users/scala-ide/following{/other_user}","gists_url":"https://api.github.com/users/scala-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-ide/subscriptions","organizations_url":"https://api.github.com/users/scala-ide/orgs","repos_url":"https://api.github.com/users/scala-ide/repos","events_url":"https://api.github.com/users/scala-ide/events{/privacy}","received_events_url":"https://api.github.com/users/scala-ide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-ide/scala-ide","description":"Scala IDE for Eclipse","fork":false,"url":"https://api.github.com/repos/scala-ide/scala-ide","forks_url":"https://api.github.com/repos/scala-ide/scala-ide/forks","keys_url":"https://api.github.com/repos/scala-ide/scala-ide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-ide/scala-ide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-ide/scala-ide/teams","hooks_url":"https://api.github.com/repos/scala-ide/scala-ide/hooks","issue_events_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/events{/number}","events_url":"https://api.github.com/repos/scala-ide/scala-ide/events","assignees_url":"https://api.github.com/repos/scala-ide/scala-ide/assignees{/user}","branches_url":"https://api.github.com/repos/scala-ide/scala-ide/branches{/branch}","tags_url":"https://api.github.com/repos/scala-ide/scala-ide/tags","blobs_url":"https://api.github.com/repos/scala-ide/scala-ide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-ide/scala-ide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-ide/scala-ide/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-ide/scala-ide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-ide/scala-ide/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-ide/scala-ide/languages","stargazers_url":"https://api.github.com/repos/scala-ide/scala-ide/stargazers","contributors_url":"https://api.github.com/repos/scala-ide/scala-ide/contributors","subscribers_url":"https://api.github.com/repos/scala-ide/scala-ide/subscribers","subscription_url":"https://api.github.com/repos/scala-ide/scala-ide/subscription","commits_url":"https://api.github.com/repos/scala-ide/scala-ide/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-ide/scala-ide/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-ide/scala-ide/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-ide/scala-ide/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-ide/scala-ide/contents/{+path}","compare_url":"https://api.github.com/repos/scala-ide/scala-ide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-ide/scala-ide/merges","archive_url":"https://api.github.com/repos/scala-ide/scala-ide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-ide/scala-ide/downloads","issues_url":"https://api.github.com/repos/scala-ide/scala-ide/issues{/number}","pulls_url":"https://api.github.com/repos/scala-ide/scala-ide/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-ide/scala-ide/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-ide/scala-ide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-ide/scala-ide/labels{/name}","releases_url":"https://api.github.com/repos/scala-ide/scala-ide/releases{/id}","created_at":"2011-10-04T05:56:23Z","updated_at":"2015-07-11T18:19:53Z","pushed_at":"2015-07-21T23:54:54Z","git_url":"git://github.com/scala-ide/scala-ide.git","ssh_url":"git@github.com:scala-ide/scala-ide.git","clone_url":"https://github.com/scala-ide/scala-ide.git","svn_url":"https://github.com/scala-ide/scala-ide","homepage":"www.scala-ide.org","size":158005,"stargazers_count":397,"watchers_count":397,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":208,"mirror_url":null,"open_issues_count":6,"forks":208,"open_issues":6,"watchers":397,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967"},"html":{"href":"https://github.com/scala-ide/scala-ide/pull/967"},"issue":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/967"},"comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/issues/967/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala-ide/scala-ide/pulls/967/commits"},"statuses":{"href":"https://api.github.com/repos/scala-ide/scala-ide/statuses/2fe1b15e25824e3a173ac0f504d56143bb94eb4c"}}}}