{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/comments/39843941","id":39843941,"diff_hunk":"@@ -90,7 +90,13 @@ public void putContextParameter(Object key, Object value) {\n     }\n \n     public Object getContextParameter(Object key) {\n-        return context.get(key);\n+        Object value = context.get(key);\n+        //check if the value is present in the toString value of the key\n+        //due to a bug in the way we update the key by serializing and deserializing, it sometimes gets toString value of the key. @see com.cloud.api.ApiAsyncJobDispatcher#runJob\n+        if(value == null ) {\n+            value = context.get(key.toString());","path":"api/src/org/apache/cloudstack/context/CallContext.java","position":9,"original_position":9,"commit_id":"2b6a0b363c0518f9571dd1ff092784f3fde92a95","original_commit_id":"2b6a0b363c0518f9571dd1ff092784f3fde92a95","user":{"login":"borisroman","id":5996146,"avatar_url":"https://avatars.githubusercontent.com/u/5996146?v=3","gravatar_id":"","url":"https://api.github.com/users/borisroman","html_url":"https://github.com/borisroman","followers_url":"https://api.github.com/users/borisroman/followers","following_url":"https://api.github.com/users/borisroman/following{/other_user}","gists_url":"https://api.github.com/users/borisroman/gists{/gist_id}","starred_url":"https://api.github.com/users/borisroman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borisroman/subscriptions","organizations_url":"https://api.github.com/users/borisroman/orgs","repos_url":"https://api.github.com/users/borisroman/repos","events_url":"https://api.github.com/users/borisroman/events{/privacy}","received_events_url":"https://api.github.com/users/borisroman/received_events","type":"User","site_admin":false},"body":"@karuturi What if key doesn't have a toString() method or is null?","created_at":"2015-09-18T10:58:59Z","updated_at":"2015-09-18T10:58:59Z","html_url":"https://github.com/apache/cloudstack/pull/849#discussion_r39843941","pull_request_url":"https://api.github.com/repos/apache/cloudstack/pulls/849","_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments/39843941"},"html":{"href":"https://github.com/apache/cloudstack/pull/849#discussion_r39843941"},"pull_request":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/849"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/849","id":45387017,"html_url":"https://github.com/apache/cloudstack/pull/849","diff_url":"https://github.com/apache/cloudstack/pull/849.diff","patch_url":"https://github.com/apache/cloudstack/pull/849.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/849","number":849,"state":"open","locked":false,"title":"Cloudstack-8816 some of the events do not have resource uuids","user":{"login":"karuturi","id":186833,"avatar_url":"https://avatars.githubusercontent.com/u/186833?v=3","gravatar_id":"","url":"https://api.github.com/users/karuturi","html_url":"https://github.com/karuturi","followers_url":"https://api.github.com/users/karuturi/followers","following_url":"https://api.github.com/users/karuturi/following{/other_user}","gists_url":"https://api.github.com/users/karuturi/gists{/gist_id}","starred_url":"https://api.github.com/users/karuturi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karuturi/subscriptions","organizations_url":"https://api.github.com/users/karuturi/orgs","repos_url":"https://api.github.com/users/karuturi/repos","events_url":"https://api.github.com/users/karuturi/events{/privacy}","received_events_url":"https://api.github.com/users/karuturi/received_events","type":"User","site_admin":false},"body":"The key objects in the context map are sometimes String and sometimes object. This causes missing uuids when an entity put in the context map with key entity.toString is queried with key entity\r\n\r\nTesting:\r\nmanually tested by deploying a vm and checked that the created events in rabbitmq now has uuids.\r\nevents before and after the change are update at https://issues.apache.org/jira/browse/CLOUDSTACK-8816?focusedCommentId=14805239\r\n\r\nunittests\r\n```\r\n$ mvn -pl :cloud-api test -Dtest=CallContextTest\r\n-------------------------------------------------------\r\n T E S T S\r\n-------------------------------------------------------\r\nRunning org.apache.cloudstack.context.CallContextTest\r\nTests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.152 sec - in org.apache.cloudstack.context.CallContextTest\r\n\r\nResults :\r\n\r\nTests run: 1, Failures: 0, Errors: 0, Skipped: 0\r\n\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 11.445 s\r\n[INFO] Finished at: 2015-09-18T14:58:53+05:30\r\n[INFO] Final Memory: 55M/448M\r\n[INFO] ------------------------------------------------------------------------\r\n```","created_at":"2015-09-18T09:39:11Z","updated_at":"2015-09-18T10:58:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ce584558f575152a324f2ea6840901dda120edb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/849/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/849/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/849/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/2b6a0b363c0518f9571dd1ff092784f3fde92a95","head":{"label":"karuturi:CLOUDSTACK-8816-take2","ref":"CLOUDSTACK-8816-take2","sha":"2b6a0b363c0518f9571dd1ff092784f3fde92a95","user":{"login":"karuturi","id":186833,"avatar_url":"https://avatars.githubusercontent.com/u/186833?v=3","gravatar_id":"","url":"https://api.github.com/users/karuturi","html_url":"https://github.com/karuturi","followers_url":"https://api.github.com/users/karuturi/followers","following_url":"https://api.github.com/users/karuturi/following{/other_user}","gists_url":"https://api.github.com/users/karuturi/gists{/gist_id}","starred_url":"https://api.github.com/users/karuturi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karuturi/subscriptions","organizations_url":"https://api.github.com/users/karuturi/orgs","repos_url":"https://api.github.com/users/karuturi/repos","events_url":"https://api.github.com/users/karuturi/events{/privacy}","received_events_url":"https://api.github.com/users/karuturi/received_events","type":"User","site_admin":false},"repo":{"id":39767553,"name":"cloudstack","full_name":"karuturi/cloudstack","owner":{"login":"karuturi","id":186833,"avatar_url":"https://avatars.githubusercontent.com/u/186833?v=3","gravatar_id":"","url":"https://api.github.com/users/karuturi","html_url":"https://github.com/karuturi","followers_url":"https://api.github.com/users/karuturi/followers","following_url":"https://api.github.com/users/karuturi/following{/other_user}","gists_url":"https://api.github.com/users/karuturi/gists{/gist_id}","starred_url":"https://api.github.com/users/karuturi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karuturi/subscriptions","organizations_url":"https://api.github.com/users/karuturi/orgs","repos_url":"https://api.github.com/users/karuturi/repos","events_url":"https://api.github.com/users/karuturi/events{/privacy}","received_events_url":"https://api.github.com/users/karuturi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karuturi/cloudstack","description":"Mirror of Apache Cloudstack","fork":true,"url":"https://api.github.com/repos/karuturi/cloudstack","forks_url":"https://api.github.com/repos/karuturi/cloudstack/forks","keys_url":"https://api.github.com/repos/karuturi/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karuturi/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karuturi/cloudstack/teams","hooks_url":"https://api.github.com/repos/karuturi/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/karuturi/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/karuturi/cloudstack/events","assignees_url":"https://api.github.com/repos/karuturi/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/karuturi/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/karuturi/cloudstack/tags","blobs_url":"https://api.github.com/repos/karuturi/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karuturi/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karuturi/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/karuturi/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karuturi/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/karuturi/cloudstack/languages","stargazers_url":"https://api.github.com/repos/karuturi/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/karuturi/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/karuturi/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/karuturi/cloudstack/subscription","commits_url":"https://api.github.com/repos/karuturi/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/karuturi/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/karuturi/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/karuturi/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/karuturi/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/karuturi/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karuturi/cloudstack/merges","archive_url":"https://api.github.com/repos/karuturi/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karuturi/cloudstack/downloads","issues_url":"https://api.github.com/repos/karuturi/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/karuturi/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/karuturi/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/karuturi/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karuturi/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/karuturi/cloudstack/releases{/id}","created_at":"2015-07-27T09:59:48Z","updated_at":"2015-07-27T10:00:10Z","pushed_at":"2015-09-18T09:30:36Z","git_url":"git://github.com/karuturi/cloudstack.git","ssh_url":"git@github.com:karuturi/cloudstack.git","clone_url":"https://github.com/karuturi/cloudstack.git","svn_url":"https://github.com/karuturi/cloudstack","homepage":null,"size":493248,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"a5ca762acb4e0a8b27f11aa3515558b87e8fdb18","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","created_at":"2013-04-29T22:27:12Z","updated_at":"2015-09-18T00:03:30Z","pushed_at":"2015-09-18T10:25:44Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":758278,"stargazers_count":289,"watchers_count":289,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":371,"mirror_url":"git://git.apache.org/cloudstack.git","open_issues_count":66,"forks":371,"open_issues":66,"watchers":289,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/849"},"html":{"href":"https://github.com/apache/cloudstack/pull/849"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/849"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/849/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/849/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/849/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/2b6a0b363c0518f9571dd1ff092784f3fde92a95"}}}}