{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments/41390483","id":41390483,"diff_hunk":"@@ -238,120 +119,16 @@ public void addIssue(int line, JavaCheck javaCheck, String message, @Nullable Do\n     }\n \n     @Override\n-    @Nullable\n-    public Object getSemanticModel() {\n-      return semanticModel;\n-    }\n-\n-    @Override\n-    public String getFileKey() {\n-      return sourceFile.getKey();\n-    }\n-\n-    @CheckForNull\n-    private RuleKey getRuleKey(JavaCheck check) {\n-      if (sonarComponents != null) {\n-        for (Checks<JavaCheck> sonarChecks : sonarComponents.checks()) {\n-          RuleKey ruleKey = sonarChecks.ruleKey(check);\n-          if (ruleKey != null) {\n-            return ruleKey;\n-          }\n-        }\n-      }\n-      return null;\n-    }\n-\n-    @Override\n-    public void addIssue(File file, JavaCheck check, int line, String message) {\n-      RuleKey key = getRuleKey(check);\n-      if (key != null) {\n-        Issuable issuable = sonarComponents.issuableFor(file);\n-        if (issuable != null) {\n-          Issuable.IssueBuilder issueBuilder = issuable.newIssueBuilder()\n-            .ruleKey(key)\n-            .message(message);\n-          if (line > -1) {\n-            issueBuilder.line(line);\n-          }\n-          Issue issue = issueBuilder.build();\n-          issuable.addIssue(issue);\n-        }\n-      }\n-    }\n-\n-    /**\n-     *\n-     * DO NOT GO ON RELEASE WITH THIS CONSTANT SET TO TRUE\n-     *\n-     * **/\n-    private static final boolean ENABLE_NEW_APIS = false;\n-\n-    @Override\n-    public void reportIssue(JavaCheck javaCheck, Tree tree, String message) {\n-      reportIssue(javaCheck, tree, message, ImmutableList.<Location>of(), null);\n-    }\n-\n-    @Override\n     public void reportIssue(JavaCheck javaCheck, Tree syntaxNode, String message, List<Location> secondary, @Nullable Integer cost) {\n-      if (ENABLE_NEW_APIS) {\n-        JavaCheckMessage checkMessage = new JavaCheckMessage(javaCheck, message);\n-        AnalyzerMessage.TextSpan textSpan = textSpanFor(syntaxNode);\n-        if (cost != null) {\n-          checkMessage.setCost(cost);\n-        }\n-        checkMessage.setLine(textSpan.startLine);\n-        AnalyzerMessage analyzerMessage = new AnalyzerMessage(javaCheck, file, textSpan, message, cost != null ? cost : 0);\n-        for (Location location : secondary) {\n-          AnalyzerMessage secondaryLocation = new AnalyzerMessage(javaCheck, file, textSpanFor(location.syntaxNode), location.msg, 0);\n-          analyzerMessage.secondaryLocations.add(secondaryLocation);\n-        }\n-        checkMessage.setAnalyzerMessage(analyzerMessage);\n-        sourceFile.log(checkMessage);\n-      } else {\n-        addIssue(syntaxNode, javaCheck, message, cost != null ? (double) cost : null);\n+      File file = getFile();\n+      AnalyzerMessage analyzerMessage = new AnalyzerMessage(javaCheck, file, textSpanFor(syntaxNode), message, cost != null ? cost : 0);\n+      for (Location location : secondary) {\n+        AnalyzerMessage secondaryLocation = new AnalyzerMessage(javaCheck, file, textSpanFor(location.syntaxNode), location.msg, 0);\n+        analyzerMessage.secondaryLocations.add(secondaryLocation);\n       }\n+      issues.add(analyzerMessage);\n+      addIssueForCheckMessageVerifier(analyzerMessage.getLine(), javaCheck, message, (double) (cost != null ? cost : 0));","path":"java-squid/src/main/java/org/sonar/java/model/VisitorsBridge.java","position":317,"original_position":317,"commit_id":"9e84af2c0045603758b0096b5cef61b151350356","original_commit_id":"9e84af2c0045603758b0096b5cef61b151350356","user":{"login":"SonarTech","id":1842438,"avatar_url":"https://avatars.githubusercontent.com/u/1842438?v=3","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":"![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) Method 'TestJavaFileScannerContext.addIssueForCheckMessageVerifier(...)' is deprecated. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3ACallToDeprecatedMethod)\n","created_at":"2015-10-07T13:38:53Z","updated_at":"2015-10-07T13:38:53Z","html_url":"https://github.com/SonarSource/sonar-java/pull/430#discussion_r41390483","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments/41390483"},"html":{"href":"https://github.com/SonarSource/sonar-java/pull/430#discussion_r41390483"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430","id":47008162,"html_url":"https://github.com/SonarSource/sonar-java/pull/430","diff_url":"https://github.com/SonarSource/sonar-java/pull/430.diff","patch_url":"https://github.com/SonarSource/sonar-java/pull/430.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/430","number":430,"state":"open","locked":false,"title":"SONARJAVA-1256 Issues should be saved on the go or by file instead of using a project index","user":{"login":"mpaladin","id":456050,"avatar_url":"https://avatars.githubusercontent.com/u/456050?v=3","gravatar_id":"","url":"https://api.github.com/users/mpaladin","html_url":"https://github.com/mpaladin","followers_url":"https://api.github.com/users/mpaladin/followers","following_url":"https://api.github.com/users/mpaladin/following{/other_user}","gists_url":"https://api.github.com/users/mpaladin/gists{/gist_id}","starred_url":"https://api.github.com/users/mpaladin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpaladin/subscriptions","organizations_url":"https://api.github.com/users/mpaladin/orgs","repos_url":"https://api.github.com/users/mpaladin/repos","events_url":"https://api.github.com/users/mpaladin/events{/privacy}","received_events_url":"https://api.github.com/users/mpaladin/received_events","type":"User","site_admin":false},"body":"https://jira.sonarsource.com/browse/SONARJAVA-1256","created_at":"2015-10-07T10:04:32Z","updated_at":"2015-10-07T13:38:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c978004228fd94d0bc77d5e72749ed7ff4c7589a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430/comments","review_comment_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/430/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-java/statuses/9e84af2c0045603758b0096b5cef61b151350356","head":{"label":"SonarSource:SONARJAVA-1256","ref":"SONARJAVA-1256","sha":"9e84af2c0045603758b0096b5cef61b151350356","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.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":5674787,"name":"sonar-java","full_name":"SonarSource/sonar-java","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.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/sonar-java","description":"","fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-java","forks_url":"https://api.github.com/repos/SonarSource/sonar-java/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-java/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-java/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-java/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-java/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-java/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-java/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-java/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-java/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-java/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-java/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-java/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-java/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-java/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-java/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-java/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-java/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-java/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-java/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-java/releases{/id}","created_at":"2012-09-04T15:53:13Z","updated_at":"2015-10-06T10:15:45Z","pushed_at":"2015-10-07T12:36:22Z","git_url":"git://github.com/SonarSource/sonar-java.git","ssh_url":"git@github.com:SonarSource/sonar-java.git","clone_url":"https://github.com/SonarSource/sonar-java.git","svn_url":"https://github.com/SonarSource/sonar-java","homepage":"","size":44581,"stargazers_count":67,"watchers_count":67,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":9,"forks":97,"open_issues":9,"watchers":67,"default_branch":"master"}},"base":{"label":"SonarSource:master","ref":"master","sha":"f79e975fab9de8a9da07a142a8c690e18950a37b","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.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":5674787,"name":"sonar-java","full_name":"SonarSource/sonar-java","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.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/sonar-java","description":"","fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-java","forks_url":"https://api.github.com/repos/SonarSource/sonar-java/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-java/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-java/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-java/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-java/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-java/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-java/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-java/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-java/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-java/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-java/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-java/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-java/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-java/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-java/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-java/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-java/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-java/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-java/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-java/releases{/id}","created_at":"2012-09-04T15:53:13Z","updated_at":"2015-10-06T10:15:45Z","pushed_at":"2015-10-07T12:36:22Z","git_url":"git://github.com/SonarSource/sonar-java.git","ssh_url":"git@github.com:SonarSource/sonar-java.git","clone_url":"https://github.com/SonarSource/sonar-java.git","svn_url":"https://github.com/SonarSource/sonar-java","homepage":"","size":44581,"stargazers_count":67,"watchers_count":67,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":9,"forks":97,"open_issues":9,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430"},"html":{"href":"https://github.com/SonarSource/sonar-java/pull/430"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-java/issues/430"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-java/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-java/statuses/9e84af2c0045603758b0096b5cef61b151350356"}}}}