mapstruct / mapstruct/mapstruct-idea
Array and Map paramter ignored as source-parameter if used as only source
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 168
- フォーク
- 41
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I found while investigation #168, that currently the plugin ignores source parameters of type array and Map, if used as the only source parameter.
Here a small example Mapper:
import org.mapstruct.Mapper;
import java.util.Map;
@Mapper
public interface MultiSourceMapper {
class ArrayTarget {
private int[] myArray;
public int[] getMyArray() {
return myArray;
}
public void setMyArray(int[] myArray) {
this.myArray = myArray;
}
}
ArrayTarget mapToArrayTarget(int[] myArray);
class MapTarget {
private Map<Integer, Integer> myMap;
public Map<Integer, Integer> getMyMap() {
return myMap;
}
public void setMyMap(Map<Integer, Integer> myMap) {
this.myMap = myMap;
}
}
MapTarget mapToMapTarget(Map<Integer, Integer> myMap);
}
This generates code where all targets are mapped based on their names. The plugin currently ignores the source parameters and give a unmapped target property warning.
Also the completion doesn't show them as source parameters.
One thing to notice:
For Iterable this behavior is correct as mapstruct itself doesn't support mapping from Iterable to Object.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
レポートにある Java MultiSourceMapper の例で問題を再現し、array と Map のソースパラメーターの両方を確認して、記載されている Iterable の動作と比較します。プラグインのソースパラメーター処理と completion の動作を追跡します。array と Map のパラメーターが唯一のソースとして認識され、マッピングされた target の警告が表示されなくなり、completion にそれらが一覧表示されれば、fix は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100