Regression: Missing import when upgrading to 1.2.0.Beta2 #1215

Closed
juriad opened this Issue May 29, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@juriad

juriad commented May 29, 2017

Hi, we were using Mapstruct version 1.1 but we are upgrading to 1.2 because we need Lombok support. After the upgrade, old mappers stopped working.

The problem is demonstrated in https://github.com/juriad/mapstruct-missing-import-1.2

Basically, this (in 1.1):

if ( dto.getTags() != null ) {
  some.entity.Tag[] tags = dto.getTags();
  entity.setTags( Arrays.copyOf( tags, tags.length ) );
}

was replaced with this (1.2):

Tag[] tags = dto.getTags();
if ( tags != null ) {
  entity.setTags( Arrays.copyOf( tags, tags.length ) );
}

Notice that in version 1.2, the type Tag[] is not fully qualified, which causes a compilation problem.

@filiphr filiphr self-assigned this May 29, 2017

@filiphr filiphr added the bug label May 29, 2017

@filiphr filiphr added this to the 1.2.0.Beta3 milestone May 29, 2017

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr May 29, 2017

Member

Thanks a lot for the demonstration of the problem. I see that you have the workaround already.

For others: one needs to use @Mapper(uses = {Tag.class}) to avoid the problem.

This is a regression of #999 We'll try to fix this with 1.2.0Beta3, otherwise the fix will be part of the release after the Beta.

Member

filiphr commented May 29, 2017

Thanks a lot for the demonstration of the problem. I see that you have the workaround already.

For others: one needs to use @Mapper(uses = {Tag.class}) to avoid the problem.

This is a regression of #999 We'll try to fix this with 1.2.0Beta3, otherwise the fix will be part of the release after the Beta.

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr May 29, 2017

Member

@juriad I managed to find a solution for the problem. Before I make the PR and the change can you tell me if I can use your classes in a test, or should I create some similar ones? If I can use the same classes, do you want me to add your name to the author of the classes?

Member

filiphr commented May 29, 2017

@juriad I managed to find a solution for the problem. Before I make the PR and the change can you tell me if I can use your classes in a test, or should I create some similar ones? If I can use the same classes, do you want me to add your name to the author of the classes?

@juriad

This comment has been minimized.

Show comment
Hide comment
@juriad

juriad May 30, 2017

Oh, that was quick. I added a license to the problem demonstration project. You can use it in a test. I don't want to be mentioned. From my point of view, the code served its purpose, it demonstrated the bug and made it easier to fix.
Thanks a lot!

juriad commented May 30, 2017

Oh, that was quick. I added a license to the problem demonstration project. You can use it in a test. I don't want to be mentioned. From my point of view, the code served its purpose, it demonstrated the bug and made it easier to fix.
Thanks a lot!

filiphr added a commit to filiphr/mapstruct that referenced this issue May 30, 2017

@filiphr filiphr closed this in #1217 May 30, 2017

filiphr added a commit that referenced this issue May 30, 2017

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr May 30, 2017

Member

Thanks again for the demonstration project it really helped a lot. The fix is integrated into master and it should be out with Beta3 really soon.

Let us know if there are other issues. Thanks for trying out the Betas

Member

filiphr commented May 30, 2017

Thanks again for the demonstration project it really helped a lot. The fix is integrated into master and it should be out with Beta3 really soon.

Let us know if there are other issues. Thanks for trying out the Betas

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