{"action":"created","comment":{"url":"https://api.github.com/repos/clouway-incubator/threads/pulls/comments/40641353","id":40641353,"diff_hunk":"@@ -0,0 +1,40 @@\n+package com.clouway.task4;\n+\n+/**\n+ * @author Slavi Dichkov (slavidichkof@gmail.com)\n+ */\n+public class Producer extends Thread {\n+    private List list = new List(3);\n+    public final int max = 3;\n+\n+    @Override\n+    public void run() {\n+        System.out.println(list.size());\n+        try {\n+            while (true) {\n+                putElement();\n+                sleep(2000);\n+            }\n+        } catch (InterruptedException e) {\n+        }\n+    }\n+\n+    private synchronized void putElement() throws InterruptedException {\n+        while (list.size() == max) {\n+            wait();\n+        }\n+        list.add(new java.util.Date().toString());\n+        System.out.println(\"Put in list\");\n+        notify();\n+    }\n+\n+    public synchronized String getMessage() throws InterruptedException {\n+        notify();","path":"src/com/clouway/task4/Producer.java","position":32,"original_position":32,"commit_id":"5d43e066efe53c93786a7791c081f0378f386e1b","original_commit_id":"5d43e066efe53c93786a7791c081f0378f386e1b","user":{"login":"mgenov","id":209223,"avatar_url":"https://avatars.githubusercontent.com/u/209223?v=3","gravatar_id":"","url":"https://api.github.com/users/mgenov","html_url":"https://github.com/mgenov","followers_url":"https://api.github.com/users/mgenov/followers","following_url":"https://api.github.com/users/mgenov/following{/other_user}","gists_url":"https://api.github.com/users/mgenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mgenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgenov/subscriptions","organizations_url":"https://api.github.com/users/mgenov/orgs","repos_url":"https://api.github.com/users/mgenov/repos","events_url":"https://api.github.com/users/mgenov/events{/privacy}","received_events_url":"https://api.github.com/users/mgenov/received_events","type":"User","site_admin":false},"body":"Why you are calling notify even before work to be done ? ","created_at":"2015-09-29T07:26:13Z","updated_at":"2015-09-29T07:26:13Z","html_url":"https://github.com/clouway-incubator/threads/pull/2#discussion_r40641353","pull_request_url":"https://api.github.com/repos/clouway-incubator/threads/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/comments/40641353"},"html":{"href":"https://github.com/clouway-incubator/threads/pull/2#discussion_r40641353"},"pull_request":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/clouway-incubator/threads/pulls/2","id":46243538,"html_url":"https://github.com/clouway-incubator/threads/pull/2","diff_url":"https://github.com/clouway-incubator/threads/pull/2.diff","patch_url":"https://github.com/clouway-incubator/threads/pull/2.patch","issue_url":"https://api.github.com/repos/clouway-incubator/threads/issues/2","number":2,"state":"open","locked":false,"title":"Threads: Modificate task4 from Exceptions","user":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T07:16:44Z","updated_at":"2015-09-29T07:26:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"974bbeda1090a949f78e390acb62f9291faac288","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clouway-incubator/threads/pulls/2/commits","review_comments_url":"https://api.github.com/repos/clouway-incubator/threads/pulls/2/comments","review_comment_url":"https://api.github.com/repos/clouway-incubator/threads/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway-incubator/threads/issues/2/comments","statuses_url":"https://api.github.com/repos/clouway-incubator/threads/statuses/5d43e066efe53c93786a7791c081f0378f386e1b","head":{"label":"slavidichkov:task4","ref":"task4","sha":"5d43e066efe53c93786a7791c081f0378f386e1b","user":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"repo":{"id":43287611,"name":"threads","full_name":"slavidichkov/threads","owner":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slavidichkov/threads","description":"Java Threads","fork":true,"url":"https://api.github.com/repos/slavidichkov/threads","forks_url":"https://api.github.com/repos/slavidichkov/threads/forks","keys_url":"https://api.github.com/repos/slavidichkov/threads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slavidichkov/threads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slavidichkov/threads/teams","hooks_url":"https://api.github.com/repos/slavidichkov/threads/hooks","issue_events_url":"https://api.github.com/repos/slavidichkov/threads/issues/events{/number}","events_url":"https://api.github.com/repos/slavidichkov/threads/events","assignees_url":"https://api.github.com/repos/slavidichkov/threads/assignees{/user}","branches_url":"https://api.github.com/repos/slavidichkov/threads/branches{/branch}","tags_url":"https://api.github.com/repos/slavidichkov/threads/tags","blobs_url":"https://api.github.com/repos/slavidichkov/threads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slavidichkov/threads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slavidichkov/threads/git/refs{/sha}","trees_url":"https://api.github.com/repos/slavidichkov/threads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slavidichkov/threads/statuses/{sha}","languages_url":"https://api.github.com/repos/slavidichkov/threads/languages","stargazers_url":"https://api.github.com/repos/slavidichkov/threads/stargazers","contributors_url":"https://api.github.com/repos/slavidichkov/threads/contributors","subscribers_url":"https://api.github.com/repos/slavidichkov/threads/subscribers","subscription_url":"https://api.github.com/repos/slavidichkov/threads/subscription","commits_url":"https://api.github.com/repos/slavidichkov/threads/commits{/sha}","git_commits_url":"https://api.github.com/repos/slavidichkov/threads/git/commits{/sha}","comments_url":"https://api.github.com/repos/slavidichkov/threads/comments{/number}","issue_comment_url":"https://api.github.com/repos/slavidichkov/threads/issues/comments{/number}","contents_url":"https://api.github.com/repos/slavidichkov/threads/contents/{+path}","compare_url":"https://api.github.com/repos/slavidichkov/threads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slavidichkov/threads/merges","archive_url":"https://api.github.com/repos/slavidichkov/threads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slavidichkov/threads/downloads","issues_url":"https://api.github.com/repos/slavidichkov/threads/issues{/number}","pulls_url":"https://api.github.com/repos/slavidichkov/threads/pulls{/number}","milestones_url":"https://api.github.com/repos/slavidichkov/threads/milestones{/number}","notifications_url":"https://api.github.com/repos/slavidichkov/threads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slavidichkov/threads/labels{/name}","releases_url":"https://api.github.com/repos/slavidichkov/threads/releases{/id}","created_at":"2015-09-28T07:57:46Z","updated_at":"2015-09-28T08:07:24Z","pushed_at":"2015-09-29T07:14:05Z","git_url":"git://github.com/slavidichkov/threads.git","ssh_url":"git@github.com:slavidichkov/threads.git","clone_url":"https://github.com/slavidichkov/threads.git","svn_url":"https://github.com/slavidichkov/threads","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"clouway-incubator:slavi","ref":"slavi","sha":"7004b3a23c6106876db3cb936bbdec3e75e86625","user":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":43062561,"name":"threads","full_name":"clouway-incubator/threads","owner":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway-incubator/threads","description":"Java Threads","fork":false,"url":"https://api.github.com/repos/clouway-incubator/threads","forks_url":"https://api.github.com/repos/clouway-incubator/threads/forks","keys_url":"https://api.github.com/repos/clouway-incubator/threads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway-incubator/threads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway-incubator/threads/teams","hooks_url":"https://api.github.com/repos/clouway-incubator/threads/hooks","issue_events_url":"https://api.github.com/repos/clouway-incubator/threads/issues/events{/number}","events_url":"https://api.github.com/repos/clouway-incubator/threads/events","assignees_url":"https://api.github.com/repos/clouway-incubator/threads/assignees{/user}","branches_url":"https://api.github.com/repos/clouway-incubator/threads/branches{/branch}","tags_url":"https://api.github.com/repos/clouway-incubator/threads/tags","blobs_url":"https://api.github.com/repos/clouway-incubator/threads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway-incubator/threads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway-incubator/threads/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway-incubator/threads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway-incubator/threads/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway-incubator/threads/languages","stargazers_url":"https://api.github.com/repos/clouway-incubator/threads/stargazers","contributors_url":"https://api.github.com/repos/clouway-incubator/threads/contributors","subscribers_url":"https://api.github.com/repos/clouway-incubator/threads/subscribers","subscription_url":"https://api.github.com/repos/clouway-incubator/threads/subscription","commits_url":"https://api.github.com/repos/clouway-incubator/threads/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway-incubator/threads/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway-incubator/threads/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway-incubator/threads/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway-incubator/threads/contents/{+path}","compare_url":"https://api.github.com/repos/clouway-incubator/threads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway-incubator/threads/merges","archive_url":"https://api.github.com/repos/clouway-incubator/threads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway-incubator/threads/downloads","issues_url":"https://api.github.com/repos/clouway-incubator/threads/issues{/number}","pulls_url":"https://api.github.com/repos/clouway-incubator/threads/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway-incubator/threads/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway-incubator/threads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway-incubator/threads/labels{/name}","releases_url":"https://api.github.com/repos/clouway-incubator/threads/releases{/id}","created_at":"2015-09-24T11:22:20Z","updated_at":"2015-09-24T11:22:33Z","pushed_at":"2015-09-29T07:16:45Z","git_url":"git://github.com/clouway-incubator/threads.git","ssh_url":"git@github.com:clouway-incubator/threads.git","clone_url":"https://github.com/clouway-incubator/threads.git","svn_url":"https://github.com/clouway-incubator/threads","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/2"},"html":{"href":"https://github.com/clouway-incubator/threads/pull/2"},"issue":{"href":"https://api.github.com/repos/clouway-incubator/threads/issues/2"},"comments":{"href":"https://api.github.com/repos/clouway-incubator/threads/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway-incubator/threads/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/clouway-incubator/threads/statuses/5d43e066efe53c93786a7791c081f0378f386e1b"}}}}