{"action":"created","issue":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/442","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/442/comments","events_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/442/events","html_url":"https://github.com/mapstruct/mapstruct/issues/442","id":56507345,"number":442,"title":"Error: java: variable address is already defined","user":{"login":"natros","id":4996289,"avatar_url":"https://avatars.githubusercontent.com/u/4996289?v=3","gravatar_id":"","url":"https://api.github.com/users/natros","html_url":"https://github.com/natros","followers_url":"https://api.github.com/users/natros/followers","following_url":"https://api.github.com/users/natros/following{/other_user}","gists_url":"https://api.github.com/users/natros/gists{/gist_id}","starred_url":"https://api.github.com/users/natros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natros/subscriptions","organizations_url":"https://api.github.com/users/natros/orgs","repos_url":"https://api.github.com/users/natros/repos","events_url":"https://api.github.com/users/natros/events{/privacy}","received_events_url":"https://api.github.com/users/natros/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-04T10:11:49Z","updated_at":"2015-02-04T13:05:32Z","closed_at":null,"body":"I have the Address class\r\n```java\r\npublic class Address {\r\n    private Integer addressId;\r\n    private String address;\r\n\r\n    public Integer getAddressId() {\r\n        return addressId;\r\n    }\r\n\r\n    public void setAddressId(Integer addressId) {\r\n        this.addressId = addressId;\r\n    }\r\n\r\n    public String getAddress() {\r\n        return address;\r\n    }\r\n\r\n    public void setAddress(String address) {\r\n        this.address = address;\r\n    }\r\n}\r\n```\r\nthe User class\r\n```java\r\npublic class User {\r\n    private Integer userId;\r\n    private Address address;\r\n\r\n    public Integer getUserId() {\r\n        return userId;\r\n    }\r\n\r\n    public void setUserId(Integer userId) {\r\n        this.userId = userId;\r\n    }\r\n\r\n    public Address getAddress() {\r\n        return address;\r\n    }\r\n\r\n    public void setAddress(Address address) {\r\n        this.address = address;\r\n    }\r\n}\r\n```\r\nthe DTO class\r\n```java\r\npublic class UserDto {\r\n    private Integer userId;\r\n    private String addr;\r\n\r\n    public Integer getUserId() {\r\n        return userId;\r\n    }\r\n\r\n    public void setUserId(Integer userId) {\r\n        this.userId = userId;\r\n    }\r\n\r\n    public String getAddr() {\r\n        return addr;\r\n    }\r\n\r\n    public void setAddr(String addr) {\r\n        this.addr = addr;\r\n    }\r\n}\r\n```\r\nand the mapper.\r\n\r\n```java\r\n@Mapper\r\npublic interface AddressAdaptor {\r\n    @Mapping(source = \"address.address\", target = \"addr\")\r\n    UserDto toUserDto(User u);\r\n}\r\n```\r\n\r\nThis is the generated class\r\n\r\n```java\r\n@Generated(\r\n    value = \"org.mapstruct.ap.MappingProcessor\"\r\n)\r\npublic class AddressAdaptorImpl implements AddressAdaptor {\r\n\r\n    @Override\r\n    public UserDto toUserDto(User u)  {\r\n        if ( u == null ) {\r\n            return null;\r\n        }\r\n\r\n        UserDto userDto = new UserDto();\r\n\r\n        userDto.setAddr( uAddressAddress( u ) );\r\n        userDto.setUserId( u.getUserId() );\r\n\r\n\r\n        return userDto;\r\n    }\r\n\r\n\r\n    private String uAddressAddress(User user) {\r\n\r\n        String string = null;\r\n        if ( user != null ) {\r\n            Address address = user.getAddress();\r\n            if ( address != null ) {\r\n                String address = address.getAddress();\r\n                if ( address != null ) {\r\n                    string = address;\r\n                }\r\n            }\r\n        }\r\n        return string;\r\n    }\r\n\r\n}\r\n```\r\n\r\nand the complier complains about\r\n\r\n```\r\nError:(32, 24) java: variable address is already defined in method uAddressAddress(pt.ipb.demo.core.test.User)\r\nError:(32, 41) java: cannot find symbol\r\n  symbol:   method getAddress()\r\n  location: variable address of type java.lang.String\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/comments/72850937","html_url":"https://github.com/mapstruct/mapstruct/issues/442#issuecomment-72850937","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/442","id":72850937,"user":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars.githubusercontent.com/u/6173283?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaakd","html_url":"https://github.com/sjaakd","followers_url":"https://api.github.com/users/sjaakd/followers","following_url":"https://api.github.com/users/sjaakd/following{/other_user}","gists_url":"https://api.github.com/users/sjaakd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaakd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaakd/subscriptions","organizations_url":"https://api.github.com/users/sjaakd/orgs","repos_url":"https://api.github.com/users/sjaakd/repos","events_url":"https://api.github.com/users/sjaakd/events{/privacy}","received_events_url":"https://api.github.com/users/sjaakd/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T13:05:32Z","updated_at":"2015-02-04T13:05:32Z","body":"Best to clone our repo and built it yourself. Alternatively, you could fetch it from our latert [continuous build](https://mapstruct.ci.cloudbees.com/job/mapstruct-snapshot/215)\r\n"}}