-
-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated code does not include enclosing class when referring to nested class #2880
Comments
I have added a test for this issue to https://github.com/mkjensen/mapstruct/tree/issue-2880 (71b250d). As this is my first endeavor into the MapStruct code, I'm not sure I will come up with a reasonable fix any time soon. |
same issue. |
Thanks a lot for creating the test case @mkjensen. We are going to look into this asap as it is blocking people. Perhaps we will even add a mechanism to back out of the nested types approach. In order to have a workaround for the problem. |
Co-authored-by: Martin Kamp Jensen <martin.kamp.jensen@se.com>
This issue is still present for nested enums |
MapStruct recently switched to only generating imports for top level classes (#1386). This seems to have caused some bugs that have been fixed (#2704, #2797). However, there are more bugs as captured by this issue.
Here's a small project that shows the bugs in MapStruct 1.5.1.Final and also shows that the bugs do not exist in MapStruct 1.4.2.Final: https://github.com/mkjensen/mapstruct-nested-class-bug/tree/main
Maybe there are more, I'm not sure. Although it results in generated code that is harder to read, maybe it's worth considering to use fully qualified names when referring to classes.
The text was updated successfully, but these errors were encountered: