{"action":"created","comment":{"url":"https://api.github.com/repos/typetools/checker-framework/pulls/comments/209459116","pull_request_review_id":145478334,"id":209459116,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTQ1OTExNg==","diff_hunk":"@@ -158,21 +153,102 @@ private static Pattern anchored(String regex) {\n     }\n \n     private static boolean isMemberSelect(String s, FlowExpressionContext context) {\n-        return parseMemberSelect(s) != null;\n+        return parseMemberSelect(s, context) != null;\n+    }\n+\n+    /**\n+     * Matches field accesses whose receiver is a method call expression. First of returned pair is\n+     * a method call expression and the second is a field or method call expression.\n+     *\n+     * @param sWithFormalParamNames expression string with replaced occurences of one-based","path":"framework/src/main/java/org/checkerframework/framework/util/FlowExpressionParseUtil.java","position":71,"original_position":71,"commit_id":"ec728d3b070a5578c655b1ecc029154bc76b63b1","original_commit_id":"ec728d3b070a5578c655b1ecc029154bc76b63b1","user":{"login":"mernst","id":121025,"node_id":"MDQ6VXNlcjEyMTAyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/121025?v=4","gravatar_id":"","url":"https://api.github.com/users/mernst","html_url":"https://github.com/mernst","followers_url":"https://api.github.com/users/mernst/followers","following_url":"https://api.github.com/users/mernst/following{/other_user}","gists_url":"https://api.github.com/users/mernst/gists{/gist_id}","starred_url":"https://api.github.com/users/mernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mernst/subscriptions","organizations_url":"https://api.github.com/users/mernst/orgs","repos_url":"https://api.github.com/users/mernst/repos","events_url":"https://api.github.com/users/mernst/events{/privacy}","received_events_url":"https://api.github.com/users/mernst/received_events","type":"User","site_admin":false},"body":"Choose argument names based on semantics, not on types.\r\nWhen an argument is a string, `expr` is a better variable name than `s` (for \"string\").","created_at":"2018-08-12T15:29:48Z","updated_at":"2018-08-12T15:48:58Z","html_url":"https://github.com/typetools/checker-framework/pull/2062#discussion_r209459116","pull_request_url":"https://api.github.com/repos/typetools/checker-framework/pulls/2062","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/comments/209459116"},"html":{"href":"https://github.com/typetools/checker-framework/pull/2062#discussion_r209459116"},"pull_request":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/2062"}}},"pull_request":{"url":"https://api.github.com/repos/typetools/checker-framework/pulls/2062","id":198934101,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTM0MTAx","html_url":"https://github.com/typetools/checker-framework/pull/2062","diff_url":"https://github.com/typetools/checker-framework/pull/2062.diff","patch_url":"https://github.com/typetools/checker-framework/pull/2062.patch","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/2062","number":2062,"state":"open","locked":false,"title":"Replacement of the flow expression parser with calls to Java Parser","user":{"login":"KankshaZ","id":32203941,"node_id":"MDQ6VXNlcjMyMjAzOTQx","avatar_url":"https://avatars2.githubusercontent.com/u/32203941?v=4","gravatar_id":"","url":"https://api.github.com/users/KankshaZ","html_url":"https://github.com/KankshaZ","followers_url":"https://api.github.com/users/KankshaZ/followers","following_url":"https://api.github.com/users/KankshaZ/following{/other_user}","gists_url":"https://api.github.com/users/KankshaZ/gists{/gist_id}","starred_url":"https://api.github.com/users/KankshaZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KankshaZ/subscriptions","organizations_url":"https://api.github.com/users/KankshaZ/orgs","repos_url":"https://api.github.com/users/KankshaZ/repos","events_url":"https://api.github.com/users/KankshaZ/events{/privacy}","received_events_url":"https://api.github.com/users/KankshaZ/received_events","type":"User","site_admin":false},"body":"# Replacement of the flow expression parser with calls to Java Parser [#1614](https://github.com/typetools/checker-framework/issues/1614)\r\nThe CheckerFramework uses Regex to parse expressions/arguments given to Annotations. To make it more generalizable and robust, the current flow expression parser is replaced by calls to the JavaParser. The JavaParser's quick API is used where static methods parse fragments of source code which are Strings. \r\n\r\n### Changes\r\nIn the current [FlowExpressionParseUtil.java](https://github.com/KankshaZ/checker-framework/blob/master/framework/src/main/java/org/checkerframework/framework/util/FlowExpressionParseUtil.java#L483) file of the Checker Framework, the following patterns have been created from regular expressions\r\n- unanchoredParameterPattern\r\n- parameterPattern\r\n- identifierPattern\r\n- intPattern\r\n- longPattern\r\n- stringPattern\r\n- parenthesisPattern\r\n- memberSelectOfStringPattern\r\n- pattern for indentParser\r\n\r\nThese patterns are used to identify the type of Java Expression. Patterns also help to group to extract other information like receivers or names.\r\n\r\nIn the modified [FlowExpressionParseUtil.java](https://github.com/KankshaZ/checker-framework/blob/ReplaceFlowExpressionParser/framework/src/main/java/org/checkerframework/framework/util/FlowExpressionParseUtil.java) file, indentification of the type of expression is done by extracting the class obtained after parsing expressions using the JavaParser. Information like name, arguments, and scope, is now extracted from the expression parsed by the JavaParser as well. This is how regular expressions used for matching have been replaced with calls to the JavaParser. \r\n\r\nReplacement of unanchoredParameterPattern and parameterPattern is not done since they are non-standard Java Expressions. Occurences of parameters are replaced by arguments, and then replaced back before the expression is finally returned.","created_at":"2018-07-03T11:35:24Z","updated_at":"2018-08-12T15:48:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4da6b1e642cb4a00d9f4655bb519dab2e611c72b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/typetools/checker-framework/pulls/2062/commits","review_comments_url":"https://api.github.com/repos/typetools/checker-framework/pulls/2062/comments","review_comment_url":"https://api.github.com/repos/typetools/checker-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/2062/comments","statuses_url":"https://api.github.com/repos/typetools/checker-framework/statuses/ec728d3b070a5578c655b1ecc029154bc76b63b1","head":{"label":"KankshaZ:ReplaceFlowExpressionParser","ref":"ReplaceFlowExpressionParser","sha":"ec728d3b070a5578c655b1ecc029154bc76b63b1","user":{"login":"KankshaZ","id":32203941,"node_id":"MDQ6VXNlcjMyMjAzOTQx","avatar_url":"https://avatars2.githubusercontent.com/u/32203941?v=4","gravatar_id":"","url":"https://api.github.com/users/KankshaZ","html_url":"https://github.com/KankshaZ","followers_url":"https://api.github.com/users/KankshaZ/followers","following_url":"https://api.github.com/users/KankshaZ/following{/other_user}","gists_url":"https://api.github.com/users/KankshaZ/gists{/gist_id}","starred_url":"https://api.github.com/users/KankshaZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KankshaZ/subscriptions","organizations_url":"https://api.github.com/users/KankshaZ/orgs","repos_url":"https://api.github.com/users/KankshaZ/repos","events_url":"https://api.github.com/users/KankshaZ/events{/privacy}","received_events_url":"https://api.github.com/users/KankshaZ/received_events","type":"User","site_admin":false},"repo":{"id":135566967,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU1NjY5Njc=","name":"checker-framework","full_name":"KankshaZ/checker-framework","owner":{"login":"KankshaZ","id":32203941,"node_id":"MDQ6VXNlcjMyMjAzOTQx","avatar_url":"https://avatars2.githubusercontent.com/u/32203941?v=4","gravatar_id":"","url":"https://api.github.com/users/KankshaZ","html_url":"https://github.com/KankshaZ","followers_url":"https://api.github.com/users/KankshaZ/followers","following_url":"https://api.github.com/users/KankshaZ/following{/other_user}","gists_url":"https://api.github.com/users/KankshaZ/gists{/gist_id}","starred_url":"https://api.github.com/users/KankshaZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KankshaZ/subscriptions","organizations_url":"https://api.github.com/users/KankshaZ/orgs","repos_url":"https://api.github.com/users/KankshaZ/repos","events_url":"https://api.github.com/users/KankshaZ/events{/privacy}","received_events_url":"https://api.github.com/users/KankshaZ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KankshaZ/checker-framework","description":"Pluggable type-checking for Java","fork":true,"url":"https://api.github.com/repos/KankshaZ/checker-framework","forks_url":"https://api.github.com/repos/KankshaZ/checker-framework/forks","keys_url":"https://api.github.com/repos/KankshaZ/checker-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KankshaZ/checker-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KankshaZ/checker-framework/teams","hooks_url":"https://api.github.com/repos/KankshaZ/checker-framework/hooks","issue_events_url":"https://api.github.com/repos/KankshaZ/checker-framework/issues/events{/number}","events_url":"https://api.github.com/repos/KankshaZ/checker-framework/events","assignees_url":"https://api.github.com/repos/KankshaZ/checker-framework/assignees{/user}","branches_url":"https://api.github.com/repos/KankshaZ/checker-framework/branches{/branch}","tags_url":"https://api.github.com/repos/KankshaZ/checker-framework/tags","blobs_url":"https://api.github.com/repos/KankshaZ/checker-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KankshaZ/checker-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KankshaZ/checker-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/KankshaZ/checker-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KankshaZ/checker-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/KankshaZ/checker-framework/languages","stargazers_url":"https://api.github.com/repos/KankshaZ/checker-framework/stargazers","contributors_url":"https://api.github.com/repos/KankshaZ/checker-framework/contributors","subscribers_url":"https://api.github.com/repos/KankshaZ/checker-framework/subscribers","subscription_url":"https://api.github.com/repos/KankshaZ/checker-framework/subscription","commits_url":"https://api.github.com/repos/KankshaZ/checker-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/KankshaZ/checker-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/KankshaZ/checker-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/KankshaZ/checker-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/KankshaZ/checker-framework/contents/{+path}","compare_url":"https://api.github.com/repos/KankshaZ/checker-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KankshaZ/checker-framework/merges","archive_url":"https://api.github.com/repos/KankshaZ/checker-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KankshaZ/checker-framework/downloads","issues_url":"https://api.github.com/repos/KankshaZ/checker-framework/issues{/number}","pulls_url":"https://api.github.com/repos/KankshaZ/checker-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/KankshaZ/checker-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/KankshaZ/checker-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KankshaZ/checker-framework/labels{/name}","releases_url":"https://api.github.com/repos/KankshaZ/checker-framework/releases{/id}","deployments_url":"https://api.github.com/repos/KankshaZ/checker-framework/deployments","created_at":"2018-05-31T10:07:16Z","updated_at":"2018-08-12T06:03:29Z","pushed_at":"2018-08-12T15:18:41Z","git_url":"git://github.com/KankshaZ/checker-framework.git","ssh_url":"git@github.com:KankshaZ/checker-framework.git","clone_url":"https://github.com/KankshaZ/checker-framework.git","svn_url":"https://github.com/KankshaZ/checker-framework","homepage":"http://checkerframework.org/","size":195888,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"typetools:master","ref":"master","sha":"526c5ff7852e5fd68d6b7d156f81587edbe5d990","user":{"login":"typetools","id":12883499,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODgzNDk5","avatar_url":"https://avatars3.githubusercontent.com/u/12883499?v=4","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"repo":{"id":38488726,"node_id":"MDEwOlJlcG9zaXRvcnkzODQ4ODcyNg==","name":"checker-framework","full_name":"typetools/checker-framework","owner":{"login":"typetools","id":12883499,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODgzNDk5","avatar_url":"https://avatars3.githubusercontent.com/u/12883499?v=4","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typetools/checker-framework","description":"Pluggable type-checking for Java","fork":false,"url":"https://api.github.com/repos/typetools/checker-framework","forks_url":"https://api.github.com/repos/typetools/checker-framework/forks","keys_url":"https://api.github.com/repos/typetools/checker-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typetools/checker-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typetools/checker-framework/teams","hooks_url":"https://api.github.com/repos/typetools/checker-framework/hooks","issue_events_url":"https://api.github.com/repos/typetools/checker-framework/issues/events{/number}","events_url":"https://api.github.com/repos/typetools/checker-framework/events","assignees_url":"https://api.github.com/repos/typetools/checker-framework/assignees{/user}","branches_url":"https://api.github.com/repos/typetools/checker-framework/branches{/branch}","tags_url":"https://api.github.com/repos/typetools/checker-framework/tags","blobs_url":"https://api.github.com/repos/typetools/checker-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typetools/checker-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typetools/checker-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/typetools/checker-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typetools/checker-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/typetools/checker-framework/languages","stargazers_url":"https://api.github.com/repos/typetools/checker-framework/stargazers","contributors_url":"https://api.github.com/repos/typetools/checker-framework/contributors","subscribers_url":"https://api.github.com/repos/typetools/checker-framework/subscribers","subscription_url":"https://api.github.com/repos/typetools/checker-framework/subscription","commits_url":"https://api.github.com/repos/typetools/checker-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/typetools/checker-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/typetools/checker-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/typetools/checker-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/typetools/checker-framework/contents/{+path}","compare_url":"https://api.github.com/repos/typetools/checker-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typetools/checker-framework/merges","archive_url":"https://api.github.com/repos/typetools/checker-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typetools/checker-framework/downloads","issues_url":"https://api.github.com/repos/typetools/checker-framework/issues{/number}","pulls_url":"https://api.github.com/repos/typetools/checker-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/typetools/checker-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/typetools/checker-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typetools/checker-framework/labels{/name}","releases_url":"https://api.github.com/repos/typetools/checker-framework/releases{/id}","deployments_url":"https://api.github.com/repos/typetools/checker-framework/deployments","created_at":"2015-07-03T11:09:17Z","updated_at":"2018-08-12T14:50:34Z","pushed_at":"2018-08-12T15:18:42Z","git_url":"git://github.com/typetools/checker-framework.git","ssh_url":"git@github.com:typetools/checker-framework.git","clone_url":"https://github.com/typetools/checker-framework.git","svn_url":"https://github.com/typetools/checker-framework","homepage":"http://checkerframework.org/","size":197757,"stargazers_count":405,"watchers_count":405,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":162,"mirror_url":null,"archived":false,"open_issues_count":202,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":162,"open_issues":202,"watchers":405,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/2062"},"html":{"href":"https://github.com/typetools/checker-framework/pull/2062"},"issue":{"href":"https://api.github.com/repos/typetools/checker-framework/issues/2062"},"comments":{"href":"https://api.github.com/repos/typetools/checker-framework/issues/2062/comments"},"review_comments":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/2062/comments"},"review_comment":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/2062/commits"},"statuses":{"href":"https://api.github.com/repos/typetools/checker-framework/statuses/ec728d3b070a5578c655b1ecc029154bc76b63b1"}},"author_association":"NONE"}}
{"actor":{"display_login":"mernst"}}