{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments/103918142","pull_request_review_id":24724081,"id":103918142,"diff_hunk":"@@ -41,13 +38,8 @@ public void index(InputComponent component, InputComponent parent) {\n     Preconditions.checkNotNull(component);\n     Preconditions.checkNotNull(parent);\n     parents.put(component, parent);\n-    Set<InputComponent> list = children.get(parent);\n-    if (list == null) {\n-      list = new LinkedHashSet<>();\n-      children.put(parent, list);\n-    }\n-\n-    list.add(component);\n+    children.putIfAbsent(parent, new LinkedHashSet<>());\n+    children.get(parent).add(component);","path":"sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DefaultComponentTree.java","position":34,"original_position":34,"commit_id":"d29f48a18554d1a3d5b024640192141126847cc4","original_commit_id":"d29f48a18554d1a3d5b024640192141126847cc4","user":{"login":"janos-ss","id":21700885,"avatar_url":"https://avatars3.githubusercontent.com/u/21700885?v=3","gravatar_id":"","url":"https://api.github.com/users/janos-ss","html_url":"https://github.com/janos-ss","followers_url":"https://api.github.com/users/janos-ss/followers","following_url":"https://api.github.com/users/janos-ss/following{/other_user}","gists_url":"https://api.github.com/users/janos-ss/gists{/gist_id}","starred_url":"https://api.github.com/users/janos-ss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janos-ss/subscriptions","organizations_url":"https://api.github.com/users/janos-ss/orgs","repos_url":"https://api.github.com/users/janos-ss/repos","events_url":"https://api.github.com/users/janos-ss/events{/privacy}","received_events_url":"https://api.github.com/users/janos-ss/received_events","type":"User","site_admin":false},"body":"If the entry is missing it will put a new `LinkedHashSet`. It will have the same outcome as what you wrote, but in case the entry is present, it won't create a new `LinkedHashSet` unnecessarily.","created_at":"2017-03-02T13:00:47Z","updated_at":"2017-03-02T13:00:47Z","html_url":"https://github.com/SonarSource/sonarqube/pull/1734#discussion_r103918142","pull_request_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments/103918142"},"html":{"href":"https://github.com/SonarSource/sonarqube/pull/1734#discussion_r103918142"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734","id":108746322,"html_url":"https://github.com/SonarSource/sonarqube/pull/1734","diff_url":"https://github.com/SonarSource/sonarqube/pull/1734.diff","patch_url":"https://github.com/SonarSource/sonarqube/pull/1734.patch","issue_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/1734","number":1734,"state":"open","locked":false,"title":"Fix/branch preview mode","user":{"login":"henryju","id":281596,"avatar_url":"https://avatars0.githubusercontent.com/u/281596?v=3","gravatar_id":"","url":"https://api.github.com/users/henryju","html_url":"https://github.com/henryju","followers_url":"https://api.github.com/users/henryju/followers","following_url":"https://api.github.com/users/henryju/following{/other_user}","gists_url":"https://api.github.com/users/henryju/gists{/gist_id}","starred_url":"https://api.github.com/users/henryju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henryju/subscriptions","organizations_url":"https://api.github.com/users/henryju/orgs","repos_url":"https://api.github.com/users/henryju/repos","events_url":"https://api.github.com/users/henryju/events{/privacy}","received_events_url":"https://api.github.com/users/henryju/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-02T12:11:37Z","updated_at":"2017-03-02T13:00:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d42d04fa71f16828a6279341995f941a6d8b1797","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734/comments","review_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/1734/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/d29f48a18554d1a3d5b024640192141126847cc4","head":{"label":"SonarSource:fix/branch_preview_mode","ref":"fix/branch_preview_mode","sha":"d29f48a18554d1a3d5b024640192141126847cc4","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars3.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":1222504,"name":"sonarqube","full_name":"SonarSource/sonarqube","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars3.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonarqube","description":"Continuous Code Quality","fork":false,"url":"https://api.github.com/repos/SonarSource/sonarqube","forks_url":"https://api.github.com/repos/SonarSource/sonarqube/forks","keys_url":"https://api.github.com/repos/SonarSource/sonarqube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonarqube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonarqube/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonarqube/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonarqube/events","assignees_url":"https://api.github.com/repos/SonarSource/sonarqube/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonarqube/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonarqube/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonarqube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonarqube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonarqube/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonarqube/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonarqube/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonarqube/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonarqube/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonarqube/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonarqube/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonarqube/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonarqube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonarqube/merges","archive_url":"https://api.github.com/repos/SonarSource/sonarqube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonarqube/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonarqube/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonarqube/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonarqube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonarqube/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonarqube/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonarqube/deployments","created_at":"2011-01-05T11:05:17Z","updated_at":"2017-03-02T09:23:20Z","pushed_at":"2017-03-02T12:54:30Z","git_url":"git://github.com/SonarSource/sonarqube.git","ssh_url":"git@github.com:SonarSource/sonarqube.git","clone_url":"https://github.com/SonarSource/sonarqube.git","svn_url":"https://github.com/SonarSource/sonarqube","homepage":"http://www.sonarqube.org","size":154521,"stargazers_count":1560,"watchers_count":1560,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":592,"mirror_url":null,"open_issues_count":16,"forks":592,"open_issues":16,"watchers":1560,"default_branch":"master"}},"base":{"label":"SonarSource:branch-6.3","ref":"branch-6.3","sha":"889f6e5c0d1c3c6f89e36ba61cb658eb9607ee90","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars3.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":1222504,"name":"sonarqube","full_name":"SonarSource/sonarqube","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars3.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonarqube","description":"Continuous Code Quality","fork":false,"url":"https://api.github.com/repos/SonarSource/sonarqube","forks_url":"https://api.github.com/repos/SonarSource/sonarqube/forks","keys_url":"https://api.github.com/repos/SonarSource/sonarqube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonarqube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonarqube/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonarqube/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonarqube/events","assignees_url":"https://api.github.com/repos/SonarSource/sonarqube/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonarqube/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonarqube/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonarqube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonarqube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonarqube/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonarqube/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonarqube/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonarqube/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonarqube/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonarqube/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonarqube/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonarqube/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonarqube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonarqube/merges","archive_url":"https://api.github.com/repos/SonarSource/sonarqube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonarqube/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonarqube/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonarqube/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonarqube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonarqube/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonarqube/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonarqube/deployments","created_at":"2011-01-05T11:05:17Z","updated_at":"2017-03-02T09:23:20Z","pushed_at":"2017-03-02T12:54:30Z","git_url":"git://github.com/SonarSource/sonarqube.git","ssh_url":"git@github.com:SonarSource/sonarqube.git","clone_url":"https://github.com/SonarSource/sonarqube.git","svn_url":"https://github.com/SonarSource/sonarqube","homepage":"http://www.sonarqube.org","size":154521,"stargazers_count":1560,"watchers_count":1560,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":592,"mirror_url":null,"open_issues_count":16,"forks":592,"open_issues":16,"watchers":1560,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734"},"html":{"href":"https://github.com/SonarSource/sonarqube/pull/1734"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonarqube/issues/1734"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonarqube/issues/1734/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734/comments"},"review_comment":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/1734/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonarqube/statuses/d29f48a18554d1a3d5b024640192141126847cc4"}}}}
{"actor":{"display_login":"janos-ss"}}