GithubHelp home page GithubHelp logo

Comments (6)

filiphr avatar filiphr commented on June 7, 2024 1

Thanks a lot. I'll give it a go with this example. It helps a lot having something that is easily reproducible.

from mapstruct-idea.

filiphr avatar filiphr commented on June 7, 2024

Hey, thanks for the nice words, it is really appreciated.

Are you by any chance using Lombok builders? This might be related to #12.

To rule out Lombok, can you please delombok your class and check whether it is working properly?

Btw, which version of the Lombok plugin are you using? Can you also provide an example classes which are not working so I can try them out?

from mapstruct-idea.

filiphr avatar filiphr commented on June 7, 2024

There is also #39 which seems related as well.

from mapstruct-idea.

kagan94 avatar kagan94 commented on June 7, 2024

Good questions!
I checked these tickets and they are not really related to this issue.

I investigated a bit and discovered that it's directly related to usage of @SuperBuilder which is experimental lombok feature:
https://projectlombok.org/features/experimental/SuperBuilder

Example that can reproduce this bug:

@Mapper(componentModel = "spring")
public abstract class ExampleMapper {

	@Mapping(target = "", source = "fullName")
	public abstract ExampleDto toDto(Example source);

	//@SuperBuilder
	@NoArgsConstructor
	static class SuperExampleDto  {

	}

	@Getter
	@Setter
	@SuperBuilder
	@NoArgsConstructor
	static class ExampleDto extends SuperExampleDto  {
		private String name;
	}

	@Getter
	@SuperBuilder
	static class Example {
		private String fullName;
	}
}

Also, I checked that if @SuperBuilder is used on source object, auto-completion works fine :)
So, the problem only with auto-completion for target attribute.

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 7, 2024

We are using @SuperBuilder for over a year now in different projects and never had any issues like that.
Seems that something between the plugin version 1.2.0 and 1.4.0 fixed that problem, since the reproducible example cannot be reproduced anymore.

@filiphr I think the ticket can be closed. Should i provide a regression test for this? I've seen no lombok tests, is this out of scope?

from mapstruct-idea.

filiphr avatar filiphr commented on June 7, 2024

Thanks for the information @thunderhook. We don't really have tests with the lombok annotations and this is also a bit out of scope for this project.

I don't remember whether I checked the delomboked sources or not. Most likely it worked correctly. The most likely reason for this not being a problem anymore is that something was fixed in the Lombok IntelliJ plugin or in IntelliJ itself.

In any case, I am going to go ahead and close this issue now.

from mapstruct-idea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.