{"action":"created","issue":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/1151","repository_url":"https://api.github.com/repos/typetools/checker-framework","labels_url":"https://api.github.com/repos/typetools/checker-framework/issues/1151/labels{/name}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/1151/comments","events_url":"https://api.github.com/repos/typetools/checker-framework/issues/1151/events","html_url":"https://github.com/typetools/checker-framework/issues/1151","id":215206028,"number":1151,"title":"Missing error reporting in identityHashCode() for Value-based Classes  ","user":{"login":"nikshinde1996","id":14020181,"avatar_url":"https://avatars1.githubusercontent.com/u/14020181?v=3","gravatar_id":"","url":"https://api.github.com/users/nikshinde1996","html_url":"https://github.com/nikshinde1996","followers_url":"https://api.github.com/users/nikshinde1996/followers","following_url":"https://api.github.com/users/nikshinde1996/following{/other_user}","gists_url":"https://api.github.com/users/nikshinde1996/gists{/gist_id}","starred_url":"https://api.github.com/users/nikshinde1996/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikshinde1996/subscriptions","organizations_url":"https://api.github.com/users/nikshinde1996/orgs","repos_url":"https://api.github.com/users/nikshinde1996/repos","events_url":"https://api.github.com/users/nikshinde1996/events{/privacy}","received_events_url":"https://api.github.com/users/nikshinde1996/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-03-18T16:48:12Z","updated_at":"2017-03-19T16:54:29Z","closed_at":"2017-03-19T16:54:29Z","body":"Consider \r\n\r\n```\r\npublic class TestClass<T> {\r\n\tOptional<T> optional;\r\n\tOptional<T> optional1;\r\n\t\r\n\tpublic boolean Compare(TestClass<T> t){\r\n\t\treturn t.optional.hashCode() == t.optional1.hashCode();\t\t\r\n\t}\r\n}\r\n```\r\nSome classes, such as java.util.Optional and java.time.LocalDateTime, are value-based. Use of identity-sensitive operations like reference equality (==) between instances, identity hash code of instances, or synchronization on an instances's intrinsic lock on instances of value-based classes may have unpredictable effects and should be avoided.\r\n\r\nError reporting should be done if identity-sensitive operators try to operate on them.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/comments/287630169","html_url":"https://github.com/typetools/checker-framework/issues/1151#issuecomment-287630169","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/1151","id":287630169,"user":{"login":"mernst","id":121025,"avatar_url":"https://avatars1.githubusercontent.com/u/121025?v=3","gravatar_id":"","url":"https://api.github.com/users/mernst","html_url":"https://github.com/mernst","followers_url":"https://api.github.com/users/mernst/followers","following_url":"https://api.github.com/users/mernst/following{/other_user}","gists_url":"https://api.github.com/users/mernst/gists{/gist_id}","starred_url":"https://api.github.com/users/mernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mernst/subscriptions","organizations_url":"https://api.github.com/users/mernst/orgs","repos_url":"https://api.github.com/users/mernst/repos","events_url":"https://api.github.com/users/mernst/events{/privacy}","received_events_url":"https://api.github.com/users/mernst/received_events","type":"User","site_admin":false},"created_at":"2017-03-19T16:54:29Z","updated_at":"2017-03-19T16:54:29Z","body":"Great, thanks for clarifying.  I agree this is worthwhile.  (I think it would be even better, if possible, to do the whole thing.)\r\n\r\nWe don't need a new issue in the issue tracker for a subset of an existing proposal, so I will close this for now.  Feel free to open a pull request with a solution."}}
{"actor":{"display_login":"mernst"}}