{"action":"closed","number":130,"pull_request":{"url":"https://api.github.com/repos/hyperledger/quilt/pulls/130","id":175717314,"html_url":"https://github.com/hyperledger/quilt/pull/130","diff_url":"https://github.com/hyperledger/quilt/pull/130.diff","patch_url":"https://github.com/hyperledger/quilt/pull/130.patch","issue_url":"https://api.github.com/repos/hyperledger/quilt/issues/130","number":130,"state":"closed","locked":false,"title":"Feature/npe enforcements","user":{"login":"sappenin","id":323659,"avatar_url":"https://avatars1.githubusercontent.com/u/323659?v=4","gravatar_id":"","url":"https://api.github.com/users/sappenin","html_url":"https://github.com/sappenin","followers_url":"https://api.github.com/users/sappenin/followers","following_url":"https://api.github.com/users/sappenin/following{/other_user}","gists_url":"https://api.github.com/users/sappenin/gists{/gist_id}","starred_url":"https://api.github.com/users/sappenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sappenin/subscriptions","organizations_url":"https://api.github.com/users/sappenin/orgs","repos_url":"https://api.github.com/users/sappenin/repos","events_url":"https://api.github.com/users/sappenin/events{/privacy}","received_events_url":"https://api.github.com/users/sappenin/received_events","type":"User","site_admin":false},"body":"_**NOTE: This PR incorporates #129, which is purely Javadoc and formatting, so it might be easier to review that PR first before looking at this one.**_\r\n\r\nThis PR simplifies the AddressParser by restoring all null-input invariant checks back into the InterledgerAddress. By not allowing `null` into the AddressParser by design, it no longer must account for multi-error conditions related to `null` values, and can focus on its core purpose, which is validity checks on non-null input.\r\n\r\nA more detailed rationale:\r\n1. AddressParser should not be doing any null-check enforcement, because InterledgerAddress itself should enforce the non-use of `null` as a developer error. In other words, there is a distinction between `null` making its way into an `InterledgerAddress` and some non-null String input that simply doesn't rise to the bar enforced by IL-RFC-15.\r\n\r\n2. Once the parser becomes responsible for address content and formation checking only, it is somewhat simplified. The 4 `InterledgerAddress#require` methods no longer need to delegate to `AddressParser` because the logic is not complicated enough to justify the delegation.\r\n\r\n3. Once moved back into InterledgerAddress, these implementations do not share any code between themselves (i.e., the two `requireAddressPrefix` methods are slightly duplicative, and the two `requireNotAddressPrefix` methods are also slightly duplicative). In each case, this is for performance reasons -- for example, we might be tempted to have `requireAddressPrefix(address)` delegate to `requireAddressPrefix(address, message)` with a default `message`. However, the happy-path usage of this call-chain would compute a new String for the error message, which would be different for every check of every ILP address in a system, and 99% of the time this String allocation would be unnecessary. In other words, we only want to assemble an error-string (with an ILP address inside) _if_ the method will actually throw an Exception. Thus, we optimize for the happy-path and duplicate the `if` check.\r\n\r\n@pascalav @adrianhopebailie \r\n","created_at":"2018-03-17T19:33:58Z","updated_at":"2018-03-19T12:43:28Z","closed_at":"2018-03-19T12:43:28Z","merged_at":"2018-03-19T12:43:28Z","merge_commit_sha":"b0497ff75136a16e32a0336950c88d36e590e39e","assignee":{"login":"adrianhopebailie","id":49902,"avatar_url":"https://avatars2.githubusercontent.com/u/49902?v=4","gravatar_id":"","url":"https://api.github.com/users/adrianhopebailie","html_url":"https://github.com/adrianhopebailie","followers_url":"https://api.github.com/users/adrianhopebailie/followers","following_url":"https://api.github.com/users/adrianhopebailie/following{/other_user}","gists_url":"https://api.github.com/users/adrianhopebailie/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianhopebailie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianhopebailie/subscriptions","organizations_url":"https://api.github.com/users/adrianhopebailie/orgs","repos_url":"https://api.github.com/users/adrianhopebailie/repos","events_url":"https://api.github.com/users/adrianhopebailie/events{/privacy}","received_events_url":"https://api.github.com/users/adrianhopebailie/received_events","type":"User","site_admin":false},"assignees":[{"login":"adrianhopebailie","id":49902,"avatar_url":"https://avatars2.githubusercontent.com/u/49902?v=4","gravatar_id":"","url":"https://api.github.com/users/adrianhopebailie","html_url":"https://github.com/adrianhopebailie","followers_url":"https://api.github.com/users/adrianhopebailie/followers","following_url":"https://api.github.com/users/adrianhopebailie/following{/other_user}","gists_url":"https://api.github.com/users/adrianhopebailie/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianhopebailie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianhopebailie/subscriptions","organizations_url":"https://api.github.com/users/adrianhopebailie/orgs","repos_url":"https://api.github.com/users/adrianhopebailie/repos","events_url":"https://api.github.com/users/adrianhopebailie/events{/privacy}","received_events_url":"https://api.github.com/users/adrianhopebailie/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":724808996,"url":"https://api.github.com/repos/hyperledger/quilt/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":729162342,"url":"https://api.github.com/repos/hyperledger/quilt/labels/ilp-core","name":"ilp-core","color":"1d76db","default":false},{"id":837359984,"url":"https://api.github.com/repos/hyperledger/quilt/labels/v1.0","name":"v1.0","color":"17b77d","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/quilt/pulls/130/commits","review_comments_url":"https://api.github.com/repos/hyperledger/quilt/pulls/130/comments","review_comment_url":"https://api.github.com/repos/hyperledger/quilt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/quilt/issues/130/comments","statuses_url":"https://api.github.com/repos/hyperledger/quilt/statuses/6593dc893f422b78cd709de7509dc59497e70735","head":{"label":"hyperledger:feature/npe-enforcements","ref":"feature/npe-enforcements","sha":"6593dc893f422b78cd709de7509dc59497e70735","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":107554429,"name":"quilt","full_name":"hyperledger/quilt","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperledger/quilt","description":"Hyperledger Quilt - An implementation of the Interledger Protocol","fork":false,"url":"https://api.github.com/repos/hyperledger/quilt","forks_url":"https://api.github.com/repos/hyperledger/quilt/forks","keys_url":"https://api.github.com/repos/hyperledger/quilt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/quilt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/quilt/teams","hooks_url":"https://api.github.com/repos/hyperledger/quilt/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/quilt/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/quilt/events","assignees_url":"https://api.github.com/repos/hyperledger/quilt/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/quilt/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/quilt/tags","blobs_url":"https://api.github.com/repos/hyperledger/quilt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/quilt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/quilt/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/quilt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/quilt/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/quilt/languages","stargazers_url":"https://api.github.com/repos/hyperledger/quilt/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/quilt/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/quilt/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/quilt/subscription","commits_url":"https://api.github.com/repos/hyperledger/quilt/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/quilt/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/quilt/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/quilt/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/quilt/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/quilt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/quilt/merges","archive_url":"https://api.github.com/repos/hyperledger/quilt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/quilt/downloads","issues_url":"https://api.github.com/repos/hyperledger/quilt/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/quilt/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/quilt/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/quilt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/quilt/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/quilt/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/quilt/deployments","created_at":"2017-10-19T14:04:41Z","updated_at":"2018-03-19T12:36:43Z","pushed_at":"2018-03-19T12:43:28Z","git_url":"git://github.com/hyperledger/quilt.git","ssh_url":"git@github.com:hyperledger/quilt.git","clone_url":"https://github.com/hyperledger/quilt.git","svn_url":"https://github.com/hyperledger/quilt","homepage":"https://interledger.org","size":686,"stargazers_count":70,"watchers_count":70,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":40,"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":29,"open_issues":40,"watchers":70,"default_branch":"master"}},"base":{"label":"hyperledger:master","ref":"master","sha":"07e1c5291724496d357e8399dc2696a5ea5bae1d","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":107554429,"name":"quilt","full_name":"hyperledger/quilt","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperledger/quilt","description":"Hyperledger Quilt - An implementation of the Interledger Protocol","fork":false,"url":"https://api.github.com/repos/hyperledger/quilt","forks_url":"https://api.github.com/repos/hyperledger/quilt/forks","keys_url":"https://api.github.com/repos/hyperledger/quilt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/quilt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/quilt/teams","hooks_url":"https://api.github.com/repos/hyperledger/quilt/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/quilt/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/quilt/events","assignees_url":"https://api.github.com/repos/hyperledger/quilt/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/quilt/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/quilt/tags","blobs_url":"https://api.github.com/repos/hyperledger/quilt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/quilt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/quilt/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/quilt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/quilt/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/quilt/languages","stargazers_url":"https://api.github.com/repos/hyperledger/quilt/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/quilt/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/quilt/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/quilt/subscription","commits_url":"https://api.github.com/repos/hyperledger/quilt/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/quilt/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/quilt/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/quilt/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/quilt/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/quilt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/quilt/merges","archive_url":"https://api.github.com/repos/hyperledger/quilt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/quilt/downloads","issues_url":"https://api.github.com/repos/hyperledger/quilt/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/quilt/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/quilt/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/quilt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/quilt/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/quilt/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/quilt/deployments","created_at":"2017-10-19T14:04:41Z","updated_at":"2018-03-19T12:36:43Z","pushed_at":"2018-03-19T12:43:28Z","git_url":"git://github.com/hyperledger/quilt.git","ssh_url":"git@github.com:hyperledger/quilt.git","clone_url":"https://github.com/hyperledger/quilt.git","svn_url":"https://github.com/hyperledger/quilt","homepage":"https://interledger.org","size":686,"stargazers_count":70,"watchers_count":70,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":40,"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":29,"open_issues":40,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/quilt/pulls/130"},"html":{"href":"https://github.com/hyperledger/quilt/pull/130"},"issue":{"href":"https://api.github.com/repos/hyperledger/quilt/issues/130"},"comments":{"href":"https://api.github.com/repos/hyperledger/quilt/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/quilt/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/quilt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/quilt/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/quilt/statuses/6593dc893f422b78cd709de7509dc59497e70735"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"adrianhopebailie","id":49902,"avatar_url":"https://avatars2.githubusercontent.com/u/49902?v=4","gravatar_id":"","url":"https://api.github.com/users/adrianhopebailie","html_url":"https://github.com/adrianhopebailie","followers_url":"https://api.github.com/users/adrianhopebailie/followers","following_url":"https://api.github.com/users/adrianhopebailie/following{/other_user}","gists_url":"https://api.github.com/users/adrianhopebailie/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianhopebailie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianhopebailie/subscriptions","organizations_url":"https://api.github.com/users/adrianhopebailie/orgs","repos_url":"https://api.github.com/users/adrianhopebailie/repos","events_url":"https://api.github.com/users/adrianhopebailie/events{/privacy}","received_events_url":"https://api.github.com/users/adrianhopebailie/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":183,"deletions":320,"changed_files":4}}
{"actor":{"display_login":"adrianhopebailie"}}