mapstruct / mapstruct/mapstruct-idea

Converter implementation is not refreshed in IDEA

オープン
#13 コメント 10 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
168
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

Using https://github.com/mapstruct/mapstruct-examples/tree/master/mapstruct-lombok as a reference, I tried to add a field to both `Source` and `Target` and then modified the test to cover the new field.

```
@Test
public void testMapping() {
Source s = new Source();
s.setTest( "5" );
s.setField( "5" );

Target t = Mappers.getMapper(SourceTargetMapper.class).toTarget( s );
assertEquals( 5, (long) t.getTesting() );
assertEquals( "5", t.getField() );
}
```

However this leads to the test to fail, being `t.getField()` still `null`.

Another relevant change I did (which I am not sure about) is to add `mapstruct-processor` to the `compile` configuration in `build.gradle`, ie: `compile "org.mapstruct:mapstruct-jdk8:${mapstructVersion}", "org.mapstruct:mapstruct-processor:${mapstructVersion}", "org.projectlombok:lombok:${lombokVersion}"` as per http://mapstruct.org/documentation/ide-support/

Also removing a field from both objects leads to an error, this time a `java.lang.NoSuchMethodError`.

Versions used:
- IDEA 2017.2.5 (with annotation processor manually enabled, no other customization)
- lombok 1.16.18 (instead of 1.16.14)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

mapstruct-lombok の例とその Source、Target、test を再現用として使用し、まず build.gradle と IDEA のアノテーションプロセッサの設定を確認します。フィールドを追加した場合と削除した場合を再現し、生成されたコンバーターに変更が反映され、test が null や NoSuchMethodError を報告しなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。