{"action":"created","issue":{"url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/610","repository_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo","labels_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/610/labels{/name}","comments_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/610/comments","events_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/610/events","html_url":"https://github.com/joelittlejohn/jsonschema2pojo/issues/610","id":171184449,"number":610,"title":"equals and hashcode invokes super even if superclass has no fields","user":{"login":"ashish-sharma09","id":5764596,"avatar_url":"https://avatars.githubusercontent.com/u/5764596?v=3","gravatar_id":"","url":"https://api.github.com/users/ashish-sharma09","html_url":"https://github.com/ashish-sharma09","followers_url":"https://api.github.com/users/ashish-sharma09/followers","following_url":"https://api.github.com/users/ashish-sharma09/following{/other_user}","gists_url":"https://api.github.com/users/ashish-sharma09/gists{/gist_id}","starred_url":"https://api.github.com/users/ashish-sharma09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashish-sharma09/subscriptions","organizations_url":"https://api.github.com/users/ashish-sharma09/orgs","repos_url":"https://api.github.com/users/ashish-sharma09/repos","events_url":"https://api.github.com/users/ashish-sharma09/events{/privacy}","received_events_url":"https://api.github.com/users/ashish-sharma09/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-15T14:43:43Z","updated_at":"2016-08-16T15:02:26Z","closed_at":null,"body":"I can see in the previous pull requests that it was fixed to invoke super equals and hashcode due to older versions not doing the same. This is working all right except for the case (as ours) where top most class in the hierarchy has no fields hence no equals and hashcode implementation generated for the same and the immediate childs of this class ends up calling Objects equals and hashcode which in effect nullifies everything if not comparing same instances.\r\n\r\nDue to this issue we are not able to use the latest version of the library. Can this be looked into as soon as possible?\r\n\r\nMany thanks and let me know if there are any questions with regard to the same."},"comment":{"url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/comments/240130049","html_url":"https://github.com/joelittlejohn/jsonschema2pojo/issues/610#issuecomment-240130049","issue_url":"https://api.github.com/repos/joelittlejohn/jsonschema2pojo/issues/610","id":240130049,"user":{"login":"thachhoang","id":1286583,"avatar_url":"https://avatars.githubusercontent.com/u/1286583?v=3","gravatar_id":"","url":"https://api.github.com/users/thachhoang","html_url":"https://github.com/thachhoang","followers_url":"https://api.github.com/users/thachhoang/followers","following_url":"https://api.github.com/users/thachhoang/following{/other_user}","gists_url":"https://api.github.com/users/thachhoang/gists{/gist_id}","starred_url":"https://api.github.com/users/thachhoang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thachhoang/subscriptions","organizations_url":"https://api.github.com/users/thachhoang/orgs","repos_url":"https://api.github.com/users/thachhoang/repos","events_url":"https://api.github.com/users/thachhoang/events{/privacy}","received_events_url":"https://api.github.com/users/thachhoang/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T15:02:26Z","updated_at":"2016-08-16T15:02:26Z","body":"ObjectRule does [check for Object superclasses](https://github.com/joelittlejohn/jsonschema2pojo/blob/47ba591d1128c45e0731ab615ef7a455b6a1ab37/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ObjectRule.java#L531).\r\n\r\nObject.equals will be used if the root class does not have any fields (e.g. `includeAdditionalProperties` set to false) and does not override equals. We can fix this by checking if equals is overridden at any ancestor of a class before using super.equals. We can follow JClass._extends all the way up to Object.\r\n\r\nThat leaves one edge case: what should the library do if any generated class inherits from an existing non-Object class (because of `javaType`)?"}}
{"actor":{"display_login":"thachhoang"}}