Comments (11)
@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:
from mapstruct-idea.
@aleksvidak Is your target DTO a java record?
from mapstruct-idea.
@thunderhook yes, dto is a record.
from mapstruct-idea.
@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.
@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.
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.
Used IntelliJ IDEA 2023.3.6
- Upgraded now to 2024.1 (Build #IU-241.14494.240)
still there... 🤔
from mapstruct-idea.
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.
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.
@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.
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)
- Code completion doesn't work with lombok @SuperBuilder annotation HOT 3
- Unmapped target properties warning is missing if source is a Java record HOT 5
- Auto completion for InheritConfiguration#name, InheritInverseConfiguration#name HOT 1
- Disable unmapped target property warnings when implicitly mapping from a map HOT 2
- Completion for properties don't work (both target and source) HOT 2
- Array and Map paramter ignored as source-parameter if used as only source
- Java expression HOT 1
- Report Non-existing target properties as errors HOT 1
- WrongUsageOfMappersFactoryInspection ignores if componentModel is defined in MapperConfig HOT 1
- IDE Support of `BeanMapping#ignoredTargets`
- Code Completion didn't work well. HOT 12
- Wrong usage of mappers factory should be able to remove static initializer
- code wraps automatically, does not recognize keywords HOT 1
- Incompatible with idea 2024.1 RC HOT 4
- Plugin reports "Can't find related attribute" warning when using `source="."` HOT 2
- Code completion: mapTo... suggestions take precedence over more useful suggestions HOT 6
- Code completion for annotation parameters like @Mapping is not working HOT 5
- Incorrect no source property defined inspection for `@Mapping`
- Renaming a @Getter annotated field results in a getter inside the mapping definition (instead of the new field name) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapstruct-idea.