{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/openj9/pulls/comments/189054334","pull_request_review_id":121094942,"id":189054334,"diff_hunk":"@@ -377,6 +377,70 @@ public Object run() {\n \t\tjava.security.AccessController.doPrivileged(action);\n \t}\n \n+\tstatic class ParentClass {\n+\t\tpublic static void methodPublicStatic() {}\n+\t\tpublic void methodPublicInstance() {}\n+\t\tstatic void methodPkgPrivateStatic() {}\n+\t\tvoid methodPkgPrivateInstance() {}\n+\t\tprivate static void methodPrivateStatic() {}\n+\t\tprivate void methodPrivateInstance() {}\n+\t}\n+\n+\tstatic class ChildClass extends ParentClass {\n+\t\tpublic static void methodPublicStatic() {}\n+\t\tpublic void methodPublicInstance() {}\n+\t\tstatic void methodPkgPrivateStatic() {}\n+\t\tvoid methodPkgPrivateInstance() {}\n+\t\tprivate static void methodPrivateStatic() {}\n+\t\tprivate void methodPrivateInstance() {}\n+\t}\n+\n+\tstatic interface SuperInterface {\n+\t\tvoid methodPublicInterface(); \n+\t\tpublic static void methodPublicStatic() {};\n+\t}\n+\n+\tstatic interface SubInterface extends SuperInterface {\n+\t\tvoid methodPublicInterface(); \n+\t\tpublic static void methodPublicStatic() {};\n+\t}\n+\n+\tstatic class ClassImplInterface implements SubInterface {\n+\t\tpublic void methodPublicInterface() {}\n+\t\tpublic static void methodPublicStatic() {};\n+\t}\n+\t\n+\t@Test\n+\tpublic void test_getMethods_subtest3() {\n+\t\tMethod[] methods = ChildClass.class.getMethods();\n+\t\tfor (Method method : methods) {\n+\t\t\tString declaringClassName = method.getDeclaringClass().getName();\n+\t\t\tif (declaringClassName.indexOf(\"ParentClass\") != -1) {\n+\t\t\t\tAssert.fail(\"Should not return Method \" + method.getName() + \" declared in class \" + declaringClassName);\n+\t\t\t}\n+\t\t}\n+\t}\n+\t@Test\n+\tpublic void test_getMethods_subtest4() {\n+\t\tfinal Method[] methods = SubInterface.class.getMethods();\n+\t\tfor (Method method : methods) {\n+\t\t\tString declaringClassName = method.getDeclaringClass().getName();\n+\t\t\tif (declaringClassName.indexOf(\"SuperInterface\") != -1) {\n+\t\t\t\tAssert.fail(\"Should not return Method \" + method.getName() + \" declared in class \" + declaringClassName);\n+\t\t\t}\n+\t\t}\n+\t}\n+\t@Test\n+\tpublic void test_getMethods_subtest5() {\n+\t\tfinal Method[] methods = ClassImplInterface.class.getMethods();\n+\t\tfor (Method method : methods) {\n+\t\t\tString declaringClassName = method.getDeclaringClass().getName(); \n+\t\t\tif ((declaringClassName.indexOf(\"SuperInterface\") != -1) || (declaringClassName.indexOf(\"SubInterface\") != -1)) {","path":"test/functional/Java8andUp/src_80/org/openj9/test/java/lang/Test_Class.java","position":62,"original_position":62,"commit_id":"4c4bff088d6d3146c1ffbf580fd76b57bfbb358d","original_commit_id":"4c4bff088d6d3146c1ffbf580fd76b57bfbb358d","user":{"login":"DanHeidinga","id":8503711,"avatar_url":"https://avatars2.githubusercontent.com/u/8503711?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHeidinga","html_url":"https://github.com/DanHeidinga","followers_url":"https://api.github.com/users/DanHeidinga/followers","following_url":"https://api.github.com/users/DanHeidinga/following{/other_user}","gists_url":"https://api.github.com/users/DanHeidinga/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHeidinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHeidinga/subscriptions","organizations_url":"https://api.github.com/users/DanHeidinga/orgs","repos_url":"https://api.github.com/users/DanHeidinga/repos","events_url":"https://api.github.com/users/DanHeidinga/events{/privacy}","received_events_url":"https://api.github.com/users/DanHeidinga/received_events","type":"User","site_admin":false},"body":"String match","created_at":"2018-05-17T18:17:34Z","updated_at":"2018-05-17T18:55:15Z","html_url":"https://github.com/eclipse/openj9/pull/1892#discussion_r189054334","pull_request_url":"https://api.github.com/repos/eclipse/openj9/pulls/1892","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/comments/189054334"},"html":{"href":"https://github.com/eclipse/openj9/pull/1892#discussion_r189054334"},"pull_request":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/1892"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/openj9/pulls/1892","id":187308948,"html_url":"https://github.com/eclipse/openj9/pull/1892","diff_url":"https://github.com/eclipse/openj9/pull/1892.diff","patch_url":"https://github.com/eclipse/openj9/pull/1892.patch","issue_url":"https://api.github.com/repos/eclipse/openj9/issues/1892","number":1892,"state":"open","locked":false,"title":"j.l.Class.getMethods() should select more specific method","user":{"login":"JasonFengJ9","id":17935151,"avatar_url":"https://avatars0.githubusercontent.com/u/17935151?v=4","gravatar_id":"","url":"https://api.github.com/users/JasonFengJ9","html_url":"https://github.com/JasonFengJ9","followers_url":"https://api.github.com/users/JasonFengJ9/followers","following_url":"https://api.github.com/users/JasonFengJ9/following{/other_user}","gists_url":"https://api.github.com/users/JasonFengJ9/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonFengJ9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonFengJ9/subscriptions","organizations_url":"https://api.github.com/users/JasonFengJ9/orgs","repos_url":"https://api.github.com/users/JasonFengJ9/repos","events_url":"https://api.github.com/users/JasonFengJ9/events{/privacy}","received_events_url":"https://api.github.com/users/JasonFengJ9/received_events","type":"User","site_admin":false},"body":"`j.l.Class.getMethods()` should select more specific method\r\n\r\nAs per Java spec:\r\nFor methods with same signature (name, parameter types) and return type, only the most specific method should be selected. \r\nMethod `N` is more specific than `M` if:\r\n`N` is declared by a `class` and `M` is declared by an `interface`; or\r\n`N` and `M` are both declared by either `classes` or `interfaces` and `N's` declaring type is the same as or a subtype of `M's` declaring type.\r\nSelect most specific method from a set of methods with same signature using algorithm above.\r\nAdded tests to verify this behaviour.\r\n\r\nReviewer: @DanHeidinga \r\n\r\nSigned-off-by: Jason Feng <fengj@ca.ibm.com>","created_at":"2018-05-10T21:12:44Z","updated_at":"2018-05-17T18:55:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb1f92ee9b8defae3ba24147b8c0e77b5391521d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":697962110,"url":"https://api.github.com/repos/eclipse/openj9/labels/comp:vm","name":"comp:vm","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/openj9/pulls/1892/commits","review_comments_url":"https://api.github.com/repos/eclipse/openj9/pulls/1892/comments","review_comment_url":"https://api.github.com/repos/eclipse/openj9/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/openj9/issues/1892/comments","statuses_url":"https://api.github.com/repos/eclipse/openj9/statuses/4c4bff088d6d3146c1ffbf580fd76b57bfbb358d","head":{"label":"JasonFengJ9:getmethods","ref":"getmethods","sha":"4c4bff088d6d3146c1ffbf580fd76b57bfbb358d","user":{"login":"JasonFengJ9","id":17935151,"avatar_url":"https://avatars0.githubusercontent.com/u/17935151?v=4","gravatar_id":"","url":"https://api.github.com/users/JasonFengJ9","html_url":"https://github.com/JasonFengJ9","followers_url":"https://api.github.com/users/JasonFengJ9/followers","following_url":"https://api.github.com/users/JasonFengJ9/following{/other_user}","gists_url":"https://api.github.com/users/JasonFengJ9/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonFengJ9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonFengJ9/subscriptions","organizations_url":"https://api.github.com/users/JasonFengJ9/orgs","repos_url":"https://api.github.com/users/JasonFengJ9/repos","events_url":"https://api.github.com/users/JasonFengJ9/events{/privacy}","received_events_url":"https://api.github.com/users/JasonFengJ9/received_events","type":"User","site_admin":false},"repo":{"id":103953542,"name":"openj9","full_name":"JasonFengJ9/openj9","owner":{"login":"JasonFengJ9","id":17935151,"avatar_url":"https://avatars0.githubusercontent.com/u/17935151?v=4","gravatar_id":"","url":"https://api.github.com/users/JasonFengJ9","html_url":"https://github.com/JasonFengJ9","followers_url":"https://api.github.com/users/JasonFengJ9/followers","following_url":"https://api.github.com/users/JasonFengJ9/following{/other_user}","gists_url":"https://api.github.com/users/JasonFengJ9/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonFengJ9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonFengJ9/subscriptions","organizations_url":"https://api.github.com/users/JasonFengJ9/orgs","repos_url":"https://api.github.com/users/JasonFengJ9/repos","events_url":"https://api.github.com/users/JasonFengJ9/events{/privacy}","received_events_url":"https://api.github.com/users/JasonFengJ9/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JasonFengJ9/openj9","description":"OpenJ9","fork":true,"url":"https://api.github.com/repos/JasonFengJ9/openj9","forks_url":"https://api.github.com/repos/JasonFengJ9/openj9/forks","keys_url":"https://api.github.com/repos/JasonFengJ9/openj9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JasonFengJ9/openj9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JasonFengJ9/openj9/teams","hooks_url":"https://api.github.com/repos/JasonFengJ9/openj9/hooks","issue_events_url":"https://api.github.com/repos/JasonFengJ9/openj9/issues/events{/number}","events_url":"https://api.github.com/repos/JasonFengJ9/openj9/events","assignees_url":"https://api.github.com/repos/JasonFengJ9/openj9/assignees{/user}","branches_url":"https://api.github.com/repos/JasonFengJ9/openj9/branches{/branch}","tags_url":"https://api.github.com/repos/JasonFengJ9/openj9/tags","blobs_url":"https://api.github.com/repos/JasonFengJ9/openj9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JasonFengJ9/openj9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JasonFengJ9/openj9/git/refs{/sha}","trees_url":"https://api.github.com/repos/JasonFengJ9/openj9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JasonFengJ9/openj9/statuses/{sha}","languages_url":"https://api.github.com/repos/JasonFengJ9/openj9/languages","stargazers_url":"https://api.github.com/repos/JasonFengJ9/openj9/stargazers","contributors_url":"https://api.github.com/repos/JasonFengJ9/openj9/contributors","subscribers_url":"https://api.github.com/repos/JasonFengJ9/openj9/subscribers","subscription_url":"https://api.github.com/repos/JasonFengJ9/openj9/subscription","commits_url":"https://api.github.com/repos/JasonFengJ9/openj9/commits{/sha}","git_commits_url":"https://api.github.com/repos/JasonFengJ9/openj9/git/commits{/sha}","comments_url":"https://api.github.com/repos/JasonFengJ9/openj9/comments{/number}","issue_comment_url":"https://api.github.com/repos/JasonFengJ9/openj9/issues/comments{/number}","contents_url":"https://api.github.com/repos/JasonFengJ9/openj9/contents/{+path}","compare_url":"https://api.github.com/repos/JasonFengJ9/openj9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JasonFengJ9/openj9/merges","archive_url":"https://api.github.com/repos/JasonFengJ9/openj9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JasonFengJ9/openj9/downloads","issues_url":"https://api.github.com/repos/JasonFengJ9/openj9/issues{/number}","pulls_url":"https://api.github.com/repos/JasonFengJ9/openj9/pulls{/number}","milestones_url":"https://api.github.com/repos/JasonFengJ9/openj9/milestones{/number}","notifications_url":"https://api.github.com/repos/JasonFengJ9/openj9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JasonFengJ9/openj9/labels{/name}","releases_url":"https://api.github.com/repos/JasonFengJ9/openj9/releases{/id}","deployments_url":"https://api.github.com/repos/JasonFengJ9/openj9/deployments","created_at":"2017-09-18T14:59:50Z","updated_at":"2017-09-18T15:00:18Z","pushed_at":"2018-05-16T19:43:19Z","git_url":"git://github.com/JasonFengJ9/openj9.git","ssh_url":"git@github.com:JasonFengJ9/openj9.git","clone_url":"https://github.com/JasonFengJ9/openj9.git","svn_url":"https://github.com/JasonFengJ9/openj9","homepage":null,"size":29400,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eclipse:master","ref":"master","sha":"bd106f77686ddc3b2e5de6d533fcfef4506a24d9","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":101408117,"name":"openj9","full_name":"eclipse/openj9","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/openj9","description":"Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput.   Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.","fork":false,"url":"https://api.github.com/repos/eclipse/openj9","forks_url":"https://api.github.com/repos/eclipse/openj9/forks","keys_url":"https://api.github.com/repos/eclipse/openj9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/openj9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/openj9/teams","hooks_url":"https://api.github.com/repos/eclipse/openj9/hooks","issue_events_url":"https://api.github.com/repos/eclipse/openj9/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/openj9/events","assignees_url":"https://api.github.com/repos/eclipse/openj9/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/openj9/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/openj9/tags","blobs_url":"https://api.github.com/repos/eclipse/openj9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/openj9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/openj9/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/openj9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/openj9/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/openj9/languages","stargazers_url":"https://api.github.com/repos/eclipse/openj9/stargazers","contributors_url":"https://api.github.com/repos/eclipse/openj9/contributors","subscribers_url":"https://api.github.com/repos/eclipse/openj9/subscribers","subscription_url":"https://api.github.com/repos/eclipse/openj9/subscription","commits_url":"https://api.github.com/repos/eclipse/openj9/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/openj9/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/openj9/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/openj9/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/openj9/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/openj9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/openj9/merges","archive_url":"https://api.github.com/repos/eclipse/openj9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/openj9/downloads","issues_url":"https://api.github.com/repos/eclipse/openj9/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/openj9/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/openj9/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/openj9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/openj9/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/openj9/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/openj9/deployments","created_at":"2017-08-25T13:46:07Z","updated_at":"2018-05-17T18:48:25Z","pushed_at":"2018-05-17T18:48:06Z","git_url":"git://github.com/eclipse/openj9.git","ssh_url":"git@github.com:eclipse/openj9.git","clone_url":"https://github.com/eclipse/openj9.git","svn_url":"https://github.com/eclipse/openj9","homepage":"","size":29335,"stargazers_count":1247,"watchers_count":1247,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":253,"mirror_url":null,"archived":false,"open_issues_count":364,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":253,"open_issues":364,"watchers":1247,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/1892"},"html":{"href":"https://github.com/eclipse/openj9/pull/1892"},"issue":{"href":"https://api.github.com/repos/eclipse/openj9/issues/1892"},"comments":{"href":"https://api.github.com/repos/eclipse/openj9/issues/1892/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/1892/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/1892/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/openj9/statuses/4c4bff088d6d3146c1ffbf580fd76b57bfbb358d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DanHeidinga"}}