{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/comments/176376772","pull_request_review_id":106065439,"id":176376772,"diff_hunk":"@@ -1,38 +1,64 @@\n package org.sonar.commonruleengine;\n \n+import java.util.Arrays;\n+import java.util.stream.Collectors;\n+import javax.annotation.Nullable;\n import org.sonar.commonruleengine.checks.Check;\n import org.sonar.uast.UastNode;\n \n public class Issue {\n \n-  private final String message;\n   private final Check rule;\n-  private final UastNode node;\n+  private final Message primaryMessage;\n+  private final Message[] secondaryMessages;\n \n-  public Issue(Check rule, UastNode node, String message) {\n-    this.message = message;\n-    this.node = node;\n+  public Issue(Check rule, Message primaryMessage, Message... secondaryMessages) {\n     this.rule = rule;\n-  }\n-\n-  public String getMessage() {\n-    return message;\n+    this.primaryMessage = primaryMessage;\n+    this.secondaryMessages = secondaryMessages;\n   }\n \n   public Check getRule() {\n     return rule;\n   }\n \n-  public UastNode getNode() {\n-    return node;\n+  public Message getPrimary() {\n+    return primaryMessage;\n   }\n \n-  public int getLine() {\n-    return node.firstToken().line;\n+  public Message[] getSecondaries() {\n+    return secondaryMessages;\n   }\n \n   @Override\n   public String toString() {\n-    return String.format(\"%s %s: %s\", node, rule.getClass().getSimpleName(), message);\n+    return rule.getClass().getSimpleName() + \": \" + primaryMessage.toString() + \" \" +\n+      Arrays.stream(secondaryMessages).map(Message::toString).collect(Collectors.joining(\" \"));\n+  }\n+\n+  public static class Message {\n+    public final UastNode from;\n+    public final UastNode to;\n+    @Nullable\n+    public final String message;","path":"common-rule-engine/src/main/java/org/sonar/commonruleengine/Issue.java","position":57,"original_position":57,"commit_id":"492a4f66a39de29ea12d436c365407e1e01b3f37","original_commit_id":"492a4f66a39de29ea12d436c365407e1e01b3f37","user":{"login":"SonarTech","id":1842438,"avatar_url":"https://avatars2.githubusercontent.com/u/1842438?v=4","gravatar_id":"","url":"https://api.github.com/users/SonarTech","html_url":"https://github.com/SonarTech","followers_url":"https://api.github.com/users/SonarTech/followers","following_url":"https://api.github.com/users/SonarTech/following{/other_user}","gists_url":"https://api.github.com/users/SonarTech/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarTech/subscriptions","organizations_url":"https://api.github.com/users/SonarTech/orgs","repos_url":"https://api.github.com/users/SonarTech/repos","events_url":"https://api.github.com/users/SonarTech/events{/privacy}","received_events_url":"https://api.github.com/users/SonarTech/received_events","type":"User","site_admin":false},"body":"![Code Smell](https://sonarsource.github.io/sonar-github/code_smell.png 'Code Smell') Code Smell: Rename field \"message\" ([squid:S1700](https://next.sonarqube.com/sonarqube/coding_rules#rule_key=squid%3AS1700))\n\n[See it in SonarQube](https://next.sonarqube.com/sonarqube/project/issues?id=org.sonarsource.go%3Asonar-go&pullRequest=154&issues=AWJNU73hs_VgbIaGzJYk&open=AWJNU73hs_VgbIaGzJYk)\n\n[ISSUE_KEY]: AWJNU73hs_VgbIaGzJYk","created_at":"2018-03-22T10:49:19Z","updated_at":"2018-03-22T10:49:19Z","html_url":"https://github.com/SonarSource/sonar-go/pull/154#discussion_r176376772","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/comments/176376772"},"html":{"href":"https://github.com/SonarSource/sonar-go/pull/154#discussion_r176376772"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154","id":176738088,"html_url":"https://github.com/SonarSource/sonar-go/pull/154","diff_url":"https://github.com/SonarSource/sonar-go/pull/154.diff","patch_url":"https://github.com/SonarSource/sonar-go/pull/154.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/154","number":154,"state":"open","locked":false,"title":"Add secondary locations","user":{"login":"alban-auzeill","id":1235009,"avatar_url":"https://avatars2.githubusercontent.com/u/1235009?v=4","gravatar_id":"","url":"https://api.github.com/users/alban-auzeill","html_url":"https://github.com/alban-auzeill","followers_url":"https://api.github.com/users/alban-auzeill/followers","following_url":"https://api.github.com/users/alban-auzeill/following{/other_user}","gists_url":"https://api.github.com/users/alban-auzeill/gists{/gist_id}","starred_url":"https://api.github.com/users/alban-auzeill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alban-auzeill/subscriptions","organizations_url":"https://api.github.com/users/alban-auzeill/orgs","repos_url":"https://api.github.com/users/alban-auzeill/repos","events_url":"https://api.github.com/users/alban-auzeill/events{/privacy}","received_events_url":"https://api.github.com/users/alban-auzeill/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-22T10:43:38Z","updated_at":"2018-03-22T10:49:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83477f667afc052773839cfceb40122572894bce","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":850109905,"url":"https://api.github.com/repos/SonarSource/sonar-go/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154/comments","review_comment_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/154/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-go/statuses/492a4f66a39de29ea12d436c365407e1e01b3f37","head":{"label":"SonarSource:feature/alban/secondary-locations","ref":"feature/alban/secondary-locations","sha":"492a4f66a39de29ea12d436c365407e1e01b3f37","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","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":122954189,"name":"sonar-go","full_name":"SonarSource/sonar-go","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","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/sonar-go","description":null,"fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-go","forks_url":"https://api.github.com/repos/SonarSource/sonar-go/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-go/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-go/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-go/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-go/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-go/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-go/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-go/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-go/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-go/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-go/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-go/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-go/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-go/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-go/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-go/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-go/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-go/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-go/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-go/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonar-go/deployments","created_at":"2018-02-26T10:33:29Z","updated_at":"2018-03-21T17:56:49Z","pushed_at":"2018-03-22T10:43:39Z","git_url":"git://github.com/SonarSource/sonar-go.git","ssh_url":"git@github.com:SonarSource/sonar-go.git","clone_url":"https://github.com/SonarSource/sonar-go.git","svn_url":"https://github.com/SonarSource/sonar-go","homepage":null,"size":558,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":65,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0"},"forks":0,"open_issues":65,"watchers":0,"default_branch":"master"}},"base":{"label":"SonarSource:master","ref":"master","sha":"6dc24101395eb7afa648e1d4d6602eb661c9b1eb","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","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":122954189,"name":"sonar-go","full_name":"SonarSource/sonar-go","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","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/sonar-go","description":null,"fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-go","forks_url":"https://api.github.com/repos/SonarSource/sonar-go/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-go/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-go/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-go/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-go/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-go/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-go/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-go/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-go/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-go/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-go/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-go/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-go/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-go/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-go/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-go/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-go/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-go/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-go/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-go/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-go/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonar-go/deployments","created_at":"2018-02-26T10:33:29Z","updated_at":"2018-03-21T17:56:49Z","pushed_at":"2018-03-22T10:43:39Z","git_url":"git://github.com/SonarSource/sonar-go.git","ssh_url":"git@github.com:SonarSource/sonar-go.git","clone_url":"https://github.com/SonarSource/sonar-go.git","svn_url":"https://github.com/SonarSource/sonar-go","homepage":null,"size":558,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":65,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0"},"forks":0,"open_issues":65,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154"},"html":{"href":"https://github.com/SonarSource/sonar-go/pull/154"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-go/issues/154"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-go/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SonarSource/sonar-go/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-go/statuses/492a4f66a39de29ea12d436c365407e1e01b3f37"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"SonarTech"}}