{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/IntroSDE/lab07/pulls/2","id":51468810,"html_url":"https://github.com/IntroSDE/lab07/pull/2","diff_url":"https://github.com/IntroSDE/lab07/pull/2.diff","patch_url":"https://github.com/IntroSDE/lab07/pull/2.patch","issue_url":"https://api.github.com/repos/IntroSDE/lab07/issues/2","number":2,"state":"closed","locked":false,"title":"Some little issues","user":{"login":"sn1p3r46","id":2912521,"avatar_url":"https://avatars.githubusercontent.com/u/2912521?v=3","gravatar_id":"","url":"https://api.github.com/users/sn1p3r46","html_url":"https://github.com/sn1p3r46","followers_url":"https://api.github.com/users/sn1p3r46/followers","following_url":"https://api.github.com/users/sn1p3r46/following{/other_user}","gists_url":"https://api.github.com/users/sn1p3r46/gists{/gist_id}","starred_url":"https://api.github.com/users/sn1p3r46/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sn1p3r46/subscriptions","organizations_url":"https://api.github.com/users/sn1p3r46/orgs","repos_url":"https://api.github.com/users/sn1p3r46/repos","events_url":"https://api.github.com/users/sn1p3r46/events{/privacy}","received_events_url":"https://api.github.com/users/sn1p3r46/received_events","type":"User","site_admin":false},"body":"**I open again the same pull request on the right repository\r\nPLEASE TRY OUT THE CODE BEFORE MERGE**\r\n\r\nFWD:\r\n\r\nGood evening Pavel, working on the assignement I've found some \"issues\" on the lab7\r\n\r\nIf I well understood, a PUT request is supposed to UPDATE a resource, or if that resource does not exists, the system should CREATE a new one. Right?\r\n\r\nSupposing that the DB is not containing the ID x (x = some ID value not contained in the person table) following the code flaw for the following request:\r\n\r\nPUT http://127.0.0.1:5700/sdelab/person/123 (with a proper body) \r\n\r\nThe  function putPerson(Person person) (line 69) will be called..\r\nthen a new person wil be created with an id provided by the DB (line 72) \r\nthen getPersonById(this.id) will be called (line 76)  the ID (as supposed before) won't be in the DB.. So the variable person at line 106 wil be null \r\nthen the code will breack at line 107 because the person.toString() method is called on a NULL variable. \r\n\r\nNow suppose the ID is present into the DB, then unfortunately a person object will still be created  (with an ID given by the DB check line 72) and then \r\nthe existing entry with the given ID will be updated. (this is not correct). \r\n\r\nI edited the code in order to make it work properly, please have a look to the comments. \r\nPlease try  to run it before merge the pull request, although I've tested the code, I've also added some println in-line here in GitHub... \r\n\r\nMaybe I've not been clear anyway for any clarification my nick on slack is andrea_g\r\nI do apologize for my \"school\" English..\r\n\r\nThanks a lot for the hard work you do for us! \r\n\r\nSincerely \r\nAndrea Galloni","created_at":"2015-11-22T16:53:25Z","updated_at":"2015-11-26T09:07:11Z","closed_at":"2015-11-26T09:07:10Z","merged_at":"2015-11-26T09:07:10Z","merge_commit_sha":"6bd1992463acea582c1d852204ac9bb117af48ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IntroSDE/lab07/pulls/2/commits","review_comments_url":"https://api.github.com/repos/IntroSDE/lab07/pulls/2/comments","review_comment_url":"https://api.github.com/repos/IntroSDE/lab07/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IntroSDE/lab07/issues/2/comments","statuses_url":"https://api.github.com/repos/IntroSDE/lab07/statuses/3326a0b578f63e91762b13094dfd988db39fef66","head":{"label":"sn1p3r46:patch-2","ref":"patch-2","sha":"3326a0b578f63e91762b13094dfd988db39fef66","user":{"login":"sn1p3r46","id":2912521,"avatar_url":"https://avatars.githubusercontent.com/u/2912521?v=3","gravatar_id":"","url":"https://api.github.com/users/sn1p3r46","html_url":"https://github.com/sn1p3r46","followers_url":"https://api.github.com/users/sn1p3r46/followers","following_url":"https://api.github.com/users/sn1p3r46/following{/other_user}","gists_url":"https://api.github.com/users/sn1p3r46/gists{/gist_id}","starred_url":"https://api.github.com/users/sn1p3r46/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sn1p3r46/subscriptions","organizations_url":"https://api.github.com/users/sn1p3r46/orgs","repos_url":"https://api.github.com/users/sn1p3r46/repos","events_url":"https://api.github.com/users/sn1p3r46/events{/privacy}","received_events_url":"https://api.github.com/users/sn1p3r46/received_events","type":"User","site_admin":false},"repo":{"id":46310088,"name":"lab07","full_name":"sn1p3r46/lab07","owner":{"login":"sn1p3r46","id":2912521,"avatar_url":"https://avatars.githubusercontent.com/u/2912521?v=3","gravatar_id":"","url":"https://api.github.com/users/sn1p3r46","html_url":"https://github.com/sn1p3r46","followers_url":"https://api.github.com/users/sn1p3r46/followers","following_url":"https://api.github.com/users/sn1p3r46/following{/other_user}","gists_url":"https://api.github.com/users/sn1p3r46/gists{/gist_id}","starred_url":"https://api.github.com/users/sn1p3r46/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sn1p3r46/subscriptions","organizations_url":"https://api.github.com/users/sn1p3r46/orgs","repos_url":"https://api.github.com/users/sn1p3r46/repos","events_url":"https://api.github.com/users/sn1p3r46/events{/privacy}","received_events_url":"https://api.github.com/users/sn1p3r46/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sn1p3r46/lab07","description":"","fork":true,"url":"https://api.github.com/repos/sn1p3r46/lab07","forks_url":"https://api.github.com/repos/sn1p3r46/lab07/forks","keys_url":"https://api.github.com/repos/sn1p3r46/lab07/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sn1p3r46/lab07/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sn1p3r46/lab07/teams","hooks_url":"https://api.github.com/repos/sn1p3r46/lab07/hooks","issue_events_url":"https://api.github.com/repos/sn1p3r46/lab07/issues/events{/number}","events_url":"https://api.github.com/repos/sn1p3r46/lab07/events","assignees_url":"https://api.github.com/repos/sn1p3r46/lab07/assignees{/user}","branches_url":"https://api.github.com/repos/sn1p3r46/lab07/branches{/branch}","tags_url":"https://api.github.com/repos/sn1p3r46/lab07/tags","blobs_url":"https://api.github.com/repos/sn1p3r46/lab07/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sn1p3r46/lab07/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sn1p3r46/lab07/git/refs{/sha}","trees_url":"https://api.github.com/repos/sn1p3r46/lab07/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sn1p3r46/lab07/statuses/{sha}","languages_url":"https://api.github.com/repos/sn1p3r46/lab07/languages","stargazers_url":"https://api.github.com/repos/sn1p3r46/lab07/stargazers","contributors_url":"https://api.github.com/repos/sn1p3r46/lab07/contributors","subscribers_url":"https://api.github.com/repos/sn1p3r46/lab07/subscribers","subscription_url":"https://api.github.com/repos/sn1p3r46/lab07/subscription","commits_url":"https://api.github.com/repos/sn1p3r46/lab07/commits{/sha}","git_commits_url":"https://api.github.com/repos/sn1p3r46/lab07/git/commits{/sha}","comments_url":"https://api.github.com/repos/sn1p3r46/lab07/comments{/number}","issue_comment_url":"https://api.github.com/repos/sn1p3r46/lab07/issues/comments{/number}","contents_url":"https://api.github.com/repos/sn1p3r46/lab07/contents/{+path}","compare_url":"https://api.github.com/repos/sn1p3r46/lab07/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sn1p3r46/lab07/merges","archive_url":"https://api.github.com/repos/sn1p3r46/lab07/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sn1p3r46/lab07/downloads","issues_url":"https://api.github.com/repos/sn1p3r46/lab07/issues{/number}","pulls_url":"https://api.github.com/repos/sn1p3r46/lab07/pulls{/number}","milestones_url":"https://api.github.com/repos/sn1p3r46/lab07/milestones{/number}","notifications_url":"https://api.github.com/repos/sn1p3r46/lab07/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sn1p3r46/lab07/labels{/name}","releases_url":"https://api.github.com/repos/sn1p3r46/lab07/releases{/id}","created_at":"2015-11-16T23:36:27Z","updated_at":"2015-11-16T23:36:27Z","pushed_at":"2015-11-22T16:53:20Z","git_url":"git://github.com/sn1p3r46/lab07.git","ssh_url":"git@github.com:sn1p3r46/lab07.git","clone_url":"https://github.com/sn1p3r46/lab07.git","svn_url":"https://github.com/sn1p3r46/lab07","homepage":null,"size":115,"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":"IntroSDE:master","ref":"master","sha":"3b8ada4922d622fe5ff8dbcdf2caedefb2852260","user":{"login":"IntroSDE","id":11249211,"avatar_url":"https://avatars.githubusercontent.com/u/11249211?v=3","gravatar_id":"","url":"https://api.github.com/users/IntroSDE","html_url":"https://github.com/IntroSDE","followers_url":"https://api.github.com/users/IntroSDE/followers","following_url":"https://api.github.com/users/IntroSDE/following{/other_user}","gists_url":"https://api.github.com/users/IntroSDE/gists{/gist_id}","starred_url":"https://api.github.com/users/IntroSDE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IntroSDE/subscriptions","organizations_url":"https://api.github.com/users/IntroSDE/orgs","repos_url":"https://api.github.com/users/IntroSDE/repos","events_url":"https://api.github.com/users/IntroSDE/events{/privacy}","received_events_url":"https://api.github.com/users/IntroSDE/received_events","type":"Organization","site_admin":false},"repo":{"id":44601089,"name":"lab07","full_name":"IntroSDE/lab07","owner":{"login":"IntroSDE","id":11249211,"avatar_url":"https://avatars.githubusercontent.com/u/11249211?v=3","gravatar_id":"","url":"https://api.github.com/users/IntroSDE","html_url":"https://github.com/IntroSDE","followers_url":"https://api.github.com/users/IntroSDE/followers","following_url":"https://api.github.com/users/IntroSDE/following{/other_user}","gists_url":"https://api.github.com/users/IntroSDE/gists{/gist_id}","starred_url":"https://api.github.com/users/IntroSDE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IntroSDE/subscriptions","organizations_url":"https://api.github.com/users/IntroSDE/orgs","repos_url":"https://api.github.com/users/IntroSDE/repos","events_url":"https://api.github.com/users/IntroSDE/events{/privacy}","received_events_url":"https://api.github.com/users/IntroSDE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IntroSDE/lab07","description":"","fork":false,"url":"https://api.github.com/repos/IntroSDE/lab07","forks_url":"https://api.github.com/repos/IntroSDE/lab07/forks","keys_url":"https://api.github.com/repos/IntroSDE/lab07/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IntroSDE/lab07/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IntroSDE/lab07/teams","hooks_url":"https://api.github.com/repos/IntroSDE/lab07/hooks","issue_events_url":"https://api.github.com/repos/IntroSDE/lab07/issues/events{/number}","events_url":"https://api.github.com/repos/IntroSDE/lab07/events","assignees_url":"https://api.github.com/repos/IntroSDE/lab07/assignees{/user}","branches_url":"https://api.github.com/repos/IntroSDE/lab07/branches{/branch}","tags_url":"https://api.github.com/repos/IntroSDE/lab07/tags","blobs_url":"https://api.github.com/repos/IntroSDE/lab07/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IntroSDE/lab07/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IntroSDE/lab07/git/refs{/sha}","trees_url":"https://api.github.com/repos/IntroSDE/lab07/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IntroSDE/lab07/statuses/{sha}","languages_url":"https://api.github.com/repos/IntroSDE/lab07/languages","stargazers_url":"https://api.github.com/repos/IntroSDE/lab07/stargazers","contributors_url":"https://api.github.com/repos/IntroSDE/lab07/contributors","subscribers_url":"https://api.github.com/repos/IntroSDE/lab07/subscribers","subscription_url":"https://api.github.com/repos/IntroSDE/lab07/subscription","commits_url":"https://api.github.com/repos/IntroSDE/lab07/commits{/sha}","git_commits_url":"https://api.github.com/repos/IntroSDE/lab07/git/commits{/sha}","comments_url":"https://api.github.com/repos/IntroSDE/lab07/comments{/number}","issue_comment_url":"https://api.github.com/repos/IntroSDE/lab07/issues/comments{/number}","contents_url":"https://api.github.com/repos/IntroSDE/lab07/contents/{+path}","compare_url":"https://api.github.com/repos/IntroSDE/lab07/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IntroSDE/lab07/merges","archive_url":"https://api.github.com/repos/IntroSDE/lab07/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IntroSDE/lab07/downloads","issues_url":"https://api.github.com/repos/IntroSDE/lab07/issues{/number}","pulls_url":"https://api.github.com/repos/IntroSDE/lab07/pulls{/number}","milestones_url":"https://api.github.com/repos/IntroSDE/lab07/milestones{/number}","notifications_url":"https://api.github.com/repos/IntroSDE/lab07/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IntroSDE/lab07/labels{/name}","releases_url":"https://api.github.com/repos/IntroSDE/lab07/releases{/id}","created_at":"2015-10-20T11:15:06Z","updated_at":"2015-11-17T14:44:49Z","pushed_at":"2015-11-26T09:07:10Z","git_url":"git://github.com/IntroSDE/lab07.git","ssh_url":"git@github.com:IntroSDE/lab07.git","clone_url":"https://github.com/IntroSDE/lab07.git","svn_url":"https://github.com/IntroSDE/lab07","homepage":null,"size":111,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":0,"forks":10,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IntroSDE/lab07/pulls/2"},"html":{"href":"https://github.com/IntroSDE/lab07/pull/2"},"issue":{"href":"https://api.github.com/repos/IntroSDE/lab07/issues/2"},"comments":{"href":"https://api.github.com/repos/IntroSDE/lab07/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/IntroSDE/lab07/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/IntroSDE/lab07/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IntroSDE/lab07/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/IntroSDE/lab07/statuses/3326a0b578f63e91762b13094dfd988db39fef66"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pavelk2","id":1285967,"avatar_url":"https://avatars.githubusercontent.com/u/1285967?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelk2","html_url":"https://github.com/pavelk2","followers_url":"https://api.github.com/users/pavelk2/followers","following_url":"https://api.github.com/users/pavelk2/following{/other_user}","gists_url":"https://api.github.com/users/pavelk2/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelk2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelk2/subscriptions","organizations_url":"https://api.github.com/users/pavelk2/orgs","repos_url":"https://api.github.com/users/pavelk2/repos","events_url":"https://api.github.com/users/pavelk2/events{/privacy}","received_events_url":"https://api.github.com/users/pavelk2/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":32,"deletions":17,"changed_files":1}}