{"action":"created","comment":{"url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/comments/49960653","id":49960653,"diff_hunk":"@@ -32,23 +34,23 @@ public CreateResourceHandler(ProcessorContext context) {\n     try {\n \n       createRes = new AJEntityResource();\n-      DBHelper.getInstance().populateEntityFromJson(context.request(), createRes);\n-\n+      DBHelper.populateEntityFromJson(context.request(), createRes);\n+      \n+      createRes.set(\"id\", UUID.randomUUID());\n       LOGGER.debug(\"validateRequest : Creating resource From MAP  : {}\", createRes.toInsert());\n \n-      JsonObject resourceIdWithURLDuplicates = DBHelper.getInstance().getDuplicateResourcesByURL(createRes.getString(ResourceRepo.RESOURCE_URL));\n+      JsonObject resourceIdWithURLDuplicates = DBHelper.getDuplicateResourcesByURL(createRes.getString(ResourceEntityConstants.RESOURCE_URL));\n       if (resourceIdWithURLDuplicates != null && !resourceIdWithURLDuplicates.isEmpty()) {\n-        LOGGER.debug(\"validateRequest : URL Exists <TBD> so cannot go ahead!\");\n-        // <TBD>...what type of message to post back...\n-        return new ExecutionResult<>(MessageResponseFactory.createValidationErrorResponse(resourceIdWithURLDuplicates),\n-          ExecutionResult.ExecutionStatus.FAILED);\n+        LOGGER.error(\"validateRequest : Duplicate resource URL found. So cannot go ahead with creating new resource! URL : {}\", createRes.getString(ResourceEntityConstants.RESOURCE_URL));\n+        LOGGER.error(\"validateRequest : Duplicate resources : {}\", resourceIdWithURLDuplicates); \n+        return new ExecutionResult<>(MessageResponseFactory.createValidationErrorResponse(resourceIdWithURLDuplicates), ExecutionResult.ExecutionStatus.FAILED);\n       }\n \n     } catch (SQLException e) {\n-      LOGGER.warn(\"CheckSanity : {} \", e);\n+      LOGGER.error(\"CheckSanity : {} \", e);\n       return new ExecutionResult<>(MessageResponseFactory.createInvalidRequestResponse(), ExecutionResult.ExecutionStatus.FAILED);\n     } catch (IllegalArgumentException iae) {\n-      LOGGER.warn(\"CheckSanity : {} \", iae);\n+      LOGGER.error(\"CheckSanity : {} \", iae);\n       return new ExecutionResult<>(MessageResponseFactory.createInvalidRequestResponse(), ExecutionResult.ExecutionStatus.FAILED);\n     }\n ","path":"src/main/java/org/gooru/nucleus/handlers/resources/processors/repositories/activejdbc/dbhandlers/CreateResourceHandler.java","position":51,"original_position":51,"commit_id":"a692155b3086fbe0d57416e24f0a4ef8c6e68c0f","original_commit_id":"a692155b3086fbe0d57416e24f0a4ef8c6e68c0f","user":{"login":"am-gooru","id":11534558,"avatar_url":"https://avatars.githubusercontent.com/u/11534558?v=3","gravatar_id":"","url":"https://api.github.com/users/am-gooru","html_url":"https://github.com/am-gooru","followers_url":"https://api.github.com/users/am-gooru/followers","following_url":"https://api.github.com/users/am-gooru/following{/other_user}","gists_url":"https://api.github.com/users/am-gooru/gists{/gist_id}","starred_url":"https://api.github.com/users/am-gooru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am-gooru/subscriptions","organizations_url":"https://api.github.com/users/am-gooru/orgs","repos_url":"https://api.github.com/users/am-gooru/repos","events_url":"https://api.github.com/users/am-gooru/events{/privacy}","received_events_url":"https://api.github.com/users/am-gooru/received_events","type":"User","site_admin":false},"body":"The two catch blocks are identical. We can merge them.","created_at":"2016-01-18T03:59:56Z","updated_at":"2016-01-18T03:59:56Z","html_url":"https://github.com/Gooru/nucleus-handlers-resource/pull/6#discussion_r49960653","pull_request_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/comments/49960653"},"html":{"href":"https://github.com/Gooru/nucleus-handlers-resource/pull/6#discussion_r49960653"},"pull_request":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6","id":56197982,"html_url":"https://github.com/Gooru/nucleus-handlers-resource/pull/6","diff_url":"https://github.com/Gooru/nucleus-handlers-resource/pull/6.diff","patch_url":"https://github.com/Gooru/nucleus-handlers-resource/pull/6.patch","issue_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/6","number":6,"state":"open","locked":false,"title":"Incorporated review comments","user":{"login":"gooru-nishi","id":16591208,"avatar_url":"https://avatars.githubusercontent.com/u/16591208?v=3","gravatar_id":"","url":"https://api.github.com/users/gooru-nishi","html_url":"https://github.com/gooru-nishi","followers_url":"https://api.github.com/users/gooru-nishi/followers","following_url":"https://api.github.com/users/gooru-nishi/following{/other_user}","gists_url":"https://api.github.com/users/gooru-nishi/gists{/gist_id}","starred_url":"https://api.github.com/users/gooru-nishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooru-nishi/subscriptions","organizations_url":"https://api.github.com/users/gooru-nishi/orgs","repos_url":"https://api.github.com/users/gooru-nishi/repos","events_url":"https://api.github.com/users/gooru-nishi/events{/privacy}","received_events_url":"https://api.github.com/users/gooru-nishi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-15T17:32:26Z","updated_at":"2016-01-18T03:59:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71e59afe8cc8c1015eff883d94e0ff388e26fe81","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6/commits","review_comments_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6/comments","review_comment_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/6/comments","statuses_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/statuses/a692155b3086fbe0d57416e24f0a4ef8c6e68c0f","head":{"label":"gooru-nishi:master","ref":"master","sha":"a692155b3086fbe0d57416e24f0a4ef8c6e68c0f","user":{"login":"gooru-nishi","id":16591208,"avatar_url":"https://avatars.githubusercontent.com/u/16591208?v=3","gravatar_id":"","url":"https://api.github.com/users/gooru-nishi","html_url":"https://github.com/gooru-nishi","followers_url":"https://api.github.com/users/gooru-nishi/followers","following_url":"https://api.github.com/users/gooru-nishi/following{/other_user}","gists_url":"https://api.github.com/users/gooru-nishi/gists{/gist_id}","starred_url":"https://api.github.com/users/gooru-nishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooru-nishi/subscriptions","organizations_url":"https://api.github.com/users/gooru-nishi/orgs","repos_url":"https://api.github.com/users/gooru-nishi/repos","events_url":"https://api.github.com/users/gooru-nishi/events{/privacy}","received_events_url":"https://api.github.com/users/gooru-nishi/received_events","type":"User","site_admin":false},"repo":{"id":49196954,"name":"nucleus-handlers-resource","full_name":"gooru-nishi/nucleus-handlers-resource","owner":{"login":"gooru-nishi","id":16591208,"avatar_url":"https://avatars.githubusercontent.com/u/16591208?v=3","gravatar_id":"","url":"https://api.github.com/users/gooru-nishi","html_url":"https://github.com/gooru-nishi","followers_url":"https://api.github.com/users/gooru-nishi/followers","following_url":"https://api.github.com/users/gooru-nishi/following{/other_user}","gists_url":"https://api.github.com/users/gooru-nishi/gists{/gist_id}","starred_url":"https://api.github.com/users/gooru-nishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooru-nishi/subscriptions","organizations_url":"https://api.github.com/users/gooru-nishi/orgs","repos_url":"https://api.github.com/users/gooru-nishi/repos","events_url":"https://api.github.com/users/gooru-nishi/events{/privacy}","received_events_url":"https://api.github.com/users/gooru-nishi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gooru-nishi/nucleus-handlers-resource","description":"nucleus-handlers-resource","fork":true,"url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource","forks_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/forks","keys_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/teams","hooks_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/hooks","issue_events_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/issues/events{/number}","events_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/events","assignees_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/assignees{/user}","branches_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/branches{/branch}","tags_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/tags","blobs_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/languages","stargazers_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/stargazers","contributors_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/contributors","subscribers_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/subscribers","subscription_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/subscription","commits_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/contents/{+path}","compare_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/merges","archive_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/downloads","issues_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/issues{/number}","pulls_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/labels{/name}","releases_url":"https://api.github.com/repos/gooru-nishi/nucleus-handlers-resource/releases{/id}","created_at":"2016-01-07T10:06:19Z","updated_at":"2016-01-11T06:05:44Z","pushed_at":"2016-01-15T17:27:40Z","git_url":"git://github.com/gooru-nishi/nucleus-handlers-resource.git","ssh_url":"git@github.com:gooru-nishi/nucleus-handlers-resource.git","clone_url":"https://github.com/gooru-nishi/nucleus-handlers-resource.git","svn_url":"https://github.com/gooru-nishi/nucleus-handlers-resource","homepage":"","size":97,"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":"Gooru:master","ref":"master","sha":"2318059e20fd0b4f292a5aaee321eb338e0b4484","user":{"login":"Gooru","id":3195139,"avatar_url":"https://avatars.githubusercontent.com/u/3195139?v=3","gravatar_id":"","url":"https://api.github.com/users/Gooru","html_url":"https://github.com/Gooru","followers_url":"https://api.github.com/users/Gooru/followers","following_url":"https://api.github.com/users/Gooru/following{/other_user}","gists_url":"https://api.github.com/users/Gooru/gists{/gist_id}","starred_url":"https://api.github.com/users/Gooru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gooru/subscriptions","organizations_url":"https://api.github.com/users/Gooru/orgs","repos_url":"https://api.github.com/users/Gooru/repos","events_url":"https://api.github.com/users/Gooru/events{/privacy}","received_events_url":"https://api.github.com/users/Gooru/received_events","type":"Organization","site_admin":false},"repo":{"id":47533415,"name":"nucleus-handlers-resource","full_name":"Gooru/nucleus-handlers-resource","owner":{"login":"Gooru","id":3195139,"avatar_url":"https://avatars.githubusercontent.com/u/3195139?v=3","gravatar_id":"","url":"https://api.github.com/users/Gooru","html_url":"https://github.com/Gooru","followers_url":"https://api.github.com/users/Gooru/followers","following_url":"https://api.github.com/users/Gooru/following{/other_user}","gists_url":"https://api.github.com/users/Gooru/gists{/gist_id}","starred_url":"https://api.github.com/users/Gooru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gooru/subscriptions","organizations_url":"https://api.github.com/users/Gooru/orgs","repos_url":"https://api.github.com/users/Gooru/repos","events_url":"https://api.github.com/users/Gooru/events{/privacy}","received_events_url":"https://api.github.com/users/Gooru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Gooru/nucleus-handlers-resource","description":"nucleus-handlers-resource","fork":false,"url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource","forks_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/forks","keys_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/teams","hooks_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/hooks","issue_events_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/events{/number}","events_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/events","assignees_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/assignees{/user}","branches_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/branches{/branch}","tags_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/tags","blobs_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/languages","stargazers_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/stargazers","contributors_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/contributors","subscribers_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/subscribers","subscription_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/subscription","commits_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/contents/{+path}","compare_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/merges","archive_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/downloads","issues_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues{/number}","pulls_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/labels{/name}","releases_url":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/releases{/id}","created_at":"2015-12-07T06:21:59Z","updated_at":"2016-01-13T10:20:55Z","pushed_at":"2016-01-15T17:32:26Z","git_url":"git://github.com/Gooru/nucleus-handlers-resource.git","ssh_url":"git@github.com:Gooru/nucleus-handlers-resource.git","clone_url":"https://github.com/Gooru/nucleus-handlers-resource.git","svn_url":"https://github.com/Gooru/nucleus-handlers-resource","homepage":"","size":88,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6"},"html":{"href":"https://github.com/Gooru/nucleus-handlers-resource/pull/6"},"issue":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/6"},"comments":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/Gooru/nucleus-handlers-resource/statuses/a692155b3086fbe0d57416e24f0a4ef8c6e68c0f"}}}}