mapstruct / mapstruct/mapstruct-idea
Converter implementation is not refreshed in IDEA
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 168
- Forks
- 41
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Verwende das mapstruct-lombok-Beispiel sowie dessen Source, Target und Test als Reproduktion; prüfe zuerst build.gradle und die Einrichtung der Annotation-Processor in IDEA. Reproduziere anschließend die Fälle mit hinzugefügten und entfernten Feldern und verifiziere dann, dass der generierte Konverter Änderungen widerspiegelt und der Test nicht mehr null oder NoSuchMethodError meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- developer-experience, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100