Skip to content

refactor TypeFactory.getTypeParameters#4020

Merged
filiphr merged 1 commit intomapstruct:mainfrom
hduelme:refactor-TypeFactory.getTypeParameters
Mar 23, 2026
Merged

refactor TypeFactory.getTypeParameters#4020
filiphr merged 1 commit intomapstruct:mainfrom
hduelme:refactor-TypeFactory.getTypeParameters

Conversation

@hduelme
Copy link
Contributor

@hduelme hduelme commented Mar 21, 2026

Improves readability and avoids unnecessary overhead:

  • Stores typeArguments in a local variable (since calling getTypeArguments() is not cached in eclipse compiler)
  • Replace if/else with a ternary expression
  • Avoids repeated getType(...) calls

No functional changes.

@filiphr filiphr added this to the 1.7.0.Beta2 milestone Mar 23, 2026
@filiphr filiphr merged commit 2d51aa0 into mapstruct:main Mar 23, 2026
5 checks passed
@filiphr
Copy link
Member

filiphr commented Mar 23, 2026

Nice one @hduelme

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants