Skip to content

Add generics support - #273

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

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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added this specifically to ensure the tests run correctly on Windows. Without these configurations, the testing framework is unable to access packages

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

For example, before fix

14:52:40,037 FINE   .intellij.openapi.command.impl - finishCommand: name = Renaming method setTestName(String) of class org.mapstruct.intellij.test.examples.SimpleMapper.Target to setNewName, groupId = null 
14:52:40,039 SEVERE                 #TestFramework - Test failed 
com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess$VfsRootAccessNotAllowedError: File accessed outside allowed roots: file://D:/projects/github/mapstruct-idea/testData/usages/RenameTargetReferenceAfter.java;

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 did you have the project not on your main disc (C:)?

@maybetm
maybetm force-pushed the add_generics_support branch from 19196bd to 30b3520 Compare August 4, 2026 10:23
Comment thread build.gradle
@maybetm
maybetm requested a review from hduelme August 4, 2026 10:42
@maybetm
maybetm force-pushed the add_generics_support branch from 30b3520 to d781aa0 Compare August 4, 2026 10:51
@maybetm
maybetm force-pushed the add_generics_support branch from d781aa0 to f9e342b Compare August 4, 2026 11:02
@hduelme

hduelme commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

@maybetm sorry for the late response. I saw that you fixed my previous findings.
The only thing still open is the change insrc/test/java/org/mapstruct/intellij/MapstructBaseCompletionTestCase.java. I’m still not sure whether this change is needed. Could you provide some more information about your environment and why the change is required?

I’ll re-review your PR soon.

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