{"action":"opened","issue":{"url":"https://api.github.com/repos/danielwegener/xjc-guava-plugin/issues/7","repository_url":"https://api.github.com/repos/danielwegener/xjc-guava-plugin","labels_url":"https://api.github.com/repos/danielwegener/xjc-guava-plugin/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/danielwegener/xjc-guava-plugin/issues/7/comments","events_url":"https://api.github.com/repos/danielwegener/xjc-guava-plugin/issues/7/events","html_url":"https://github.com/danielwegener/xjc-guava-plugin/issues/7","id":148831724,"number":7,"title":"Private fields with accessible getters don't work","user":{"login":"afdia","id":8770707,"avatar_url":"https://avatars.githubusercontent.com/u/8770707?v=3","gravatar_id":"","url":"https://api.github.com/users/afdia","html_url":"https://github.com/afdia","followers_url":"https://api.github.com/users/afdia/followers","following_url":"https://api.github.com/users/afdia/following{/other_user}","gists_url":"https://api.github.com/users/afdia/gists{/gist_id}","starred_url":"https://api.github.com/users/afdia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afdia/subscriptions","organizations_url":"https://api.github.com/users/afdia/orgs","repos_url":"https://api.github.com/users/afdia/repos","events_url":"https://api.github.com/users/afdia/events{/privacy}","received_events_url":"https://api.github.com/users/afdia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-16T08:29:22Z","updated_at":"2016-04-16T08:29:22Z","closed_at":null,"body":"The problem can be reproduced with any xsd which contains a complexTypes with\r\n`<xs:anyAttribute namespace=\"##any\" processContents=\"lax\"/>`\r\nand there are other complexTypes which extend those.\r\n\r\nJAXB generates the following code for the `<xs:anyAttribute namespace=\"##any\" processContents=\"lax\"/>` definition:\r\n```\r\n@XmlAnyAttribute\r\nprivate Map<QName, String> otherAttributes = new HashMap<QName, String>();\r\n...\r\npublic Map<QName, String> getOtherAttributes() {\r\n    return otherAttributes;\r\n}\r\n```\r\nThe problem is that your plugin directly accesses the fields which only works for the top level class but not for the subclasses which cannot access the private field directly (for whatever reason JAXB is making this field private and not protected like the others)\r\n\r\nThe result is that hashcode+equals of subclasses include a non-accessible private field in their generated code which causes a compile error in the generated class.\r\n\r\nPerhaps this can be fixed by always using the getters or by trying to find a getter if the field itself is not accessible (as a kind of fallback mechanism)\r\n\r\nIn my case I do not need this plugin for this specific xsd so I can live with the current behavior, but I still wanted to report the issue to let you (and other users) know it exists."}}