Converter implementation is not refreshed in IDEA
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- developer-experience, tooling
Research direction
Use the mapstruct-lombok example and its Source, Target, and test as the reproduction; inspect build.gradle and the IDEA annotation-processor setup first. Reproduce the added-field and removed-field cases, then verify that the generated converter reflects changes and that the test no longer reports null or NoSuchMethodError.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Java
- Stars
- 168
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapstruct/mapstruct-idea
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mapstruct/mapstruct-idea#274 · 2 comments ·
-
feature hack.commit.push
Difficulty 3/5 1-2 days Newbie friendliness 68/100
mapstruct/mapstruct-idea#267 ·
-
feature hack.commit.push
Difficulty 3/5 1-2 days Newbie friendliness 55/100
mapstruct/mapstruct-idea#266 ·
-
feature hack.commit.push
Difficulty 3/5 1-2 days Newbie friendliness 75/100
mapstruct/mapstruct-idea#265 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
mapstruct/mapstruct-idea#257 · 1 comment ·
All issues in mapstruct/mapstruct-idea
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100