mapstruct / mapstruct/mapstruct-idea

Completion of nested property of generic source property

Open
#83 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
168
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Example Source class (Lombok used for brevity):
```java
import org.geolatte.geom.G2D;
import org.geolatte.geom.Point;

@Getter
@Setter
public class Location {
private Point coordinates;

// ...
}
```

eg. when attempting to map the latitude of `coordinates`:
```java
@Mapping(source = "coordinates.position.lat", target = "latitude")
```
[Point#getPosition()](https://javadoc.io/static/org.geolatte/geolatte-geom/1.4.0/org/geolatte/geom/Point.html#getPosition--) returns the type argument, in this case `G2D`, but the plugin infers it as `P` (the type parameter), and hence fails to autocomplete the [G2D#getLat()](https://javadoc.io/static/org.geolatte/geolatte-geom/1.4.0/org/geolatte/geom/G2D.html#getLat--) property.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the nested mapping example with Location, Point, and coordinates.position.lat in IntelliJ IDEA. Start by tracing how the plugin resolves Point#getPosition() and its generic type argument, then verify autocomplete reaches G2D#getLat(). Done means the property is suggested as G2D rather than the unresolved type parameter P.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.