{"action":"created","comment":{"url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/comments/176888616","pull_request_review_id":106653714,"id":176888616,"diff_hunk":"@@ -0,0 +1,113 @@\n+package org.openstreetmap.atlas.checks.validation.linear.edges;\n+\n+import java.util.Arrays;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Optional;\n+import java.util.Set;\n+\n+import org.openstreetmap.atlas.checks.base.BaseCheck;\n+import org.openstreetmap.atlas.checks.flag.CheckFlag;\n+import org.openstreetmap.atlas.geography.Segment;\n+import org.openstreetmap.atlas.geography.atlas.items.*;\n+import org.openstreetmap.atlas.tags.HighwayTag;\n+import org.openstreetmap.atlas.utilities.configuration.Configuration;\n+import org.openstreetmap.atlas.utilities.scalars.Distance;\n+\n+/**\n+ * This check looks for duplicate edges or edge segments. One copy of the duplicate segment will be\n+ * flagged for review.\n+ *\n+ * @author savannahostrowski\n+ */\n+public class DuplicateWaysCheck extends BaseCheck\n+{\n+\n+    // You can use serialver to regenerate the serial UID.\n+    private static final long serialVersionUID = 1L;\n+\n+    public static final String DUPLICATE_EDGE_INSTRUCTIONS = \"This way, {0,number,#}, \"\n+            + \"at least one duplicate segment.\";\n+\n+    public static final List<String> FALLBACK_INSTRUCTIONS = Arrays\n+            .asList(DUPLICATE_EDGE_INSTRUCTIONS);\n+\n+    public static final int ZERO_LENGTH = 0;\n+    public static final String AREA_KEY = \"area\";\n+\n+\n+    // a map of segments and list of Edge identifiers\n+    private final Map<Segment, Set<Long>> globalSegments = new HashMap<>();","path":"src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/DuplicateWaysCheck.java","position":42,"original_position":42,"commit_id":"7bd7941b648e01e77807a9d4b6349ca19976a9b2","original_commit_id":"7bd7941b648e01e77807a9d4b6349ca19976a9b2","user":{"login":"danielduhh","id":1947857,"avatar_url":"https://avatars0.githubusercontent.com/u/1947857?v=4","gravatar_id":"","url":"https://api.github.com/users/danielduhh","html_url":"https://github.com/danielduhh","followers_url":"https://api.github.com/users/danielduhh/followers","following_url":"https://api.github.com/users/danielduhh/following{/other_user}","gists_url":"https://api.github.com/users/danielduhh/gists{/gist_id}","starred_url":"https://api.github.com/users/danielduhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielduhh/subscriptions","organizations_url":"https://api.github.com/users/danielduhh/orgs","repos_url":"https://api.github.com/users/danielduhh/repos","events_url":"https://api.github.com/users/danielduhh/events{/privacy}","received_events_url":"https://api.github.com/users/danielduhh/received_events","type":"User","site_admin":false},"body":"Whats the advantage of storing a `HashMap`? Couldn't we just create a `Set<Segment>` & add use .contains() to check if segment exists in `globalSegments`?","created_at":"2018-03-23T23:43:06Z","updated_at":"2018-03-23T23:43:52Z","html_url":"https://github.com/savannahostrowski/atlas-checks/pull/4#discussion_r176888616","pull_request_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/comments/176888616"},"html":{"href":"https://github.com/savannahostrowski/atlas-checks/pull/4#discussion_r176888616"},"pull_request":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4","id":175645165,"html_url":"https://github.com/savannahostrowski/atlas-checks/pull/4","diff_url":"https://github.com/savannahostrowski/atlas-checks/pull/4.diff","patch_url":"https://github.com/savannahostrowski/atlas-checks/pull/4.patch","issue_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/4","number":4,"state":"open","locked":false,"title":"Duplicate Ways Check","user":{"login":"savannahostrowski","id":8949415,"avatar_url":"https://avatars1.githubusercontent.com/u/8949415?v=4","gravatar_id":"","url":"https://api.github.com/users/savannahostrowski","html_url":"https://github.com/savannahostrowski","followers_url":"https://api.github.com/users/savannahostrowski/followers","following_url":"https://api.github.com/users/savannahostrowski/following{/other_user}","gists_url":"https://api.github.com/users/savannahostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/savannahostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savannahostrowski/subscriptions","organizations_url":"https://api.github.com/users/savannahostrowski/orgs","repos_url":"https://api.github.com/users/savannahostrowski/repos","events_url":"https://api.github.com/users/savannahostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/savannahostrowski/received_events","type":"User","site_admin":false},"body":"Still in the process of refactoring - please hold.","created_at":"2018-03-16T21:01:52Z","updated_at":"2018-03-23T23:43:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec4f0bd038349d7a0a01a0c689add7f607e51f77","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4/commits","review_comments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4/comments","review_comment_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/4/comments","statuses_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/statuses/7bd7941b648e01e77807a9d4b6349ca19976a9b2","head":{"label":"savannahostrowski:DuplicateWays","ref":"DuplicateWays","sha":"7bd7941b648e01e77807a9d4b6349ca19976a9b2","user":{"login":"savannahostrowski","id":8949415,"avatar_url":"https://avatars1.githubusercontent.com/u/8949415?v=4","gravatar_id":"","url":"https://api.github.com/users/savannahostrowski","html_url":"https://github.com/savannahostrowski","followers_url":"https://api.github.com/users/savannahostrowski/followers","following_url":"https://api.github.com/users/savannahostrowski/following{/other_user}","gists_url":"https://api.github.com/users/savannahostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/savannahostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savannahostrowski/subscriptions","organizations_url":"https://api.github.com/users/savannahostrowski/orgs","repos_url":"https://api.github.com/users/savannahostrowski/repos","events_url":"https://api.github.com/users/savannahostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/savannahostrowski/received_events","type":"User","site_admin":false},"repo":{"id":122137036,"name":"atlas-checks","full_name":"savannahostrowski/atlas-checks","owner":{"login":"savannahostrowski","id":8949415,"avatar_url":"https://avatars1.githubusercontent.com/u/8949415?v=4","gravatar_id":"","url":"https://api.github.com/users/savannahostrowski","html_url":"https://github.com/savannahostrowski","followers_url":"https://api.github.com/users/savannahostrowski/followers","following_url":"https://api.github.com/users/savannahostrowski/following{/other_user}","gists_url":"https://api.github.com/users/savannahostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/savannahostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savannahostrowski/subscriptions","organizations_url":"https://api.github.com/users/savannahostrowski/orgs","repos_url":"https://api.github.com/users/savannahostrowski/repos","events_url":"https://api.github.com/users/savannahostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/savannahostrowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/savannahostrowski/atlas-checks","description":"OSM data integrity checks with Atlas","fork":true,"url":"https://api.github.com/repos/savannahostrowski/atlas-checks","forks_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/forks","keys_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/teams","hooks_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/hooks","issue_events_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/events{/number}","events_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/events","assignees_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/assignees{/user}","branches_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/branches{/branch}","tags_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/tags","blobs_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/refs{/sha}","trees_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/statuses/{sha}","languages_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/languages","stargazers_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/stargazers","contributors_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/contributors","subscribers_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/subscribers","subscription_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/subscription","commits_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/commits{/sha}","git_commits_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/commits{/sha}","comments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/comments{/number}","issue_comment_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/comments{/number}","contents_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/contents/{+path}","compare_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/merges","archive_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/downloads","issues_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues{/number}","pulls_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls{/number}","milestones_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/milestones{/number}","notifications_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/labels{/name}","releases_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/releases{/id}","deployments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/deployments","created_at":"2018-02-20T00:08:59Z","updated_at":"2018-03-22T18:06:11Z","pushed_at":"2018-03-22T18:39:13Z","git_url":"git://github.com/savannahostrowski/atlas-checks.git","ssh_url":"git@github.com:savannahostrowski/atlas-checks.git","clone_url":"https://github.com/savannahostrowski/atlas-checks.git","svn_url":"https://github.com/savannahostrowski/atlas-checks","homepage":null,"size":58222,"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":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":2,"watchers":0,"default_branch":"dev"}},"base":{"label":"savannahostrowski:dev","ref":"dev","sha":"ad60e59f336f41cb6f9ccb3aa75209a646a000b5","user":{"login":"savannahostrowski","id":8949415,"avatar_url":"https://avatars1.githubusercontent.com/u/8949415?v=4","gravatar_id":"","url":"https://api.github.com/users/savannahostrowski","html_url":"https://github.com/savannahostrowski","followers_url":"https://api.github.com/users/savannahostrowski/followers","following_url":"https://api.github.com/users/savannahostrowski/following{/other_user}","gists_url":"https://api.github.com/users/savannahostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/savannahostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savannahostrowski/subscriptions","organizations_url":"https://api.github.com/users/savannahostrowski/orgs","repos_url":"https://api.github.com/users/savannahostrowski/repos","events_url":"https://api.github.com/users/savannahostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/savannahostrowski/received_events","type":"User","site_admin":false},"repo":{"id":122137036,"name":"atlas-checks","full_name":"savannahostrowski/atlas-checks","owner":{"login":"savannahostrowski","id":8949415,"avatar_url":"https://avatars1.githubusercontent.com/u/8949415?v=4","gravatar_id":"","url":"https://api.github.com/users/savannahostrowski","html_url":"https://github.com/savannahostrowski","followers_url":"https://api.github.com/users/savannahostrowski/followers","following_url":"https://api.github.com/users/savannahostrowski/following{/other_user}","gists_url":"https://api.github.com/users/savannahostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/savannahostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savannahostrowski/subscriptions","organizations_url":"https://api.github.com/users/savannahostrowski/orgs","repos_url":"https://api.github.com/users/savannahostrowski/repos","events_url":"https://api.github.com/users/savannahostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/savannahostrowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/savannahostrowski/atlas-checks","description":"OSM data integrity checks with Atlas","fork":true,"url":"https://api.github.com/repos/savannahostrowski/atlas-checks","forks_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/forks","keys_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/teams","hooks_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/hooks","issue_events_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/events{/number}","events_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/events","assignees_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/assignees{/user}","branches_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/branches{/branch}","tags_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/tags","blobs_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/refs{/sha}","trees_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/statuses/{sha}","languages_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/languages","stargazers_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/stargazers","contributors_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/contributors","subscribers_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/subscribers","subscription_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/subscription","commits_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/commits{/sha}","git_commits_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/git/commits{/sha}","comments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/comments{/number}","issue_comment_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/comments{/number}","contents_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/contents/{+path}","compare_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/merges","archive_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/downloads","issues_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues{/number}","pulls_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls{/number}","milestones_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/milestones{/number}","notifications_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/labels{/name}","releases_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/releases{/id}","deployments_url":"https://api.github.com/repos/savannahostrowski/atlas-checks/deployments","created_at":"2018-02-20T00:08:59Z","updated_at":"2018-03-22T18:06:11Z","pushed_at":"2018-03-22T18:39:13Z","git_url":"git://github.com/savannahostrowski/atlas-checks.git","ssh_url":"git@github.com:savannahostrowski/atlas-checks.git","clone_url":"https://github.com/savannahostrowski/atlas-checks.git","svn_url":"https://github.com/savannahostrowski/atlas-checks","homepage":null,"size":58222,"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":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":2,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4"},"html":{"href":"https://github.com/savannahostrowski/atlas-checks/pull/4"},"issue":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/4"},"comments":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/savannahostrowski/atlas-checks/statuses/7bd7941b648e01e77807a9d4b6349ca19976a9b2"}},"author_association":"OWNER"}}
{"actor":{"display_login":"danielduhh"}}