{"action":"created","comment":{"url":"https://api.github.com/repos/INRIA/spoon/pulls/comments/80037864","id":80037864,"diff_hunk":"@@ -0,0 +1,34 @@\n+/**\n+ * Copyright (C) 2006-2016 INRIA and contributors\n+ * Spoon - http://spoon.gforge.inria.fr/\n+ *\n+ * This software is governed by the CeCILL-C License under French law and\n+ * abiding by the rules of distribution of free software. You can use, modify\n+ * and/or redistribute the software under the terms of the CeCILL-C license as\n+ * circulated by CEA, CNRS and INRIA at http://www.cecill.info.\n+ *\n+ * This program is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.\n+ *\n+ * The fact that you are presently reading this means that you have had\n+ * knowledge of the CeCILL-C license and that you accept its terms.\n+ */\n+package spoon.support.comparator;\n+\n+import java.io.Serializable;\n+import java.util.Comparator;\n+\n+import spoon.reflect.reference.CtTypeReference;\n+\n+public class SourcePositionComparator<T> implements Comparator<CtTypeReference<?>>, Serializable {\n+\t@Override\n+\tpublic int compare(CtTypeReference<?> o1, CtTypeReference<?> o2) {\n+\t\tif (o1.getPosition() == null || o2.getPosition() == null) {\n+\t\t\treturn -1;\n+\t\t}\n+\t\tint pos1 = o1.getPosition().getSourceStart();\n+\t\tint pos2 = o2.getPosition().getSourceStart();\n+\t\treturn (pos1 < pos2) ? -1 : ((pos1 == pos2) ? 0 : 1);","path":"src/main/java/spoon/support/comparator/SourcePositionComparator.java","position":32,"original_position":32,"commit_id":"8e7344adfd07154c6659ecb57faf68dc1b0ecb44","original_commit_id":"8e7344adfd07154c6659ecb57faf68dc1b0ecb44","user":{"login":"monperrus","id":803666,"avatar_url":"https://avatars.githubusercontent.com/u/803666?v=3","gravatar_id":"","url":"https://api.github.com/users/monperrus","html_url":"https://github.com/monperrus","followers_url":"https://api.github.com/users/monperrus/followers","following_url":"https://api.github.com/users/monperrus/following{/other_user}","gists_url":"https://api.github.com/users/monperrus/gists{/gist_id}","starred_url":"https://api.github.com/users/monperrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monperrus/subscriptions","organizations_url":"https://api.github.com/users/monperrus/orgs","repos_url":"https://api.github.com/users/monperrus/repos","events_url":"https://api.github.com/users/monperrus/events{/privacy}","received_events_url":"https://api.github.com/users/monperrus/received_events","type":"User","site_admin":false},"body":"do you mean in alphabetical order?","created_at":"2016-09-22T13:21:28Z","updated_at":"2016-09-22T13:21:28Z","html_url":"https://github.com/INRIA/spoon/pull/844#discussion_r80037864","pull_request_url":"https://api.github.com/repos/INRIA/spoon/pulls/844","_links":{"self":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/comments/80037864"},"html":{"href":"https://github.com/INRIA/spoon/pull/844#discussion_r80037864"},"pull_request":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/844"}}},"pull_request":{"url":"https://api.github.com/repos/INRIA/spoon/pulls/844","id":86322806,"html_url":"https://github.com/INRIA/spoon/pull/844","diff_url":"https://github.com/INRIA/spoon/pull/844.diff","patch_url":"https://github.com/INRIA/spoon/pull/844.patch","issue_url":"https://api.github.com/repos/INRIA/spoon/issues/844","number":844,"state":"open","locked":false,"title":"Remove CtElement.compareTo ","user":{"login":"monperrus","id":803666,"avatar_url":"https://avatars.githubusercontent.com/u/803666?v=3","gravatar_id":"","url":"https://api.github.com/users/monperrus","html_url":"https://github.com/monperrus","followers_url":"https://api.github.com/users/monperrus/followers","following_url":"https://api.github.com/users/monperrus/following{/other_user}","gists_url":"https://api.github.com/users/monperrus/gists{/gist_id}","starred_url":"https://api.github.com/users/monperrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monperrus/subscriptions","organizations_url":"https://api.github.com/users/monperrus/orgs","repos_url":"https://api.github.com/users/monperrus/repos","events_url":"https://api.github.com/users/monperrus/events{/privacy}","received_events_url":"https://api.github.com/users/monperrus/received_events","type":"User","site_admin":false},"body":"This PR removes CtElement.compareTo and all basic usage of TreeSet. Closes #636.\r\n\r\nNow all set orders are explicit (incl. the order of ModifierKinds that complies with the Java convention by default).\r\n\r\nNote the architectural test in SpoonArchitectureEnforcer.java.\r\n\r\n+ a couple of minor changes required for this.","created_at":"2016-09-22T11:50:14Z","updated_at":"2016-09-22T13:21:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e32362246b893d87fbc8120f08463632c3a0ccb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/INRIA/spoon/pulls/844/commits","review_comments_url":"https://api.github.com/repos/INRIA/spoon/pulls/844/comments","review_comment_url":"https://api.github.com/repos/INRIA/spoon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/INRIA/spoon/issues/844/comments","statuses_url":"https://api.github.com/repos/INRIA/spoon/statuses/8e7344adfd07154c6659ecb57faf68dc1b0ecb44","head":{"label":"monperrus:no-comparable","ref":"no-comparable","sha":"8e7344adfd07154c6659ecb57faf68dc1b0ecb44","user":{"login":"monperrus","id":803666,"avatar_url":"https://avatars.githubusercontent.com/u/803666?v=3","gravatar_id":"","url":"https://api.github.com/users/monperrus","html_url":"https://github.com/monperrus","followers_url":"https://api.github.com/users/monperrus/followers","following_url":"https://api.github.com/users/monperrus/following{/other_user}","gists_url":"https://api.github.com/users/monperrus/gists{/gist_id}","starred_url":"https://api.github.com/users/monperrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monperrus/subscriptions","organizations_url":"https://api.github.com/users/monperrus/orgs","repos_url":"https://api.github.com/users/monperrus/repos","events_url":"https://api.github.com/users/monperrus/events{/privacy}","received_events_url":"https://api.github.com/users/monperrus/received_events","type":"User","site_admin":false},"repo":{"id":24788221,"name":"spoon","full_name":"monperrus/spoon","owner":{"login":"monperrus","id":803666,"avatar_url":"https://avatars.githubusercontent.com/u/803666?v=3","gravatar_id":"","url":"https://api.github.com/users/monperrus","html_url":"https://github.com/monperrus","followers_url":"https://api.github.com/users/monperrus/followers","following_url":"https://api.github.com/users/monperrus/following{/other_user}","gists_url":"https://api.github.com/users/monperrus/gists{/gist_id}","starred_url":"https://api.github.com/users/monperrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monperrus/subscriptions","organizations_url":"https://api.github.com/users/monperrus/orgs","repos_url":"https://api.github.com/users/monperrus/repos","events_url":"https://api.github.com/users/monperrus/events{/privacy}","received_events_url":"https://api.github.com/users/monperrus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/monperrus/spoon","description":"Spoon is a library for analyzing and transforming Java source code.","fork":true,"url":"https://api.github.com/repos/monperrus/spoon","forks_url":"https://api.github.com/repos/monperrus/spoon/forks","keys_url":"https://api.github.com/repos/monperrus/spoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monperrus/spoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monperrus/spoon/teams","hooks_url":"https://api.github.com/repos/monperrus/spoon/hooks","issue_events_url":"https://api.github.com/repos/monperrus/spoon/issues/events{/number}","events_url":"https://api.github.com/repos/monperrus/spoon/events","assignees_url":"https://api.github.com/repos/monperrus/spoon/assignees{/user}","branches_url":"https://api.github.com/repos/monperrus/spoon/branches{/branch}","tags_url":"https://api.github.com/repos/monperrus/spoon/tags","blobs_url":"https://api.github.com/repos/monperrus/spoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monperrus/spoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monperrus/spoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/monperrus/spoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monperrus/spoon/statuses/{sha}","languages_url":"https://api.github.com/repos/monperrus/spoon/languages","stargazers_url":"https://api.github.com/repos/monperrus/spoon/stargazers","contributors_url":"https://api.github.com/repos/monperrus/spoon/contributors","subscribers_url":"https://api.github.com/repos/monperrus/spoon/subscribers","subscription_url":"https://api.github.com/repos/monperrus/spoon/subscription","commits_url":"https://api.github.com/repos/monperrus/spoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/monperrus/spoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/monperrus/spoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/monperrus/spoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/monperrus/spoon/contents/{+path}","compare_url":"https://api.github.com/repos/monperrus/spoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monperrus/spoon/merges","archive_url":"https://api.github.com/repos/monperrus/spoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monperrus/spoon/downloads","issues_url":"https://api.github.com/repos/monperrus/spoon/issues{/number}","pulls_url":"https://api.github.com/repos/monperrus/spoon/pulls{/number}","milestones_url":"https://api.github.com/repos/monperrus/spoon/milestones{/number}","notifications_url":"https://api.github.com/repos/monperrus/spoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monperrus/spoon/labels{/name}","releases_url":"https://api.github.com/repos/monperrus/spoon/releases{/id}","deployments_url":"https://api.github.com/repos/monperrus/spoon/deployments","created_at":"2014-10-04T11:52:56Z","updated_at":"2014-10-09T14:03:46Z","pushed_at":"2016-09-22T11:52:06Z","git_url":"git://github.com/monperrus/spoon.git","ssh_url":"git@github.com:monperrus/spoon.git","clone_url":"https://github.com/monperrus/spoon.git","svn_url":"https://github.com/monperrus/spoon","homepage":"http://spoon.gforge.inria.fr/","size":12638,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"empty"}},"base":{"label":"INRIA:master","ref":"master","sha":"10c9549cfd3a5e0427250e4988c51d08f27bd93e","user":{"login":"INRIA","id":2951919,"avatar_url":"https://avatars.githubusercontent.com/u/2951919?v=3","gravatar_id":"","url":"https://api.github.com/users/INRIA","html_url":"https://github.com/INRIA","followers_url":"https://api.github.com/users/INRIA/followers","following_url":"https://api.github.com/users/INRIA/following{/other_user}","gists_url":"https://api.github.com/users/INRIA/gists{/gist_id}","starred_url":"https://api.github.com/users/INRIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/INRIA/subscriptions","organizations_url":"https://api.github.com/users/INRIA/orgs","repos_url":"https://api.github.com/users/INRIA/repos","events_url":"https://api.github.com/users/INRIA/events{/privacy}","received_events_url":"https://api.github.com/users/INRIA/received_events","type":"Organization","site_admin":false},"repo":{"id":14176513,"name":"spoon","full_name":"INRIA/spoon","owner":{"login":"INRIA","id":2951919,"avatar_url":"https://avatars.githubusercontent.com/u/2951919?v=3","gravatar_id":"","url":"https://api.github.com/users/INRIA","html_url":"https://github.com/INRIA","followers_url":"https://api.github.com/users/INRIA/followers","following_url":"https://api.github.com/users/INRIA/following{/other_user}","gists_url":"https://api.github.com/users/INRIA/gists{/gist_id}","starred_url":"https://api.github.com/users/INRIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/INRIA/subscriptions","organizations_url":"https://api.github.com/users/INRIA/orgs","repos_url":"https://api.github.com/users/INRIA/repos","events_url":"https://api.github.com/users/INRIA/events{/privacy}","received_events_url":"https://api.github.com/users/INRIA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/INRIA/spoon","description":"Spoon is a library for analyzing, rewriting, transforming Java source code. It parses source files to build a well-designed AST with powerful analysis and transformation API. It fully supports Java 8.  :beers: :sparkles:","fork":false,"url":"https://api.github.com/repos/INRIA/spoon","forks_url":"https://api.github.com/repos/INRIA/spoon/forks","keys_url":"https://api.github.com/repos/INRIA/spoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/INRIA/spoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/INRIA/spoon/teams","hooks_url":"https://api.github.com/repos/INRIA/spoon/hooks","issue_events_url":"https://api.github.com/repos/INRIA/spoon/issues/events{/number}","events_url":"https://api.github.com/repos/INRIA/spoon/events","assignees_url":"https://api.github.com/repos/INRIA/spoon/assignees{/user}","branches_url":"https://api.github.com/repos/INRIA/spoon/branches{/branch}","tags_url":"https://api.github.com/repos/INRIA/spoon/tags","blobs_url":"https://api.github.com/repos/INRIA/spoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/INRIA/spoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/INRIA/spoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/INRIA/spoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/INRIA/spoon/statuses/{sha}","languages_url":"https://api.github.com/repos/INRIA/spoon/languages","stargazers_url":"https://api.github.com/repos/INRIA/spoon/stargazers","contributors_url":"https://api.github.com/repos/INRIA/spoon/contributors","subscribers_url":"https://api.github.com/repos/INRIA/spoon/subscribers","subscription_url":"https://api.github.com/repos/INRIA/spoon/subscription","commits_url":"https://api.github.com/repos/INRIA/spoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/INRIA/spoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/INRIA/spoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/INRIA/spoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/INRIA/spoon/contents/{+path}","compare_url":"https://api.github.com/repos/INRIA/spoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/INRIA/spoon/merges","archive_url":"https://api.github.com/repos/INRIA/spoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/INRIA/spoon/downloads","issues_url":"https://api.github.com/repos/INRIA/spoon/issues{/number}","pulls_url":"https://api.github.com/repos/INRIA/spoon/pulls{/number}","milestones_url":"https://api.github.com/repos/INRIA/spoon/milestones{/number}","notifications_url":"https://api.github.com/repos/INRIA/spoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/INRIA/spoon/labels{/name}","releases_url":"https://api.github.com/repos/INRIA/spoon/releases{/id}","deployments_url":"https://api.github.com/repos/INRIA/spoon/deployments","created_at":"2013-11-06T15:29:59Z","updated_at":"2016-09-21T17:38:55Z","pushed_at":"2016-09-22T11:52:06Z","git_url":"git://github.com/INRIA/spoon.git","ssh_url":"git@github.com:INRIA/spoon.git","clone_url":"https://github.com/INRIA/spoon.git","svn_url":"https://github.com/INRIA/spoon","homepage":"http://spoon.gforge.inria.fr/","size":17352,"stargazers_count":250,"watchers_count":250,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":10,"forks":49,"open_issues":10,"watchers":250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/844"},"html":{"href":"https://github.com/INRIA/spoon/pull/844"},"issue":{"href":"https://api.github.com/repos/INRIA/spoon/issues/844"},"comments":{"href":"https://api.github.com/repos/INRIA/spoon/issues/844/comments"},"review_comments":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/844/comments"},"review_comment":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/INRIA/spoon/pulls/844/commits"},"statuses":{"href":"https://api.github.com/repos/INRIA/spoon/statuses/8e7344adfd07154c6659ecb57faf68dc1b0ecb44"}}}}
{"actor":{"display_login":"monperrus"}}