-
-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1821 nullpointer due to @BeanMapping via inheritance
- Loading branch information
sjaakd
committed
Sep 22, 2019
1 parent
1c4f487
commit 740138b
Showing
8 changed files
with
207 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
processor/src/main/java/org/mapstruct/ap/internal/model/source/EnumMapping.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
processor/src/test/java/org/mapstruct/ap/test/bugs/_1821/Issue1821Mapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright MapStruct Authors. | ||
* | ||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package org.mapstruct.ap.test.bugs._1821; | ||
|
||
import org.mapstruct.BeanMapping; | ||
import org.mapstruct.InheritConfiguration; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
@Mapper | ||
public interface Issue1821Mapper { | ||
|
||
Issue1821Mapper INSTANCE = Mappers.getMapper( Issue1821Mapper.class ); | ||
|
||
@BeanMapping( resultType = Target.class ) | ||
Target map(Source source); | ||
|
||
@InheritConfiguration( name = "map" ) | ||
ExtendedTarget mapExtended(Source source); | ||
|
||
class Target { | ||
} | ||
|
||
class ExtendedTarget extends Target { | ||
} | ||
|
||
class Source { | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
processor/src/test/java/org/mapstruct/ap/test/bugs/_1821/Issue1821Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright MapStruct Authors. | ||
* | ||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package org.mapstruct.ap.test.bugs._1821; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mapstruct.ap.testutil.IssueKey; | ||
import org.mapstruct.ap.testutil.WithClasses; | ||
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner; | ||
|
||
@IssueKey("1797") | ||
@RunWith( AnnotationProcessorTestRunner.class) | ||
@WithClasses( Issue1821Mapper.class ) | ||
public class Issue1821Test { | ||
|
||
@Test | ||
public void shouldNotGiveNullPtr() { | ||
Issue1821Mapper.INSTANCE.map( new Issue1821Mapper.Source() ); | ||
} | ||
|
||
} |
Oops, something went wrong.