{"action":"created","comment":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/171822193","pull_request_review_id":100742263,"id":171822193,"diff_hunk":"@@ -0,0 +1,158 @@\n+/// Author: DiffBlue Limited. All Rights Reserved.\n+\n+/// \\file\n+/// Generic-recursion-map entries owner class. Generic-recursion-map maps\n+/// generic parameters to a stack of their types in (every depth of) the\n+/// current scope. This class adds entries to the generic-recursion-map\n+/// for a particular scope, and ensures that they are erased on leaving that\n+/// scope.\n+\n+#include \"generic_recursion_map_keys.h\"\n+\n+\n+/// \\param type Source type\n+/// \\return The vector of implicitly generic and (explicitly) generic type\n+/// parameters of the given type.\n+const std::vector<java_generic_parametert> get_all_generic_parameters\n+  (const typet &type)\n+{\n+  PRECONDITION(is_java_generic_class_type(type) ||\n+               is_java_implicitly_generic_class_type(type));\n+  std::vector<java_generic_parametert> generic_parameters;\n+  if(is_java_implicitly_generic_class_type(type))\n+  {\n+    const java_implicitly_generic_class_typet &implicitly_generic_class =\n+      to_java_implicitly_generic_class_type(\n+        to_java_class_type(type));\n+    generic_parameters.insert(\n+      generic_parameters.end(),\n+      implicitly_generic_class.implicit_generic_types().begin(),\n+      implicitly_generic_class.implicit_generic_types().end());\n+  }\n+  if(is_java_generic_class_type(type))\n+  {\n+    const java_generic_class_typet &generic_class =\n+      to_java_generic_class_type(to_java_class_type(type));\n+    generic_parameters.insert(\n+      generic_parameters.end(),\n+      generic_class.generic_types().begin(),\n+      generic_class.generic_types().end());\n+  }\n+  return generic_parameters;\n+}\n+\n+/// Creates a vector of pairs to be processed by function insert_pairs.\n+/// \\param parameters generic parameters that are the keys of the pairs to add\n+/// \\param types a type to add for each parameter\n+/// \\return a vector of pairs of a parameter and the corresponding type\n+const std::vector<std::pair<java_generic_parametert, reference_typet>>\n+pair_up(\n+  const std::vector<java_generic_parametert> &parameters,\n+  const std::vector<reference_typet> &types)\n+{\n+  PRECONDITION(!parameters.empty() && (parameters.size() == types.size()));","path":"src/java_bytecode/generic_recursion_map_keys.cpp","position":53,"original_position":53,"commit_id":"fb5f99f81e656ce2ee6d61979e4f4a323c463ea7","original_commit_id":"fb5f99f81e656ce2ee6d61979e4f4a323c463ea7","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":"While I agree parameters being empty seems odd, not really a pre-req for this function (in can pair up two empty lists into an empty list of pairs) might not be useful now but in some circumstances might make using this utility more complicated. \r\n\r\nYou might consider pulling this into a totally templated function in util to pair arbitary vectors in to a vector of pairs,\r\n but no need to do this as part of this PR.","created_at":"2018-03-02T11:15:33Z","updated_at":"2018-03-02T11:39:53Z","html_url":"https://github.com/diffblue/cbmc/pull/1877#discussion_r171822193","pull_request_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1877","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/171822193"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1877#discussion_r171822193"},"pull_request":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1877"}}},"pull_request":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/1877","id":170824019,"html_url":"https://github.com/diffblue/cbmc/pull/1877","diff_url":"https://github.com/diffblue/cbmc/pull/1877.diff","patch_url":"https://github.com/diffblue/cbmc/pull/1877.patch","issue_url":"https://api.github.com/repos/diffblue/cbmc/issues/1877","number":1877,"state":"open","locked":false,"title":"[TG-1419] Specialization of generics ","user":{"login":"svorenova","id":19727952,"avatar_url":"https://avatars0.githubusercontent.com/u/19727952?v=4","gravatar_id":"","url":"https://api.github.com/users/svorenova","html_url":"https://github.com/svorenova","followers_url":"https://api.github.com/users/svorenova/followers","following_url":"https://api.github.com/users/svorenova/following{/other_user}","gists_url":"https://api.github.com/users/svorenova/gists{/gist_id}","starred_url":"https://api.github.com/users/svorenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svorenova/subscriptions","organizations_url":"https://api.github.com/users/svorenova/orgs","repos_url":"https://api.github.com/users/svorenova/repos","events_url":"https://api.github.com/users/svorenova/events{/privacy}","received_events_url":"https://api.github.com/users/svorenova/received_events","type":"User","site_admin":false},"body":"This re-implements the specialization of generics - instead of creating new symbols in the symbol table for a specialized generic type, we usep a map of pairs: generic parameter -> stack of types, to keep track of the concrete type of parameters in each context (and context depth). Moreover, the implementation also works with generic superclasses and interfaces, which was not the case in the old version. ","created_at":"2018-02-22T18:02:32Z","updated_at":"2018-03-02T11:39:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5026b7f252843b59e8861c736534366b7e372b12","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":"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},{"login":"peterschrammel","id":4222448,"avatar_url":"https://avatars3.githubusercontent.com/u/4222448?v=4","gravatar_id":"","url":"https://api.github.com/users/peterschrammel","html_url":"https://github.com/peterschrammel","followers_url":"https://api.github.com/users/peterschrammel/followers","following_url":"https://api.github.com/users/peterschrammel/following{/other_user}","gists_url":"https://api.github.com/users/peterschrammel/gists{/gist_id}","starred_url":"https://api.github.com/users/peterschrammel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterschrammel/subscriptions","organizations_url":"https://api.github.com/users/peterschrammel/orgs","repos_url":"https://api.github.com/users/peterschrammel/repos","events_url":"https://api.github.com/users/peterschrammel/events{/privacy}","received_events_url":"https://api.github.com/users/peterschrammel/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1877/commits","review_comments_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1877/comments","review_comment_url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diffblue/cbmc/issues/1877/comments","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/fb5f99f81e656ce2ee6d61979e4f4a323c463ea7","head":{"label":"svorenova:specialized_generics_tg1419","ref":"specialized_generics_tg1419","sha":"fb5f99f81e656ce2ee6d61979e4f4a323c463ea7","user":{"login":"svorenova","id":19727952,"avatar_url":"https://avatars0.githubusercontent.com/u/19727952?v=4","gravatar_id":"","url":"https://api.github.com/users/svorenova","html_url":"https://github.com/svorenova","followers_url":"https://api.github.com/users/svorenova/followers","following_url":"https://api.github.com/users/svorenova/following{/other_user}","gists_url":"https://api.github.com/users/svorenova/gists{/gist_id}","starred_url":"https://api.github.com/users/svorenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svorenova/subscriptions","organizations_url":"https://api.github.com/users/svorenova/orgs","repos_url":"https://api.github.com/users/svorenova/repos","events_url":"https://api.github.com/users/svorenova/events{/privacy}","received_events_url":"https://api.github.com/users/svorenova/received_events","type":"User","site_admin":false},"repo":{"id":105542095,"name":"cbmc","full_name":"svorenova/cbmc","owner":{"login":"svorenova","id":19727952,"avatar_url":"https://avatars0.githubusercontent.com/u/19727952?v=4","gravatar_id":"","url":"https://api.github.com/users/svorenova","html_url":"https://github.com/svorenova","followers_url":"https://api.github.com/users/svorenova/followers","following_url":"https://api.github.com/users/svorenova/following{/other_user}","gists_url":"https://api.github.com/users/svorenova/gists{/gist_id}","starred_url":"https://api.github.com/users/svorenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svorenova/subscriptions","organizations_url":"https://api.github.com/users/svorenova/orgs","repos_url":"https://api.github.com/users/svorenova/repos","events_url":"https://api.github.com/users/svorenova/events{/privacy}","received_events_url":"https://api.github.com/users/svorenova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svorenova/cbmc","description":"C Bounded Model Checker","fork":true,"url":"https://api.github.com/repos/svorenova/cbmc","forks_url":"https://api.github.com/repos/svorenova/cbmc/forks","keys_url":"https://api.github.com/repos/svorenova/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svorenova/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svorenova/cbmc/teams","hooks_url":"https://api.github.com/repos/svorenova/cbmc/hooks","issue_events_url":"https://api.github.com/repos/svorenova/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/svorenova/cbmc/events","assignees_url":"https://api.github.com/repos/svorenova/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/svorenova/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/svorenova/cbmc/tags","blobs_url":"https://api.github.com/repos/svorenova/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svorenova/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svorenova/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/svorenova/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svorenova/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/svorenova/cbmc/languages","stargazers_url":"https://api.github.com/repos/svorenova/cbmc/stargazers","contributors_url":"https://api.github.com/repos/svorenova/cbmc/contributors","subscribers_url":"https://api.github.com/repos/svorenova/cbmc/subscribers","subscription_url":"https://api.github.com/repos/svorenova/cbmc/subscription","commits_url":"https://api.github.com/repos/svorenova/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/svorenova/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/svorenova/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/svorenova/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/svorenova/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/svorenova/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svorenova/cbmc/merges","archive_url":"https://api.github.com/repos/svorenova/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svorenova/cbmc/downloads","issues_url":"https://api.github.com/repos/svorenova/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/svorenova/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/svorenova/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/svorenova/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svorenova/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/svorenova/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/svorenova/cbmc/deployments","created_at":"2017-10-02T14:09:39Z","updated_at":"2017-10-02T14:09:48Z","pushed_at":"2018-03-02T10:28:45Z","git_url":"git://github.com/svorenova/cbmc.git","ssh_url":"git@github.com:svorenova/cbmc.git","clone_url":"https://github.com/svorenova/cbmc.git","svn_url":"https://github.com/svorenova/cbmc","homepage":"http://www.cprover.org/cbmc","size":27760,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"diffblue:develop","ref":"develop","sha":"1a884793125d00c0ceca9c89b33dc6bb66980be5","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-26T12:21:45Z","pushed_at":"2018-03-02T11:27:16Z","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":28546,"stargazers_count":102,"watchers_count":102,"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":319,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":88,"open_issues":319,"watchers":102,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1877"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1877"},"issue":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1877"},"comments":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1877/comments"},"review_comments":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1877/comments"},"review_comment":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1877/commits"},"statuses":{"href":"https://api.github.com/repos/diffblue/cbmc/statuses/fb5f99f81e656ce2ee6d61979e4f4a323c463ea7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"thk123"}}