Skip to content

#2258 Fixes vague description of @Default and @ConstructorProperties annotations - #2262

Merged
filiphr merged 4 commits into
mapstruct:masterfrom
nikolas-charalambidis:2258
Nov 4, 2020
Merged

filiphr merged 4 commits into
mapstruct:masterfrom
nikolas-charalambidis:2258

Conversation

@nikolas-charalambidis

Copy link
Copy Markdown
Contributor

This should fix #2258

@filiphr filiphr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @nikolas-charalambidis. I have one small remark, but apart from that it looks good to me

Hence, we say that annotation can be _from any package_.

For example, MapStruct searches for the annotation _named_ `@ConstructorProperties`.
As long as there already exists `java.beans.ConstructorProperties` annotation from Java SE, the idea is to reuse such annotation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not suggest reusing the java.beans.ConstructorProperties, especially on Java 9+ and the fact that the ConstructorProperties is part of the java.desktop module.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. My mind is stuck in Java 8. Well, the idea of this sentence is to give an example of reusing the already existing annotation, not suggesting particularly this one. I remove the sentence for now to avoid the confusion. Do you have an idea of an existing annotation to demonstrate such usage or a better way to rephrase the sentence?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed your question. Unfortunately I don't have an idea

@filiphr filiphr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you also added the Lombok part I would suggest adding the fact that users need to add lombok-mapstruct-binding as well starting from Lombok 1.18.16. Otherwise MapStruct and Lombok stops working.

@nikolas-charalambidis

nikolas-charalambidis commented Nov 4, 2020 •

Copy link
Copy Markdown
Contributor Author

@filiphr This is silly mistake of mine as I have forgotten exclude the Lombok part in progress. I have fixed such commit and I will include your note (thank you for the insight!) in my next pull request with the whole Lombok subsection immediately after this issue gets closed and merged into the master branch. Would you squash the commits?

@filiphr
filiphr merged commit 8f9df5b into mapstruct:master Nov 4, 2020
@filiphr

filiphr commented Nov 4, 2020

Copy link
Copy Markdown
Member

Thanks a lot @nikolas-charalambidis, I squashed and merged this PR. Will make sure that it comes in 1.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vague documentation and code samples of @Default annotation as of 1.4.X

2 participants