{"action":"created","issue":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1452","repository_url":"https://api.github.com/repos/mapstruct/mapstruct","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1452/labels{/name}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1452/comments","events_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1452/events","html_url":"https://github.com/mapstruct/mapstruct/issues/1452","id":316635094,"number":1452,"title":"Improper  @BeanMapping(ignoreByDefault=true) treatment with Immutable target","user":{"login":"soberich","id":25544967,"avatar_url":"https://avatars1.githubusercontent.com/u/25544967?v=4","gravatar_id":"","url":"https://api.github.com/users/soberich","html_url":"https://github.com/soberich","followers_url":"https://api.github.com/users/soberich/followers","following_url":"https://api.github.com/users/soberich/following{/other_user}","gists_url":"https://api.github.com/users/soberich/gists{/gist_id}","starred_url":"https://api.github.com/users/soberich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soberich/subscriptions","organizations_url":"https://api.github.com/users/soberich/orgs","repos_url":"https://api.github.com/users/soberich/repos","events_url":"https://api.github.com/users/soberich/events{/privacy}","received_events_url":"https://api.github.com/users/soberich/received_events","type":"User","site_admin":false},"labels":[{"id":5877850,"url":"https://api.github.com/repos/mapstruct/mapstruct/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mapstruct/mapstruct/milestones/18","html_url":"https://github.com/mapstruct/mapstruct/milestone/18","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/milestones/18/labels","id":2244975,"number":18,"title":"1.3.0.Beta1","description":"","creator":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars0.githubusercontent.com/u/6173283?v=4","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},"open_issues":11,"closed_issues":33,"state":"open","created_at":"2017-01-11T20:46:11Z","updated_at":"2018-04-23T03:38:21Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-04-23T01:45:34Z","updated_at":"2018-04-23T03:42:40Z","closed_at":null,"author_association":"NONE","body":"Having this\r\n```\r\n    @Mapping(target = \"name\",                                     source = \"comp.employer.title\")\r\n//    @Mapping(target = \"A\",                                            ignore = true)\r\n//    @Mapping(target = \"B\",                                            ignore = true)\r\n//    @Mapping(target = \"C\",                                            ignore = true)\r\n//    @Mapping(target = \"D\",                                            ignore = true)\r\n...\r\n    @BeanMapping(ignoreByDefault = true)\r\n    ADTO map(A a);\r\n```\r\nworks only if \r\n```\r\n@Getter\r\n@Setter\r\n@Builder(toBuilder = true)\r\n```\r\nbut if target is immutable like\r\n```\r\n@Value\r\n@Builder(toBuilder = true)\r\n```\r\nIt somehow causes `@BeanMapping(ignoreByDefault = true)` do not work like as if it was not there.\r\nIt is said that `Unmapped target properties: \"A, B, C, D\"`\r\nso you have to explicitly ignore them again."},"comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/comments/383445954","html_url":"https://github.com/mapstruct/mapstruct/issues/1452#issuecomment-383445954","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1452","id":383445954,"user":{"login":"filiphr","id":6012094,"avatar_url":"https://avatars2.githubusercontent.com/u/6012094?v=4","gravatar_id":"","url":"https://api.github.com/users/filiphr","html_url":"https://github.com/filiphr","followers_url":"https://api.github.com/users/filiphr/followers","following_url":"https://api.github.com/users/filiphr/following{/other_user}","gists_url":"https://api.github.com/users/filiphr/gists{/gist_id}","starred_url":"https://api.github.com/users/filiphr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filiphr/subscriptions","organizations_url":"https://api.github.com/users/filiphr/orgs","repos_url":"https://api.github.com/users/filiphr/repos","events_url":"https://api.github.com/users/filiphr/events{/privacy}","received_events_url":"https://api.github.com/users/filiphr/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T03:42:40Z","updated_at":"2018-04-23T03:42:40Z","author_association":"MEMBER","body":"Thanks for the report @soberich. I think I know what the issue is. When we do the ignoring we use only the type itself and not the effective type (which would result in the builder), the type itself has no setters and thus nothing is ignored. However, the mapping is done by looking into the Builder. The fix is to use the correct type (effective for types with builders and the type itself for update methods) when doing the ignoring "}}
{"actor":{"display_login":"filiphr"}}