{"action":"created","issue":{"url":"https://api.github.com/repos/imglib/imglib2/issues/225","repository_url":"https://api.github.com/repos/imglib/imglib2","labels_url":"https://api.github.com/repos/imglib/imglib2/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/imglib/imglib2/issues/225/comments","events_url":"https://api.github.com/repos/imglib/imglib2/issues/225/events","html_url":"https://github.com/imglib/imglib2/pull/225","id":349109414,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MzAyMDI3","number":225,"title":"Add ARGBType::equals","user":{"login":"maarzt","id":24407711,"node_id":"MDQ6VXNlcjI0NDA3NzEx","avatar_url":"https://avatars1.githubusercontent.com/u/24407711?v=4","gravatar_id":"","url":"https://api.github.com/users/maarzt","html_url":"https://github.com/maarzt","followers_url":"https://api.github.com/users/maarzt/followers","following_url":"https://api.github.com/users/maarzt/following{/other_user}","gists_url":"https://api.github.com/users/maarzt/gists{/gist_id}","starred_url":"https://api.github.com/users/maarzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maarzt/subscriptions","organizations_url":"https://api.github.com/users/maarzt/orgs","repos_url":"https://api.github.com/users/maarzt/repos","events_url":"https://api.github.com/users/maarzt/events{/privacy}","received_events_url":"https://api.github.com/users/maarzt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-08-09T12:38:08Z","updated_at":"2018-08-20T15:59:00Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/imglib/imglib2/pulls/225","html_url":"https://github.com/imglib/imglib2/pull/225","diff_url":"https://github.com/imglib/imglib2/pull/225.diff","patch_url":"https://github.com/imglib/imglib2/pull/225.patch"},"body":"There's some surprising behavior with imglib2 types:\r\n* `new IntType(5).equals(new IntType(5)) == true`\r\n* `new ARGBType(5).equals(new ARGBType(5)) == false`\r\n\r\nThis is because ARGBType misses a implementation vor Object::equals.\r\n\r\nThis PR does the following:\r\n* Add proper implementations for Object::equals to all NumericTypes, including ARGBType.\r\n* Add unit test, to test all implementations of NumericType for their basic functionality."},"comment":{"url":"https://api.github.com/repos/imglib/imglib2/issues/comments/414369293","html_url":"https://github.com/imglib/imglib2/pull/225#issuecomment-414369293","issue_url":"https://api.github.com/repos/imglib/imglib2/issues/225","id":414369293,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDM2OTI5Mw==","user":{"login":"maarzt","id":24407711,"node_id":"MDQ6VXNlcjI0NDA3NzEx","avatar_url":"https://avatars1.githubusercontent.com/u/24407711?v=4","gravatar_id":"","url":"https://api.github.com/users/maarzt","html_url":"https://github.com/maarzt","followers_url":"https://api.github.com/users/maarzt/followers","following_url":"https://api.github.com/users/maarzt/following{/other_user}","gists_url":"https://api.github.com/users/maarzt/gists{/gist_id}","starred_url":"https://api.github.com/users/maarzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maarzt/subscriptions","organizations_url":"https://api.github.com/users/maarzt/orgs","repos_url":"https://api.github.com/users/maarzt/repos","events_url":"https://api.github.com/users/maarzt/events{/privacy}","received_events_url":"https://api.github.com/users/maarzt/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T15:59:00Z","updated_at":"2018-08-20T15:59:00Z","author_association":"CONTRIBUTOR","body":"I think we should add the implementation for `equals` and `hashCode`. Otherwise this would be a missing functionality. @tpietzsch also agreed with the following argument:\r\n\r\nImglib2 does a great effort and introduces `IntergerType`, `DoubleType` and all the others. Because Java's primitive types and boxed types just don't work for image processing algorithms. It's imglib2's goal to enable fast and generic algorithms in Java. And it does a great job. **But what if such generic algorithm needs a `Set` or a `Map`???**... It would be super nasty without implementations of `hashCode` and `equals`.\r\n\r\n(The user is forced to replace the missing `hashCode` and `equals` method. Write wrappers for all types. Or write a `Map` that could be used for all imglib2 types. Both tasks are to difficult for many users.\r\nMost users will just implement, stop writing generic algorithm or do a nasty hack, that breaks way to often, and has bad performance. )"}}
{"actor":{"display_login":"maarzt"}}