{"action":"created","comment":{"url":"https://api.github.com/repos/OSGP/Platform/pulls/comments/51132121","id":51132121,"diff_hunk":"@@ -357,12 +343,7 @@ public final Long getVersion() {\n \n     @Override\n     public int hashCode() {\n-        int result = this.deviceIdentification != null ? this.deviceIdentification.hashCode() : 0;\n-        result = 31 * result + (this.deviceType != null ? this.deviceType.hashCode() : 0);\n-        result = 31 * result + (this.networkAddress != null ? this.networkAddress.hashCode() : 0);\n-        result = 31 * result + (this.isActivated ? 1 : 0);\n-        result = 31 * result + (this.authorizations != null ? this.authorizations.hashCode() : 0);\n-        return result;\n+        return this.deviceIdentification != null ? this.deviceIdentification.hashCode() : 0;","path":"osgp-domain-core/src/main/java/com/alliander/osgp/domain/core/entities/Device.java","position":35,"original_position":35,"commit_id":"cdf3d01c9d0684b291e2c07dc1ca2251fa438318","original_commit_id":"cdf3d01c9d0684b291e2c07dc1ca2251fa438318","user":{"login":"bvdzwet","id":14938953,"avatar_url":"https://avatars.githubusercontent.com/u/14938953?v=3","gravatar_id":"","url":"https://api.github.com/users/bvdzwet","html_url":"https://github.com/bvdzwet","followers_url":"https://api.github.com/users/bvdzwet/followers","following_url":"https://api.github.com/users/bvdzwet/following{/other_user}","gists_url":"https://api.github.com/users/bvdzwet/gists{/gist_id}","starred_url":"https://api.github.com/users/bvdzwet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvdzwet/subscriptions","organizations_url":"https://api.github.com/users/bvdzwet/orgs","repos_url":"https://api.github.com/users/bvdzwet/repos","events_url":"https://api.github.com/users/bvdzwet/events{/privacy}","received_events_url":"https://api.github.com/users/bvdzwet/received_events","type":"User","site_admin":false},"body":"Like with the equals, this hashCode looks fine, but take a look if you'd prefer:\r\n`return Objects.hashCode(this.deviceIdentification);` here to match the equals.","created_at":"2016-01-28T14:57:02Z","updated_at":"2016-01-28T14:57:02Z","html_url":"https://github.com/OSGP/Platform/pull/324#discussion_r51132121","pull_request_url":"https://api.github.com/repos/OSGP/Platform/pulls/324","_links":{"self":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/comments/51132121"},"html":{"href":"https://github.com/OSGP/Platform/pull/324#discussion_r51132121"},"pull_request":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/324"}}},"pull_request":{"url":"https://api.github.com/repos/OSGP/Platform/pulls/324","id":57506742,"html_url":"https://github.com/OSGP/Platform/pull/324","diff_url":"https://github.com/OSGP/Platform/pull/324.diff","patch_url":"https://github.com/OSGP/Platform/pull/324.patch","issue_url":"https://api.github.com/repos/OSGP/Platform/issues/324","number":324,"state":"open","locked":false,"title":"Reimplements hashCode() and equals() functions for domain entities. FLEX-1377","user":{"login":"kevinsmeets","id":11557950,"avatar_url":"https://avatars.githubusercontent.com/u/11557950?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinsmeets","html_url":"https://github.com/kevinsmeets","followers_url":"https://api.github.com/users/kevinsmeets/followers","following_url":"https://api.github.com/users/kevinsmeets/following{/other_user}","gists_url":"https://api.github.com/users/kevinsmeets/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinsmeets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinsmeets/subscriptions","organizations_url":"https://api.github.com/users/kevinsmeets/orgs","repos_url":"https://api.github.com/users/kevinsmeets/repos","events_url":"https://api.github.com/users/kevinsmeets/events{/privacy}","received_events_url":"https://api.github.com/users/kevinsmeets/received_events","type":"User","site_admin":false},"body":"- domain entities should only use business key values, not collections or object identifiers to calculate a hash\r\n- see: https://developer.jboss.org/wiki/EqualsAndHashCode?_sscc=t","created_at":"2016-01-28T14:11:45Z","updated_at":"2016-01-28T14:57:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"758577b0a0ddcc36830967b10dd170053cf11999","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OSGP/Platform/pulls/324/commits","review_comments_url":"https://api.github.com/repos/OSGP/Platform/pulls/324/comments","review_comment_url":"https://api.github.com/repos/OSGP/Platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OSGP/Platform/issues/324/comments","statuses_url":"https://api.github.com/repos/OSGP/Platform/statuses/cdf3d01c9d0684b291e2c07dc1ca2251fa438318","head":{"label":"OSGP:feat-hash-equals-for-entities","ref":"feat-hash-equals-for-entities","sha":"cdf3d01c9d0684b291e2c07dc1ca2251fa438318","user":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"repo":{"id":32739388,"name":"Platform","full_name":"OSGP/Platform","owner":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OSGP/Platform","description":"The main components of OSGP.","fork":false,"url":"https://api.github.com/repos/OSGP/Platform","forks_url":"https://api.github.com/repos/OSGP/Platform/forks","keys_url":"https://api.github.com/repos/OSGP/Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OSGP/Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OSGP/Platform/teams","hooks_url":"https://api.github.com/repos/OSGP/Platform/hooks","issue_events_url":"https://api.github.com/repos/OSGP/Platform/issues/events{/number}","events_url":"https://api.github.com/repos/OSGP/Platform/events","assignees_url":"https://api.github.com/repos/OSGP/Platform/assignees{/user}","branches_url":"https://api.github.com/repos/OSGP/Platform/branches{/branch}","tags_url":"https://api.github.com/repos/OSGP/Platform/tags","blobs_url":"https://api.github.com/repos/OSGP/Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OSGP/Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OSGP/Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/OSGP/Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OSGP/Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/OSGP/Platform/languages","stargazers_url":"https://api.github.com/repos/OSGP/Platform/stargazers","contributors_url":"https://api.github.com/repos/OSGP/Platform/contributors","subscribers_url":"https://api.github.com/repos/OSGP/Platform/subscribers","subscription_url":"https://api.github.com/repos/OSGP/Platform/subscription","commits_url":"https://api.github.com/repos/OSGP/Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/OSGP/Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/OSGP/Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/OSGP/Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/OSGP/Platform/contents/{+path}","compare_url":"https://api.github.com/repos/OSGP/Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OSGP/Platform/merges","archive_url":"https://api.github.com/repos/OSGP/Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OSGP/Platform/downloads","issues_url":"https://api.github.com/repos/OSGP/Platform/issues{/number}","pulls_url":"https://api.github.com/repos/OSGP/Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/OSGP/Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/OSGP/Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OSGP/Platform/labels{/name}","releases_url":"https://api.github.com/repos/OSGP/Platform/releases{/id}","deployments_url":"https://api.github.com/repos/OSGP/Platform/deployments","created_at":"2015-03-23T15:05:40Z","updated_at":"2016-01-18T13:43:25Z","pushed_at":"2016-01-28T14:11:45Z","git_url":"git://github.com/OSGP/Platform.git","ssh_url":"git@github.com:OSGP/Platform.git","clone_url":"https://github.com/OSGP/Platform.git","svn_url":"https://github.com/OSGP/Platform","homepage":null,"size":24924,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":69,"forks":3,"open_issues":69,"watchers":6,"default_branch":"development"}},"base":{"label":"OSGP:development","ref":"development","sha":"809dbc5e2e4b5ee90e73a9f5aef0579e40613000","user":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"repo":{"id":32739388,"name":"Platform","full_name":"OSGP/Platform","owner":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OSGP/Platform","description":"The main components of OSGP.","fork":false,"url":"https://api.github.com/repos/OSGP/Platform","forks_url":"https://api.github.com/repos/OSGP/Platform/forks","keys_url":"https://api.github.com/repos/OSGP/Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OSGP/Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OSGP/Platform/teams","hooks_url":"https://api.github.com/repos/OSGP/Platform/hooks","issue_events_url":"https://api.github.com/repos/OSGP/Platform/issues/events{/number}","events_url":"https://api.github.com/repos/OSGP/Platform/events","assignees_url":"https://api.github.com/repos/OSGP/Platform/assignees{/user}","branches_url":"https://api.github.com/repos/OSGP/Platform/branches{/branch}","tags_url":"https://api.github.com/repos/OSGP/Platform/tags","blobs_url":"https://api.github.com/repos/OSGP/Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OSGP/Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OSGP/Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/OSGP/Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OSGP/Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/OSGP/Platform/languages","stargazers_url":"https://api.github.com/repos/OSGP/Platform/stargazers","contributors_url":"https://api.github.com/repos/OSGP/Platform/contributors","subscribers_url":"https://api.github.com/repos/OSGP/Platform/subscribers","subscription_url":"https://api.github.com/repos/OSGP/Platform/subscription","commits_url":"https://api.github.com/repos/OSGP/Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/OSGP/Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/OSGP/Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/OSGP/Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/OSGP/Platform/contents/{+path}","compare_url":"https://api.github.com/repos/OSGP/Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OSGP/Platform/merges","archive_url":"https://api.github.com/repos/OSGP/Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OSGP/Platform/downloads","issues_url":"https://api.github.com/repos/OSGP/Platform/issues{/number}","pulls_url":"https://api.github.com/repos/OSGP/Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/OSGP/Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/OSGP/Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OSGP/Platform/labels{/name}","releases_url":"https://api.github.com/repos/OSGP/Platform/releases{/id}","deployments_url":"https://api.github.com/repos/OSGP/Platform/deployments","created_at":"2015-03-23T15:05:40Z","updated_at":"2016-01-18T13:43:25Z","pushed_at":"2016-01-28T14:11:45Z","git_url":"git://github.com/OSGP/Platform.git","ssh_url":"git@github.com:OSGP/Platform.git","clone_url":"https://github.com/OSGP/Platform.git","svn_url":"https://github.com/OSGP/Platform","homepage":null,"size":24924,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":69,"forks":3,"open_issues":69,"watchers":6,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/324"},"html":{"href":"https://github.com/OSGP/Platform/pull/324"},"issue":{"href":"https://api.github.com/repos/OSGP/Platform/issues/324"},"comments":{"href":"https://api.github.com/repos/OSGP/Platform/issues/324/comments"},"review_comments":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/324/comments"},"review_comment":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OSGP/Platform/pulls/324/commits"},"statuses":{"href":"https://api.github.com/repos/OSGP/Platform/statuses/cdf3d01c9d0684b291e2c07dc1ca2251fa438318"}}}}