{"action":"created","issue":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1608","repository_url":"https://api.github.com/repos/mapstruct/mapstruct","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1608/labels{/name}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1608/comments","events_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1608/events","html_url":"https://github.com/mapstruct/mapstruct/issues/1608","id":361321599,"node_id":"MDU6SXNzdWUzNjEzMjE1OTk=","number":1608,"title":"Lombok Builders and fields that begin with 'is' ","user":{"login":"duanemay","id":991170,"node_id":"MDQ6VXNlcjk5MTE3MA==","avatar_url":"https://avatars0.githubusercontent.com/u/991170?v=4","gravatar_id":"","url":"https://api.github.com/users/duanemay","html_url":"https://github.com/duanemay","followers_url":"https://api.github.com/users/duanemay/followers","following_url":"https://api.github.com/users/duanemay/following{/other_user}","gists_url":"https://api.github.com/users/duanemay/gists{/gist_id}","starred_url":"https://api.github.com/users/duanemay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duanemay/subscriptions","organizations_url":"https://api.github.com/users/duanemay/orgs","repos_url":"https://api.github.com/users/duanemay/repos","events_url":"https://api.github.com/users/duanemay/events{/privacy}","received_events_url":"https://api.github.com/users/duanemay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-18T14:05:12Z","updated_at":"2018-09-22T20:38:56Z","closed_at":null,"author_association":"NONE","body":"I am having an issue with MapStruct 1.3.0-Beta1 when used with Lombok Builders and fields that begin with **'is'**. \r\n\r\nI get an error like\r\n`\r\nBookMapper.java:[12,10] Unknown property \"isbn\" in result type api.Book. Did you mean \"null\"?\r\n`\r\n\r\nI recreated the issue in a smaller example. Here are the 2 bean classes that I am mapping between.\r\n```java\r\n@Value\r\n@Builder\r\npublic class BookDto {\r\n    String bookIsbn;\r\n    String title;\r\n}\r\n```\r\n\r\n```java\r\n@Value\r\n@Builder\r\npublic class Book {\r\n    String isbn;\r\n    String title;\r\n}\r\n```\r\n\r\nThe Lombok generated code, has `getIsbn()`, but the Builder uses fluent style setters `isbn(\"123\")`\r\n\r\n```java\r\n@Mapper\r\npublic interface BookMapper {\r\n    @Mapping(source = \"bookIsbn\", target = \"isbn\")\r\n    Book dtoToBook(BookDto bookDto);\r\n}\r\n```\r\n\r\nIt does work if I change the mapping line to remove the leading **is** from the target.\r\n```java\r\n@Mapping(source = \"bookIsbn\", target = \"bn\")\r\n```\r\n\r\nIn real code, I also had this mapping, which seems to imply a very different meaning.\r\nissueDate → sueDate\r\n"},"comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/comments/423771716","html_url":"https://github.com/mapstruct/mapstruct/issues/1608#issuecomment-423771716","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1608","id":423771716,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzc3MTcxNg==","user":{"login":"filiphr","id":6012094,"node_id":"MDQ6VXNlcjYwMTIwOTQ=","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-09-22T20:38:56Z","updated_at":"2018-09-22T20:38:56Z","author_association":"MEMBER","body":"@sjaakd the `DefaultAccessorNamingStrategy` actually works with fluent setters we should not do anything special with those and there is nothing that Lombok or Immutables do bad. \r\n\r\n>Have a look here for how this is solved for the immutable framework..\r\n\r\nThat solved another problem for Immutables, not this one\r\n\r\nThe problem is actually in\r\n\r\nhttps://github.com/mapstruct/mapstruct/blob/master/processor/src/main/java/org/mapstruct/ap/spi/DefaultAccessorNamingStrategy.java#L157-L165\r\n\r\nSo if we first check if the `getterOrSetterMethod` is a fluent setter and return the method name. The only caveat I think is that if someone uses fluent setters and use `setName`.  Having said that, maybe we should apply the following:\r\n\r\n* If it starts with `set` it is a normal setter, remove that and return\r\n* If is is fluent setter return the method name\r\n* decapitalize like we do now"}}
{"actor":{"display_login":"filiphr"}}