{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments/49568803","id":49568803,"diff_hunk":"@@ -0,0 +1,100 @@\n+/*\n+ * SonarQube Java\n+ * Copyright (C) 2012-2016 SonarSource SA\n+ * mailto:contact AT sonarsource DOT com\n+ *\n+ * This program is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU Lesser General Public\n+ * License as published by the Free Software Foundation; either\n+ * version 3 of the License, or (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+ * Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with this program; if not, write to the Free Software Foundation,\n+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+ */\n+package org.sonar.java.se;\n+\n+import javax.annotation.Nullable;\n+\n+import java.util.ArrayList;\n+import java.util.Collection;\n+\n+public abstract class SymbolicValueRelation {\n+\n+  protected final SymbolicValue v1;\n+  protected final SymbolicValue v2;\n+\n+  protected SymbolicValueRelation(SymbolicValue v1, SymbolicValue v2) {\n+    this.v1 = v1;\n+    this.v2 = v2;\n+  }\n+\n+  public Boolean impliedBy(Collection<SymbolicValueRelation> knownRelations) {\n+    Boolean result = null;\n+    for (SymbolicValueRelation relation : knownRelations) {\n+      result = isImpliedBy(relation);\n+      if (result != null) {\n+        return result;\n+      }\n+    }\n+    for (SymbolicValueRelation relation : knownRelations) {\n+      SymbolicValueRelation combined = underHypothesis(relation);\n+      if (combined != null) {\n+        final ArrayList<SymbolicValueRelation> relations = new ArrayList<>(knownRelations);\n+        relations.remove(relation);\n+        result = combined.impliedBy(relations);\n+        if (result != null) {\n+          return result;\n+        }\n+      }\n+    }\n+    return null;","path":"java-squid/src/main/java/org/sonar/java/se/SymbolicValueRelation.java","position":56,"original_position":56,"commit_id":"b32afbc4337f8cfb4f4b336aa23c37c900ce2ee6","original_commit_id":"b32afbc4337f8cfb4f4b336aa23c37c900ce2ee6","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":"![CRITICAL](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-critical.png) Null is returned but a \"Boolean\" is expected. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://dory.sonarsource.com/coding_rules#rule_key=squid%3AS2447)\n","created_at":"2016-01-13T09:44:39Z","updated_at":"2016-01-13T09:44:39Z","html_url":"https://github.com/SonarSource/sonar-java/pull/583#discussion_r49568803","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/comments/49568803"},"html":{"href":"https://github.com/SonarSource/sonar-java/pull/583#discussion_r49568803"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583","id":55314304,"html_url":"https://github.com/SonarSource/sonar-java/pull/583","diff_url":"https://github.com/SonarSource/sonar-java/pull/583.diff","patch_url":"https://github.com/SonarSource/sonar-java/pull/583.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-java/issues/583","number":583,"state":"open","locked":false,"title":"SONARJAVA-1452 - Handle simple and transitive equality between symbolic values","user":{"login":"DidierBesset","id":14869932,"avatar_url":"https://avatars.githubusercontent.com/u/14869932?v=3","gravatar_id":"","url":"https://api.github.com/users/DidierBesset","html_url":"https://github.com/DidierBesset","followers_url":"https://api.github.com/users/DidierBesset/followers","following_url":"https://api.github.com/users/DidierBesset/following{/other_user}","gists_url":"https://api.github.com/users/DidierBesset/gists{/gist_id}","starred_url":"https://api.github.com/users/DidierBesset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DidierBesset/subscriptions","organizations_url":"https://api.github.com/users/DidierBesset/orgs","repos_url":"https://api.github.com/users/DidierBesset/repos","events_url":"https://api.github.com/users/DidierBesset/events{/privacy}","received_events_url":"https://api.github.com/users/DidierBesset/received_events","type":"User","site_admin":false},"body":"Supersedes PR SONARJAVA-1451 because it includes the refactoring for it.","created_at":"2016-01-07T09:05:26Z","updated_at":"2016-01-13T09:44:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f38564ec2980aed77923fe045666b69242987077","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583/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/583/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-java/statuses/b32afbc4337f8cfb4f4b336aa23c37c900ce2ee6","head":{"label":"SonarSource:SONARJAVA-1452","ref":"SONARJAVA-1452","sha":"b32afbc4337f8cfb4f4b336aa23c37c900ce2ee6","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":"2016-01-11T14:02:04Z","pushed_at":"2016-01-13T09:40:26Z","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":25159,"stargazers_count":77,"watchers_count":77,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":108,"mirror_url":null,"open_issues_count":8,"forks":108,"open_issues":8,"watchers":77,"default_branch":"master"}},"base":{"label":"SonarSource:master","ref":"master","sha":"0a236a579009d6cb162db45cb086c30c34ccc0b5","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":"2016-01-11T14:02:04Z","pushed_at":"2016-01-13T09:40:26Z","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":25159,"stargazers_count":77,"watchers_count":77,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":108,"mirror_url":null,"open_issues_count":8,"forks":108,"open_issues":8,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583"},"html":{"href":"https://github.com/SonarSource/sonar-java/pull/583"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-java/issues/583"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-java/issues/583/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-java/pulls/583/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/583/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-java/statuses/b32afbc4337f8cfb4f4b336aa23c37c900ce2ee6"}}}}