mapstruct / mapstruct/mapstruct-idea

Completion of nested property of generic source property

Open
#83 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
168
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Example Source class (Lombok used for brevity):

import org.geolatte.geom.G2D;
import org.geolatte.geom.Point;

@Getter
@Setter
public class Location {
    private Point<G2D> coordinates;

    // ...
}

eg. when attempting to map the latitude of coordinates:

@Mapping(source = "coordinates.position.lat", target = "latitude")

Point#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() property.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

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.