{"action":"created","comment":{"url":"https://api.github.com/repos/apache/groovy/pulls/comments/182731442","pull_request_review_id":113586542,"id":182731442,"diff_hunk":"@@ -286,31 +372,106 @@ private static boolean isNewMethodStyle(MethodCallExpression mce) {\n                 && ((ConstantExpression) meth).getValue().equals(\"new\"));\n     }\n \n-    private Expression transformMethodCall(MethodCallExpression mce, Expression args) {\n+    private Expression transformMethodCall(MethodCallExpression mce, Expression argsExp) {\n         ClassNode classType;\n+\n         if (isNewMethodStyle(mce)) {\n             classType = mce.getObjectExpression().getType();\n-        } else {\n+        }\n+        else {\n             classType = findMatchingCandidateClass(mce);\n         }\n+        \n         if (classType != null) {\n-            return new ConstructorCallExpression(classType, args);\n+            Expression argsToUse = argsExp;\n+            //if(classType.getOuterClass() != null && !classType.isStaticClass()) {\n+            if(classType.getOuterClass() != null && ((classType.getModifiers() & org.objectweb.asm.Opcodes.ACC_STATIC) == 0)) {\n+                if(!(argsExp instanceof ArgumentListExpression)) {\n+                    addError(\"Non-static inner constructor arguments must be an argument list expression; pass 'this' pointer explicitely as first constructor argument otherwise.\", mce);\n+                    return mce; // TODO: Expected behavior to return  the untransformed method call here ?","path":"src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java","position":373,"original_position":373,"commit_id":"697cf12a11dbd2af02571a6edb7074f08e6f9bc5","original_commit_id":"697cf12a11dbd2af02571a6edb7074f08e6f9bc5","user":{"login":"mgroovy","id":31455466,"avatar_url":"https://avatars3.githubusercontent.com/u/31455466?v=4","gravatar_id":"","url":"https://api.github.com/users/mgroovy","html_url":"https://github.com/mgroovy","followers_url":"https://api.github.com/users/mgroovy/followers","following_url":"https://api.github.com/users/mgroovy/following{/other_user}","gists_url":"https://api.github.com/users/mgroovy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgroovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgroovy/subscriptions","organizations_url":"https://api.github.com/users/mgroovy/orgs","repos_url":"https://api.github.com/users/mgroovy/repos","events_url":"https://api.github.com/users/mgroovy/events{/privacy}","received_events_url":"https://api.github.com/users/mgroovy/received_events","type":"User","site_admin":false},"body":"This is the first Groovy extension I am doing on my own, and I took this code part from existing Groovy code, and wanted to make sure somebody more experienced had a look at this. If you say this code is fine, then the TODO can be removed (see above comment).","created_at":"2018-04-19T12:41:49Z","updated_at":"2018-04-19T12:41:49Z","html_url":"https://github.com/apache/groovy/pull/686#discussion_r182731442","pull_request_url":"https://api.github.com/repos/apache/groovy/pulls/686","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/groovy/pulls/comments/182731442"},"html":{"href":"https://github.com/apache/groovy/pull/686#discussion_r182731442"},"pull_request":{"href":"https://api.github.com/repos/apache/groovy/pulls/686"}},"in_reply_to_id":182659937},"pull_request":{"url":"https://api.github.com/repos/apache/groovy/pulls/686","id":182301561,"html_url":"https://github.com/apache/groovy/pull/686","diff_url":"https://github.com/apache/groovy/pull/686.diff","patch_url":"https://github.com/apache/groovy/pull/686.patch","issue_url":"https://api.github.com/repos/apache/groovy/issues/686","number":686,"state":"open","locked":false,"title":"@Newify table name pattern support","user":{"login":"mgroovy","id":31455466,"avatar_url":"https://avatars3.githubusercontent.com/u/31455466?v=4","gravatar_id":"","url":"https://api.github.com/users/mgroovy","html_url":"https://github.com/mgroovy","followers_url":"https://api.github.com/users/mgroovy/followers","following_url":"https://api.github.com/users/mgroovy/following{/other_user}","gists_url":"https://api.github.com/users/mgroovy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgroovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgroovy/subscriptions","organizations_url":"https://api.github.com/users/mgroovy/orgs","repos_url":"https://api.github.com/users/mgroovy/repos","events_url":"https://api.github.com/users/mgroovy/events{/privacy}","received_events_url":"https://api.github.com/users/mgroovy/received_events","type":"User","site_admin":false},"body":"Added class name pattern parameter support to `@Newify` annotation (e.g. `@Newify(pattern=/[A-Z].*/)`) that allows users to define the classes with newify support through the pattern in addition to the existing class list parameter.","created_at":"2018-04-17T21:18:31Z","updated_at":"2018-04-19T12:41:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a407e47be3896f57c3b4c03165a63bebede0b22","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/groovy/pulls/686/commits","review_comments_url":"https://api.github.com/repos/apache/groovy/pulls/686/comments","review_comment_url":"https://api.github.com/repos/apache/groovy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/groovy/issues/686/comments","statuses_url":"https://api.github.com/repos/apache/groovy/statuses/697cf12a11dbd2af02571a6edb7074f08e6f9bc5","head":{"label":"mgroovy:mgroovy_newify_pattern","ref":"mgroovy_newify_pattern","sha":"697cf12a11dbd2af02571a6edb7074f08e6f9bc5","user":{"login":"mgroovy","id":31455466,"avatar_url":"https://avatars3.githubusercontent.com/u/31455466?v=4","gravatar_id":"","url":"https://api.github.com/users/mgroovy","html_url":"https://github.com/mgroovy","followers_url":"https://api.github.com/users/mgroovy/followers","following_url":"https://api.github.com/users/mgroovy/following{/other_user}","gists_url":"https://api.github.com/users/mgroovy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgroovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgroovy/subscriptions","organizations_url":"https://api.github.com/users/mgroovy/orgs","repos_url":"https://api.github.com/users/mgroovy/repos","events_url":"https://api.github.com/users/mgroovy/events{/privacy}","received_events_url":"https://api.github.com/users/mgroovy/received_events","type":"User","site_admin":false},"repo":{"id":101931642,"name":"groovy","full_name":"mgroovy/groovy","owner":{"login":"mgroovy","id":31455466,"avatar_url":"https://avatars3.githubusercontent.com/u/31455466?v=4","gravatar_id":"","url":"https://api.github.com/users/mgroovy","html_url":"https://github.com/mgroovy","followers_url":"https://api.github.com/users/mgroovy/followers","following_url":"https://api.github.com/users/mgroovy/following{/other_user}","gists_url":"https://api.github.com/users/mgroovy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgroovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgroovy/subscriptions","organizations_url":"https://api.github.com/users/mgroovy/orgs","repos_url":"https://api.github.com/users/mgroovy/repos","events_url":"https://api.github.com/users/mgroovy/events{/privacy}","received_events_url":"https://api.github.com/users/mgroovy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgroovy/groovy","description":"Mirror of Apache Groovy","fork":true,"url":"https://api.github.com/repos/mgroovy/groovy","forks_url":"https://api.github.com/repos/mgroovy/groovy/forks","keys_url":"https://api.github.com/repos/mgroovy/groovy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgroovy/groovy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgroovy/groovy/teams","hooks_url":"https://api.github.com/repos/mgroovy/groovy/hooks","issue_events_url":"https://api.github.com/repos/mgroovy/groovy/issues/events{/number}","events_url":"https://api.github.com/repos/mgroovy/groovy/events","assignees_url":"https://api.github.com/repos/mgroovy/groovy/assignees{/user}","branches_url":"https://api.github.com/repos/mgroovy/groovy/branches{/branch}","tags_url":"https://api.github.com/repos/mgroovy/groovy/tags","blobs_url":"https://api.github.com/repos/mgroovy/groovy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgroovy/groovy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgroovy/groovy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgroovy/groovy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgroovy/groovy/statuses/{sha}","languages_url":"https://api.github.com/repos/mgroovy/groovy/languages","stargazers_url":"https://api.github.com/repos/mgroovy/groovy/stargazers","contributors_url":"https://api.github.com/repos/mgroovy/groovy/contributors","subscribers_url":"https://api.github.com/repos/mgroovy/groovy/subscribers","subscription_url":"https://api.github.com/repos/mgroovy/groovy/subscription","commits_url":"https://api.github.com/repos/mgroovy/groovy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgroovy/groovy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgroovy/groovy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgroovy/groovy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgroovy/groovy/contents/{+path}","compare_url":"https://api.github.com/repos/mgroovy/groovy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgroovy/groovy/merges","archive_url":"https://api.github.com/repos/mgroovy/groovy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgroovy/groovy/downloads","issues_url":"https://api.github.com/repos/mgroovy/groovy/issues{/number}","pulls_url":"https://api.github.com/repos/mgroovy/groovy/pulls{/number}","milestones_url":"https://api.github.com/repos/mgroovy/groovy/milestones{/number}","notifications_url":"https://api.github.com/repos/mgroovy/groovy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgroovy/groovy/labels{/name}","releases_url":"https://api.github.com/repos/mgroovy/groovy/releases{/id}","deployments_url":"https://api.github.com/repos/mgroovy/groovy/deployments","created_at":"2017-08-30T21:43:33Z","updated_at":"2018-04-02T16:23:58Z","pushed_at":"2018-04-17T22:24:19Z","git_url":"git://github.com/mgroovy/groovy.git","ssh_url":"git@github.com:mgroovy/groovy.git","clone_url":"https://github.com/mgroovy/groovy.git","svn_url":"https://github.com/mgroovy/groovy","homepage":"","size":172409,"stargazers_count":0,"watchers_count":0,"language":"Java","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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"4840d1fce2ccea5efaf30e30b8e569a833257023","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":34039690,"name":"groovy","full_name":"apache/groovy","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/groovy","description":"Mirror of Apache Groovy","fork":false,"url":"https://api.github.com/repos/apache/groovy","forks_url":"https://api.github.com/repos/apache/groovy/forks","keys_url":"https://api.github.com/repos/apache/groovy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/groovy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/groovy/teams","hooks_url":"https://api.github.com/repos/apache/groovy/hooks","issue_events_url":"https://api.github.com/repos/apache/groovy/issues/events{/number}","events_url":"https://api.github.com/repos/apache/groovy/events","assignees_url":"https://api.github.com/repos/apache/groovy/assignees{/user}","branches_url":"https://api.github.com/repos/apache/groovy/branches{/branch}","tags_url":"https://api.github.com/repos/apache/groovy/tags","blobs_url":"https://api.github.com/repos/apache/groovy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/groovy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/groovy/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/groovy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/groovy/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/groovy/languages","stargazers_url":"https://api.github.com/repos/apache/groovy/stargazers","contributors_url":"https://api.github.com/repos/apache/groovy/contributors","subscribers_url":"https://api.github.com/repos/apache/groovy/subscribers","subscription_url":"https://api.github.com/repos/apache/groovy/subscription","commits_url":"https://api.github.com/repos/apache/groovy/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/groovy/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/groovy/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/groovy/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/groovy/contents/{+path}","compare_url":"https://api.github.com/repos/apache/groovy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/groovy/merges","archive_url":"https://api.github.com/repos/apache/groovy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/groovy/downloads","issues_url":"https://api.github.com/repos/apache/groovy/issues{/number}","pulls_url":"https://api.github.com/repos/apache/groovy/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/groovy/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/groovy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/groovy/labels{/name}","releases_url":"https://api.github.com/repos/apache/groovy/releases{/id}","deployments_url":"https://api.github.com/repos/apache/groovy/deployments","created_at":"2015-04-16T07:00:05Z","updated_at":"2018-04-19T12:06:03Z","pushed_at":"2018-04-19T08:40:20Z","git_url":"git://github.com/apache/groovy.git","ssh_url":"git@github.com:apache/groovy.git","clone_url":"https://github.com/apache/groovy.git","svn_url":"https://github.com/apache/groovy","homepage":"","size":174655,"stargazers_count":2574,"watchers_count":2574,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":971,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":971,"open_issues":15,"watchers":2574,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/groovy/pulls/686"},"html":{"href":"https://github.com/apache/groovy/pull/686"},"issue":{"href":"https://api.github.com/repos/apache/groovy/issues/686"},"comments":{"href":"https://api.github.com/repos/apache/groovy/issues/686/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/groovy/pulls/686/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/groovy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/groovy/pulls/686/commits"},"statuses":{"href":"https://api.github.com/repos/apache/groovy/statuses/697cf12a11dbd2af02571a6edb7074f08e6f9bc5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mgroovy"}}