Giter Site home page Giter Site logo

Comments (11)

filiphr avatar filiphr commented on June 20, 2024

@aleksvidak which version of the plugin are you using? Can you please share an example of how the setter looks like in the target class?

When I try it with something like

public class Target {

    public void setSettlementDate(String value) {
        //...
    }

}

then the set is not removed. It looks like:

image

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024

@aleksvidak Is your target DTO a java record?

from mapstruct-idea.

aleksvidak avatar aleksvidak commented on June 20, 2024

@thunderhook yes, dto is a record.

from mapstruct-idea.

filiphr avatar filiphr commented on June 20, 2024

@thunderhook could you reproduce this with a record? I can't, it looks correct to me.

@aleksvidak which version of the plugin are you using?

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024

@filiphr Yes I am seeing the same warning in this test class:

import org.mapstruct.Mapper;

@Mapper
interface Issue192Mapper {

    Target map(Source source);

}

class Source {
    String settlementDate;
}

record Target(String settlementDate) {}

However, I was not able to reproduce this in a unit test yet.
Warning is also shown when using main with :runIde however, so this is not fixed yet.

from mapstruct-idea.

filiphr avatar filiphr commented on June 20, 2024

Which IntelliJ are you using locally>? Not the one with :runIde. I'm on 2024.1 and it is fine there. Might be a bug in IntelliJ

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024

Used IntelliJ IDEA 2023.3.6 - Upgraded now to 2024.1 (Build #IU-241.14494.240) still there... 🤔

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024

Okay, I'm slightly stupid. My example from above does indeed show the warning, since Source#settlementDate is not publicly accessible 🤦‍♂️ Changing it to public String settlementDate; removes the warning obviously.

@aleksvidak Could you please share your code? We're not able to reproduce this.

from mapstruct-idea.

aleksvidak avatar aleksvidak commented on June 20, 2024

My Intellij version is also 2024.1 (Build #IU-241.14494.240). Mapstruct version is 1.5.5.Final.

Seems like @SuperBuilder annotation is the issue.

@Mapper
interface TestMapper {

  Entity toEntity(Dto dto);
}

@SuperBuilder(toBuilder = true)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
class Entity {

  private LocalDate settlementDate;
}

record Dto(LocalDate settlementDate) {}

from mapstruct-idea.

filiphr avatar filiphr commented on June 20, 2024

@aleksvidak we had some issues with Lombok's @SuperBuilder (#159). Version 1.7.0 from the plugin has been released, can you please upgrade it and try it out? If it is still not working as expected will have another look at it.

from mapstruct-idea.

aleksvidak avatar aleksvidak commented on June 20, 2024

Seems like it works with 1.7.0, thank you for your help. 🙏🏻 I will close this one 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.