Skip to content
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

nullptr in 3.0 due to result type definition. #1821

Closed
sjaakd opened this issue May 16, 2019 · 4 comments
Closed

nullptr in 3.0 due to result type definition. #1821

sjaakd opened this issue May 16, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@sjaakd
Copy link
Contributor

sjaakd commented May 16, 2019

Internal error in the mapping processor: java.lang.NullPointerException at org.mapstruct.ap.internal.model.BeanMappingMethod$Builder.build(BeanMappingMethod.java:201) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMappingMethods(MapperCreationProcessor.java:373) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMapper(MapperCreationProcessor.java:149) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:120) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:74) at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:283) at org.mapstruct.ap.MappingProcessor.processMapperTypeElement(MappingProcessor.java:263) at org.mapstruct.ap.MappingProcessor.processMapperElements(MappingProcessor.java:221) at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:152)

sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue May 16, 2019
@sjaakd
Copy link
Contributor Author

sjaakd commented May 16, 2019

Reproducer in attached PR.

sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Aug 18, 2019
@Captain1653
Copy link
Contributor

Captain1653 commented Sep 1, 2019

@sjaakd I have reproduced this exception. The problem is here
null pointer . Our result types aren't assignable. If we will remove this bad line BeanMappingPrism.getInstanceOn( method.getExecutable() ).mirror then we will receive message from compiler something like that:

org.mapstruct.ap.test.mypackage.Issue1821Mapper.Target not assignable to: org.mapstruct.ap.test.mypackage.Issue1821Mapper.ExtendedTarget.

Is it acceptable for us?

@sjaakd
Copy link
Contributor Author

sjaakd commented Sep 1, 2019

While many parameters of @BeanMapping can be inherited, it does not make sense to inherit the result type.

Your proposal does not take away the cause of the problem, it solves the symptoms. The solution is not to copy the resultType when inheriting. I guess that's somewhere done in MappingOptions I guess.

sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Sep 14, 2019
@filiphr filiphr added the bug label Sep 15, 2019
@filiphr filiphr added this to the 1.4.0 milestone Sep 15, 2019
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Sep 22, 2019
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Sep 22, 2019
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Sep 22, 2019
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Sep 22, 2019
@sjaakd
Copy link
Contributor Author

sjaakd commented Sep 22, 2019

done.. resolved by PR #1822

@sjaakd sjaakd closed this as completed Sep 22, 2019
@sjaakd sjaakd self-assigned this Sep 22, 2019
@filiphr filiphr mentioned this issue Sep 28, 2019
2 tasks
sjaakd added a commit to sjaakd/mapstruct that referenced this issue Sep 29, 2019
filiphr pushed a commit that referenced this issue Sep 29, 2019
@filiphr filiphr modified the milestones: 1.4.0, 1.3.1 Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants