Skip to content

Add generics support#273

Open
maybetm wants to merge 1 commit into
mapstruct:mainfrom
maybetm:add_generics_support
Open

Add generics support#273
maybetm wants to merge 1 commit into
mapstruct:mainfrom
maybetm:add_generics_support

Conversation

@maybetm

@maybetm maybetm commented Jul 19, 2026

Copy link
Copy Markdown

Hi! ☺️ I noticed that the MapStruct IDEA plugin didn't support generics properly in some cases.
This PR adds support for generic types. I'd appreciate it if you could review and merge these changes!

Before

image

After

image

@maybetm maybetm changed the title add generics support Add generics support Jul 19, 2026

@hduelme hduelme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@maybetm, good catch! I left a few comments for you. Could you also add tests covering the other branches?

"testData",
"build/test-libs"
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you changes this code? I think this could break building on other OS (Windows)

Comment on lines 210 to 212
else if ( element instanceof PsiParameter psiParameter ) {
return psiParameter.getType();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How is it with PsiParameter (constructor target parameter)?

Comment on lines 140 to 142
else if ( element instanceof PsiParameter psiParameter ) {
return psiParameter.getType();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if the source is named e.g. entity.id?

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.

2 participants