diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Mapper.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Mapper.java new file mode 100644 index 0000000000..55b5dd03c4 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Mapper.java @@ -0,0 +1,18 @@ +/* + * 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._1742; + +import org.mapstruct.Mapper; +import org.mapstruct.MappingTarget; + +/** + * @author Filip Hrisafov + */ +@Mapper +public interface Issue1742Mapper { + + void update(@MappingTarget Target target, Source source); +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Test.java new file mode 100644 index 0000000000..e68f4657ff --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Issue1742Test.java @@ -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._1742; + +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; + +/** + * @author Filip Hrisafov + */ +@IssueKey("1742") +@RunWith(AnnotationProcessorTestRunner.class) +@WithClasses( { + Issue1742Mapper.class, + NestedSource.class, + NestedTarget.class, + Source.class, + Target.class, +} ) +public class Issue1742Test { + + @Test + public void shouldCompile() { + + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedSource.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedSource.java new file mode 100644 index 0000000000..9506c946b8 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedSource.java @@ -0,0 +1,22 @@ +/* + * 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._1742; + +/** + * @author Filip Hrisafov + */ +public class NestedSource { + + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedTarget.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedTarget.java new file mode 100644 index 0000000000..82dbbd91b6 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/NestedTarget.java @@ -0,0 +1,48 @@ +/* + * 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._1742; + +/** + * @author Filip Hrisafov + */ +public class NestedTarget { + + private String value; + + public NestedTarget() { + + } + + public NestedTarget(Builder builder) { + this.value = getValue(); + } + + public static Builder builder() { + return new Builder(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static class Builder { + + private String value; + + public Builder value(String value) { + this.value = value; + return this; + } + + public NestedTarget create() { + return new NestedTarget(this); + } + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Source.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Source.java new file mode 100644 index 0000000000..e6a7b54c86 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Source.java @@ -0,0 +1,22 @@ +/* + * 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._1742; + +/** + * @author Filip Hrisafov + */ +public class Source { + + private NestedSource nested; + + public NestedSource getNested() { + return nested; + } + + public void setNested(NestedSource nested) { + this.nested = nested; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Target.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Target.java new file mode 100644 index 0000000000..ab320b606f --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1742/Target.java @@ -0,0 +1,22 @@ +/* + * 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._1742; + +/** + * @author Filip Hrisafov + */ +public class Target { + + private NestedTarget nested; + + public NestedTarget getNested() { + return nested; + } + + public void setNested(NestedTarget nested) { + this.nested = nested; + } +}