forked from mapstruct/mapstruct
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mapstruct#3703 Use include model instead of manually writing the type…
… name for return type for afterMappingReferencesWithFinalizedReturnType
- Loading branch information
Showing
5 changed files
with
136 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
processor/src/test/java/org/mapstruct/ap/test/bugs/_3703/Issue3703Mapper.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,37 @@ | ||
/* | ||
* 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._3703; | ||
|
||
import org.mapstruct.AfterMapping; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.MappingTarget; | ||
import org.mapstruct.ap.test.bugs._3703.dto.Contact; | ||
|
||
@Mapper | ||
public interface Issue3703Mapper { | ||
|
||
Contact map(org.mapstruct.ap.test.bugs._3703.entity.Contact contact); | ||
|
||
org.mapstruct.ap.test.bugs._3703.entity.Contact map(Contact contact); | ||
|
||
@AfterMapping | ||
default void afterMapping(@MappingTarget Contact target, org.mapstruct.ap.test.bugs._3703.entity.Contact contact) { | ||
} | ||
|
||
@AfterMapping | ||
default void afterMapping(@MappingTarget Contact.Builder targetBuilder, | ||
org.mapstruct.ap.test.bugs._3703.entity.Contact contact) { | ||
} | ||
|
||
@AfterMapping | ||
default void afterMapping(@MappingTarget org.mapstruct.ap.test.bugs._3703.entity.Contact target, Contact contact) { | ||
} | ||
|
||
@AfterMapping | ||
default void afterMapping(@MappingTarget org.mapstruct.ap.test.bugs._3703.entity.Contact.Builder targetBuilder, | ||
Contact contact) { | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
processor/src/test/java/org/mapstruct/ap/test/bugs/_3703/Issue3703Test.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._3703; | ||
|
||
import org.mapstruct.ap.test.bugs._3703.dto.Contact; | ||
import org.mapstruct.ap.testutil.IssueKey; | ||
import org.mapstruct.ap.testutil.ProcessorTest; | ||
import org.mapstruct.ap.testutil.WithClasses; | ||
|
||
@IssueKey("3703") | ||
@WithClasses({ | ||
Contact.class, | ||
org.mapstruct.ap.test.bugs._3703.entity.Contact.class, | ||
Issue3703Mapper.class | ||
}) | ||
public class Issue3703Test { | ||
|
||
@ProcessorTest | ||
void shouldCompile() { | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
processor/src/test/java/org/mapstruct/ap/test/bugs/_3703/dto/Contact.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,37 @@ | ||
/* | ||
* 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._3703.dto; | ||
|
||
public class Contact { | ||
|
||
private final String name; | ||
|
||
private Contact(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public static Builder newBuilder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
|
||
private String name; | ||
|
||
public Builder name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public Contact build() { | ||
return new Contact( name ); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
processor/src/test/java/org/mapstruct/ap/test/bugs/_3703/entity/Contact.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,37 @@ | ||
/* | ||
* 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._3703.entity; | ||
|
||
public class Contact { | ||
|
||
private final String name; | ||
|
||
private Contact(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public static Builder newBuilder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
|
||
private String name; | ||
|
||
public Builder name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public Contact build() { | ||
return new Contact( name ); | ||
} | ||
} | ||
} |