{"action":"created","comment":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/168131932","pull_request_review_id":96446803,"id":168131932,"diff_hunk":"@@ -457,7 +457,8 @@ static void create_stub_global_symbols(\n             component,\n             \"java::\" + id2string(parse_tree.parsed_class.name),\n             symbol_table,\n-            class_hierarchy);\n+            class_hierarchy,\n+            true);","path":"src/java_bytecode/java_bytecode_language.cpp","position":null,"original_position":6,"commit_id":"d83a034326d2fd4ee72d2ff4c2bc817c8e73cc66","original_commit_id":"82a03cb1840590595fc20d5d8698051dff64d721","user":{"login":"thk123","id":638608,"avatar_url":"https://avatars3.githubusercontent.com/u/638608?v=4","gravatar_id":"","url":"https://api.github.com/users/thk123","html_url":"https://github.com/thk123","followers_url":"https://api.github.com/users/thk123/followers","following_url":"https://api.github.com/users/thk123/following{/other_user}","gists_url":"https://api.github.com/users/thk123/gists{/gist_id}","starred_url":"https://api.github.com/users/thk123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thk123/subscriptions","organizations_url":"https://api.github.com/users/thk123/orgs","repos_url":"https://api.github.com/users/thk123/repos","events_url":"https://api.github.com/users/thk123/events{/privacy}","received_events_url":"https://api.github.com/users/thk123/received_events","type":"User","site_admin":false},"body":"Apparently default methods are actually in Java 8, but I guess this won't be the only problem with them!","created_at":"2018-02-14T10:24:29Z","updated_at":"2018-02-14T10:24:29Z","html_url":"https://github.com/diffblue/cbmc/pull/1826#discussion_r168131932","pull_request_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1826","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/168131932"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1826#discussion_r168131932"},"pull_request":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1826"}},"in_reply_to_id":167872806},"pull_request":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/1826","id":168658446,"html_url":"https://github.com/diffblue/cbmc/pull/1826","diff_url":"https://github.com/diffblue/cbmc/pull/1826.diff","patch_url":"https://github.com/diffblue/cbmc/pull/1826.patch","issue_url":"https://api.github.com/repos/diffblue/cbmc/issues/1826","number":1826,"state":"open","locked":false,"title":"Add support for inheritence of Java static fields. Fixes TG-2457","user":{"login":"smowton","id":283483,"avatar_url":"https://avatars3.githubusercontent.com/u/283483?v=4","gravatar_id":"","url":"https://api.github.com/users/smowton","html_url":"https://github.com/smowton","followers_url":"https://api.github.com/users/smowton/followers","following_url":"https://api.github.com/users/smowton/following{/other_user}","gists_url":"https://api.github.com/users/smowton/gists{/gist_id}","starred_url":"https://api.github.com/users/smowton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smowton/subscriptions","organizations_url":"https://api.github.com/users/smowton/orgs","repos_url":"https://api.github.com/users/smowton/repos","events_url":"https://api.github.com/users/smowton/events{/privacy}","received_events_url":"https://api.github.com/users/smowton/received_events","type":"User","site_admin":false},"body":"Up until now, the Java frontend ignored that a static field reference (e.g. `A.x`) in Java bytecode may refer to a static field belonging to any parent class or interface. This had gone un-noticed for a while, but recently came to a head because we had been creating a stub (nondet) symbol for the apparently-dangling reference to `A.x`, and my recent PR https://github.com/diffblue/cbmc/pull/1781, which moved stub static field initialisation into `clinit` routines, included an invariant that the class a stub field was attached to **must** itself be a stub (unavailable). In this case if the class `A` is concrete the invariant failed, exposing the latent bug that we had never been resolving static fields correctly.\r\n\r\nThis PR addresses the underlying bug by adapting our existing find-inherited-method machinery to handle finding inherited fields, and uses it both during stub global creation and when translating `getstatic` and `putstatic` bytecodes to find the correct static field symbol. When a static field cannot be resolved a stub is created, attached to an **arbitrary** stub class that is a parent of the type referred to. I believe in general we can't do better than that, as even if two types A and B are related somehow, and we see references to A.z and B.z somewhere in the code, we cannot determine whether those are inherited, or two different private/protected/default access static fields.\r\n\r\nI recommend reviewing commit-by-commit, as the series starts with a couple of moves to share some existing code, which account for most of the diff.","created_at":"2018-02-12T18:48:38Z","updated_at":"2018-02-14T10:24:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9b5fba849f30ea315dcb6d67045e8cf94d52b7d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"cesaro","id":143977,"avatar_url":"https://avatars1.githubusercontent.com/u/143977?v=4","gravatar_id":"","url":"https://api.github.com/users/cesaro","html_url":"https://github.com/cesaro","followers_url":"https://api.github.com/users/cesaro/followers","following_url":"https://api.github.com/users/cesaro/following{/other_user}","gists_url":"https://api.github.com/users/cesaro/gists{/gist_id}","starred_url":"https://api.github.com/users/cesaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesaro/subscriptions","organizations_url":"https://api.github.com/users/cesaro/orgs","repos_url":"https://api.github.com/users/cesaro/repos","events_url":"https://api.github.com/users/cesaro/events{/privacy}","received_events_url":"https://api.github.com/users/cesaro/received_events","type":"User","site_admin":false},{"login":"tautschnig","id":1144736,"avatar_url":"https://avatars3.githubusercontent.com/u/1144736?v=4","gravatar_id":"","url":"https://api.github.com/users/tautschnig","html_url":"https://github.com/tautschnig","followers_url":"https://api.github.com/users/tautschnig/followers","following_url":"https://api.github.com/users/tautschnig/following{/other_user}","gists_url":"https://api.github.com/users/tautschnig/gists{/gist_id}","starred_url":"https://api.github.com/users/tautschnig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tautschnig/subscriptions","organizations_url":"https://api.github.com/users/tautschnig/orgs","repos_url":"https://api.github.com/users/tautschnig/repos","events_url":"https://api.github.com/users/tautschnig/events{/privacy}","received_events_url":"https://api.github.com/users/tautschnig/received_events","type":"User","site_admin":false},{"login":"kroening","id":1830565,"avatar_url":"https://avatars0.githubusercontent.com/u/1830565?v=4","gravatar_id":"","url":"https://api.github.com/users/kroening","html_url":"https://github.com/kroening","followers_url":"https://api.github.com/users/kroening/followers","following_url":"https://api.github.com/users/kroening/following{/other_user}","gists_url":"https://api.github.com/users/kroening/gists{/gist_id}","starred_url":"https://api.github.com/users/kroening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroening/subscriptions","organizations_url":"https://api.github.com/users/kroening/orgs","repos_url":"https://api.github.com/users/kroening/repos","events_url":"https://api.github.com/users/kroening/events{/privacy}","received_events_url":"https://api.github.com/users/kroening/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1826/commits","review_comments_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1826/comments","review_comment_url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diffblue/cbmc/issues/1826/comments","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/d83a034326d2fd4ee72d2ff4c2bc817c8e73cc66","head":{"label":"smowton:smowton/fix/java-inherited-static-fields","ref":"smowton/fix/java-inherited-static-fields","sha":"d83a034326d2fd4ee72d2ff4c2bc817c8e73cc66","user":{"login":"smowton","id":283483,"avatar_url":"https://avatars3.githubusercontent.com/u/283483?v=4","gravatar_id":"","url":"https://api.github.com/users/smowton","html_url":"https://github.com/smowton","followers_url":"https://api.github.com/users/smowton/followers","following_url":"https://api.github.com/users/smowton/following{/other_user}","gists_url":"https://api.github.com/users/smowton/gists{/gist_id}","starred_url":"https://api.github.com/users/smowton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smowton/subscriptions","organizations_url":"https://api.github.com/users/smowton/orgs","repos_url":"https://api.github.com/users/smowton/repos","events_url":"https://api.github.com/users/smowton/events{/privacy}","received_events_url":"https://api.github.com/users/smowton/received_events","type":"User","site_admin":false},"repo":{"id":75178953,"name":"cbmc","full_name":"smowton/cbmc","owner":{"login":"smowton","id":283483,"avatar_url":"https://avatars3.githubusercontent.com/u/283483?v=4","gravatar_id":"","url":"https://api.github.com/users/smowton","html_url":"https://github.com/smowton","followers_url":"https://api.github.com/users/smowton/followers","following_url":"https://api.github.com/users/smowton/following{/other_user}","gists_url":"https://api.github.com/users/smowton/gists{/gist_id}","starred_url":"https://api.github.com/users/smowton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smowton/subscriptions","organizations_url":"https://api.github.com/users/smowton/orgs","repos_url":"https://api.github.com/users/smowton/repos","events_url":"https://api.github.com/users/smowton/events{/privacy}","received_events_url":"https://api.github.com/users/smowton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smowton/cbmc","description":"C Bounded Model Checker","fork":true,"url":"https://api.github.com/repos/smowton/cbmc","forks_url":"https://api.github.com/repos/smowton/cbmc/forks","keys_url":"https://api.github.com/repos/smowton/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smowton/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smowton/cbmc/teams","hooks_url":"https://api.github.com/repos/smowton/cbmc/hooks","issue_events_url":"https://api.github.com/repos/smowton/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/smowton/cbmc/events","assignees_url":"https://api.github.com/repos/smowton/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/smowton/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/smowton/cbmc/tags","blobs_url":"https://api.github.com/repos/smowton/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smowton/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smowton/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/smowton/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smowton/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/smowton/cbmc/languages","stargazers_url":"https://api.github.com/repos/smowton/cbmc/stargazers","contributors_url":"https://api.github.com/repos/smowton/cbmc/contributors","subscribers_url":"https://api.github.com/repos/smowton/cbmc/subscribers","subscription_url":"https://api.github.com/repos/smowton/cbmc/subscription","commits_url":"https://api.github.com/repos/smowton/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/smowton/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/smowton/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/smowton/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/smowton/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/smowton/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smowton/cbmc/merges","archive_url":"https://api.github.com/repos/smowton/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smowton/cbmc/downloads","issues_url":"https://api.github.com/repos/smowton/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/smowton/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/smowton/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/smowton/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smowton/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/smowton/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/smowton/cbmc/deployments","created_at":"2016-11-30T11:02:38Z","updated_at":"2016-11-30T11:02:46Z","pushed_at":"2018-02-14T08:07:51Z","git_url":"git://github.com/smowton/cbmc.git","ssh_url":"git@github.com:smowton/cbmc.git","clone_url":"https://github.com/smowton/cbmc.git","svn_url":"https://github.com/smowton/cbmc","homepage":"http://www.cprover.org/cbmc","size":33492,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"diffblue:develop","ref":"develop","sha":"678218a61bfefaa088ecc8021d9091191cbd6a7f","user":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars0.githubusercontent.com/u/17216098?v=4","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"repo":{"id":51877056,"name":"cbmc","full_name":"diffblue/cbmc","owner":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars0.githubusercontent.com/u/17216098?v=4","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diffblue/cbmc","description":"C Bounded Model Checker","fork":false,"url":"https://api.github.com/repos/diffblue/cbmc","forks_url":"https://api.github.com/repos/diffblue/cbmc/forks","keys_url":"https://api.github.com/repos/diffblue/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diffblue/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diffblue/cbmc/teams","hooks_url":"https://api.github.com/repos/diffblue/cbmc/hooks","issue_events_url":"https://api.github.com/repos/diffblue/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/diffblue/cbmc/events","assignees_url":"https://api.github.com/repos/diffblue/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/diffblue/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/diffblue/cbmc/tags","blobs_url":"https://api.github.com/repos/diffblue/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diffblue/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diffblue/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/diffblue/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/diffblue/cbmc/languages","stargazers_url":"https://api.github.com/repos/diffblue/cbmc/stargazers","contributors_url":"https://api.github.com/repos/diffblue/cbmc/contributors","subscribers_url":"https://api.github.com/repos/diffblue/cbmc/subscribers","subscription_url":"https://api.github.com/repos/diffblue/cbmc/subscription","commits_url":"https://api.github.com/repos/diffblue/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/diffblue/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/diffblue/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/diffblue/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/diffblue/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/diffblue/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diffblue/cbmc/merges","archive_url":"https://api.github.com/repos/diffblue/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diffblue/cbmc/downloads","issues_url":"https://api.github.com/repos/diffblue/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/diffblue/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/diffblue/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/diffblue/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diffblue/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/diffblue/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/diffblue/cbmc/deployments","created_at":"2016-02-16T23:03:52Z","updated_at":"2018-02-06T19:52:55Z","pushed_at":"2018-02-14T10:22:33Z","git_url":"git://github.com/diffblue/cbmc.git","ssh_url":"git@github.com:diffblue/cbmc.git","clone_url":"https://github.com/diffblue/cbmc.git","svn_url":"https://github.com/diffblue/cbmc","homepage":"http://www.cprover.org/cbmc","size":27964,"stargazers_count":96,"watchers_count":96,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":88,"mirror_url":null,"archived":false,"open_issues_count":322,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":88,"open_issues":322,"watchers":96,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1826"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1826"},"issue":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1826"},"comments":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1826/comments"},"review_comments":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1826/comments"},"review_comment":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1826/commits"},"statuses":{"href":"https://api.github.com/repos/diffblue/cbmc/statuses/d83a034326d2fd4ee72d2ff4c2bc817c8e73cc66"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"thk123"}}