diff --git a/parent/pom.xml b/parent/pom.xml
index 1c031a7b71..ec686bd641 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -363,8 +363,8 @@
maven-compiler-plugin
3.8.1
- 1.8
- 1.8
+ 11
+ 11
diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Mapper.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Mapper.java
new file mode 100644
index 0000000000..c944156a9e
--- /dev/null
+++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Mapper.java
@@ -0,0 +1,129 @@
+package org.mapstruct.ap.test.bugs._2937;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.mapstruct.CollectionMappingStrategy;
+import org.mapstruct.Condition;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE,
+ collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED)
+public interface Issue2937Mapper {
+
+ PersonDTO toDTO(final Person entity);
+ Person toEntity(final PersonDTO dto);
+
+ AddressDTO toDTO(final Address entity);
+ Address toEntity(final AddressDTO dto);
+
+ @Condition
+ default boolean isConditionSatified(Collection> sourceCollection) {
+ return false;
+ }
+
+ class PersonDTO {
+
+ private Set addresses = new HashSet();
+
+ public void setAddresses(Set addresses) {
+ this.addresses = addresses;
+ }
+
+ public Set getAddresses() {
+ return this.addresses;
+ }
+
+ public void addAddress(AddressDTO customerAddressVar) {
+ if (customerAddressVar != null) {
+ this.addresses.add(customerAddressVar);
+ customerAddressVar.setPerson(this);
+ }
+ }
+
+ public void removeAddress(AddressDTO customerAddressVar) {
+ if (customerAddressVar != null) {
+ this.addresses.remove(customerAddressVar);
+ }
+ }
+
+ }
+
+ class Address {
+
+ private String addressLine;
+
+ private Person person;
+
+ public String getAddressLine() {
+ return addressLine;
+ }
+
+ public void setAddressLine(String addressLine) {
+ this.addressLine = addressLine;
+ }
+
+ public void setPerson(Person person) {
+ this.person = person;
+ }
+
+ public Person getPerson() {
+ return this.person;
+ }
+
+ }
+
+ class AddressDTO {
+
+ private String addressLine;
+
+ private PersonDTO person;
+
+ public String getAddressLine() {
+ return addressLine;
+ }
+
+ public void setAddressLine(String addressLine) {
+ this.addressLine = addressLine;
+ }
+
+ public void setPerson(PersonDTO person) {
+ this.person = person;
+ }
+
+ public PersonDTO getPerson() {
+ return this.person;
+ }
+
+ }
+
+ class Person {
+
+ private Set addresses = new HashSet();
+
+
+ public void setAddresses(Set addresses) {
+ this.addresses = addresses;
+ }
+
+ public Set getAddresses() {
+ return this.addresses;
+ }
+
+ public void addAddress(Address customerAddressVar) {
+ if (customerAddressVar != null) {
+ this.addresses.add(customerAddressVar);
+ customerAddressVar.setPerson(this);
+ }
+ }
+
+ public void removeAddress(Address customerAddressVar) {
+ if (customerAddressVar != null) {
+ this.addresses.remove(customerAddressVar);
+ }
+ }
+
+ }
+}
diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Test.java
new file mode 100644
index 0000000000..7ef4a3880c
--- /dev/null
+++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_2937/Issue2937Test.java
@@ -0,0 +1,26 @@
+package org.mapstruct.ap.test.bugs._2937;
+
+import org.mapstruct.ap.testutil.IssueKey;
+import org.mapstruct.ap.testutil.ProcessorTest;
+import org.mapstruct.ap.testutil.WithClasses;
+
+@WithClasses({
+ Issue2937Mapper.class
+})
+@IssueKey("2937")
+class Issue2937Test {
+
+ @ProcessorTest
+ void shouldCompile() {
+ }
+}
+
+
+//class Issue2891Test {
+//
+// @RegisterExtension
+// final GeneratedSource generatedSource = new GeneratedSource()
+// .addComparisonToFixtureFor( Issue2891Mapper.class );
+//
+//
+//}
\ No newline at end of file