Skip to content

Conversation

@chenzijia12300
Copy link
Contributor

fix #3015

List<LifecycleCallbackMethodReference> afterMappingMethods =
LifecycleMethodResolver.afterMappingMethods( method, selectionParameters, ctx, existingVariables );
AdditionalAnnotationsBuilder additionalAnnotationsBuilder =
List<Annotation> annotations = Collections.emptyList();
Copy link
Contributor

Choose a reason for hiding this comment

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

you initialize the list of annotations twice.. Why not write:

List<Annotations> annotations;
if ( method instanceof ForgedMethod ) {
   annotations = Collections.emptyList();
}
else {
  annotations = new ArrayList();
  // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sjaakd Thank you for the review, I just don't like writing else, I will try to modify it :)

@filiphr filiphr merged commit 93f7c3b into mapstruct:main Nov 3, 2022
@filiphr
Copy link
Member

filiphr commented Nov 3, 2022

Thanks @chenzijia12300

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.

Annotations are automatically passed in forged methods

3 participants