From 874a9b3a52ed1ecef4dfe02959ea1dbedc0fbc3e Mon Sep 17 00:00:00 2001 From: Andreas Gudian Date: Mon, 9 Nov 2015 22:52:03 +0100 Subject: [PATCH] #644 Add more elaborate test case for inheritance with generics with multiple overlapping interfaces --- .../generics/AbstractClassExposingItemB.java | 23 +++++ .../generics/AbstractClassExposingItemC.java | 27 +++++ .../generics/GenericsHierarchyMapper.java | 56 +++++++++++ .../generics/GenericsHierarchyTest.java | 99 +++++++++++++++++++ .../ap/test/abstractclass/generics/ItemA.java | 27 +++++ .../ap/test/abstractclass/generics/ItemB.java | 35 +++++++ .../ap/test/abstractclass/generics/ItemC.java | 35 +++++++ .../generics/ItemProviderAny.java | 28 ++++++ .../generics/ItemProviderSomeItemA.java | 26 +++++ .../generics/ItemProviderSomeItemB.java | 29 ++++++ .../generics/SourceWithItemB.java | 35 +++++++ .../generics/SourceWithItemC.java | 37 +++++++ .../test/abstractclass/generics/Target.java | 45 +++++++++ .../runner/EclipseCompilingStatement.java | 4 +- 14 files changed, 504 insertions(+), 2 deletions(-) create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemB.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemC.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyMapper.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyTest.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemA.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemB.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemC.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderAny.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemA.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemB.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemB.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemC.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/Target.java diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemB.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemB.java new file mode 100644 index 000000000..e615d73c6 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemB.java @@ -0,0 +1,23 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +public abstract class AbstractClassExposingItemB + implements ItemProviderAny, ItemProviderSomeItemA { +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemC.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemC.java new file mode 100644 index 000000000..b6902962f --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/AbstractClassExposingItemC.java @@ -0,0 +1,27 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + */ +public abstract class AbstractClassExposingItemC + implements ItemProviderSomeItemA, ItemProviderSomeItemB { + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyMapper.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyMapper.java new file mode 100644 index 000000000..e63d10fb2 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyMapper.java @@ -0,0 +1,56 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; +import org.mapstruct.ReportingPolicy; +import org.mapstruct.factory.Mappers; + +/** + * @author Andreas Gudian + * + */ +@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE) +public abstract class GenericsHierarchyMapper { + public static final GenericsHierarchyMapper INSTANCE = Mappers.getMapper( GenericsHierarchyMapper.class ); + + @Mapping(target = "itemC", source = "item") + public abstract Target toTarget(AbstractClassExposingItemC source); + + @Mapping(target = "itemB", source = "item") + public abstract Target toTarget(AbstractClassExposingItemB source); + + @Mapping(target = "item", source = "itemC") + public abstract void intoSourceWithItemC(Target target, @MappingTarget AbstractClassExposingItemC bean); + + @Mapping(target = "item", source = "itemB") + public abstract void intoSourceWithItemB(Target target, @MappingTarget AbstractClassExposingItemB bean); + + protected ItemC modifyItemC(ItemC item) { + item.setTypeParameterIsResolvedToItemC( true ); + return item; + } + + protected ItemB modifyItemB(ItemB item) { + item.setTypeParameterIsResolvedToItemB( true ); + return item; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyTest.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyTest.java new file mode 100644 index 000000000..6ec914509 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/GenericsHierarchyTest.java @@ -0,0 +1,99 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +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; + +import static org.fest.assertions.Assertions.assertThat; + +/** + * @author Andreas Gudian + * + */ +@RunWith(AnnotationProcessorTestRunner.class) +@IssueKey("644,687,688") +@WithClasses({ + AbstractClassExposingItemC.class, + AbstractClassExposingItemB.class, + GenericsHierarchyMapper.class, + ItemA.class, + ItemB.class, + ItemC.class, + ItemProviderSomeItemA.class, + ItemProviderAny.class, + ItemProviderSomeItemB.class, + Target.class +}) +public class GenericsHierarchyTest { + + @Test + public void determinesItemCSourceGetter() { + AbstractClassExposingItemC source = new SourceWithItemC(); + + source.setItem( new ItemC() ); + // make sure the jdk compiler resolves the same as we expect + source.getItem().setTypeParameterIsResolvedToItemC( false ); + + Target target = GenericsHierarchyMapper.INSTANCE.toTarget( source ); + + assertThat( target.getItemC().typeParameterIsResolvedToItemC() ).isTrue(); + assertThat( target.getItemC().typeParameterIsResolvedToItemB() ).isFalse(); + } + + @Test + public void determinesItemBSourceGetter() { + AbstractClassExposingItemB source = new SourceWithItemB(); + + source.setItem( new ItemB() ); + // make sure the jdk compiler resolves the same as we expect + source.getItem().setTypeParameterIsResolvedToItemB( false ); + + Target target = GenericsHierarchyMapper.INSTANCE.toTarget( source ); + + assertThat( target.getItemB().typeParameterIsResolvedToItemB() ).isTrue(); + } + + @Test + public void determinesItemCSourceSetter() { + Target target = new Target(); + + target.setItemC( new ItemC() ); + + SourceWithItemC source = new SourceWithItemC(); + GenericsHierarchyMapper.INSTANCE.intoSourceWithItemC( target, source ); + + assertThat( source.getItem().typeParameterIsResolvedToItemC() ).isTrue(); + } + + @Test + public void determinesItemBSourceSetter() { + Target target = new Target(); + + target.setItemB( new ItemB() ); + + SourceWithItemB source = new SourceWithItemB(); + GenericsHierarchyMapper.INSTANCE.intoSourceWithItemB( target, source ); + + assertThat( source.getItem().typeParameterIsResolvedToItemB() ).isTrue(); + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemA.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemA.java new file mode 100644 index 000000000..55d374572 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemA.java @@ -0,0 +1,27 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class ItemA { + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemB.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemB.java new file mode 100644 index 000000000..5034c984a --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemB.java @@ -0,0 +1,35 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class ItemB extends ItemA { + private boolean typeParameterIsResolvedToItemB; + + public boolean typeParameterIsResolvedToItemB() { + return typeParameterIsResolvedToItemB; + } + + public void setTypeParameterIsResolvedToItemB(boolean typeParameterIsResolvedToItemB) { + this.typeParameterIsResolvedToItemB = typeParameterIsResolvedToItemB; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemC.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemC.java new file mode 100644 index 000000000..f0ba92c63 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemC.java @@ -0,0 +1,35 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class ItemC extends ItemB { + private boolean typeParameterIsResolvedToItemC; + + public boolean typeParameterIsResolvedToItemC() { + return typeParameterIsResolvedToItemC; + } + + public void setTypeParameterIsResolvedToItemC(boolean typeParameterIsResolvedToItemC) { + this.typeParameterIsResolvedToItemC = typeParameterIsResolvedToItemC; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderAny.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderAny.java new file mode 100644 index 000000000..aac65b105 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderAny.java @@ -0,0 +1,28 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + */ +public interface ItemProviderAny { + X getItem(); + + void setItem(X id); +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemA.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemA.java new file mode 100644 index 000000000..44bb1e997 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemA.java @@ -0,0 +1,26 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + */ +public interface ItemProviderSomeItemA { + T getItem(); +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemB.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemB.java new file mode 100644 index 000000000..6d9dba677 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/ItemProviderSomeItemB.java @@ -0,0 +1,29 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + */ +public interface ItemProviderSomeItemB extends ItemProviderSomeItemA { + @Override + ID getItem(); + + void setItem(ID item); +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemB.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemB.java new file mode 100644 index 000000000..771b1a5c2 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemB.java @@ -0,0 +1,35 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class SourceWithItemB extends AbstractClassExposingItemB { + private ItemB item; + + public ItemB getItem() { + return item; + } + + public void setItem(ItemB item) { + this.item = item; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemC.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemC.java new file mode 100644 index 000000000..261272342 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/SourceWithItemC.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class SourceWithItemC extends AbstractClassExposingItemC { + private ItemC item; + + @Override + public ItemC getItem() { + return item; + } + + @Override + public void setItem(ItemC item) { + this.item = item; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/Target.java b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/Target.java new file mode 100644 index 000000000..6b22498cc --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/abstractclass/generics/Target.java @@ -0,0 +1,45 @@ +/** + * Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mapstruct.ap.test.abstractclass.generics; + +/** + * @author Andreas Gudian + * + */ +public class Target { + private ItemC itemC; + private ItemB itemB; + + public ItemC getItemC() { + return itemC; + } + + public void setItemC(ItemC itemC) { + this.itemC = itemC; + } + + public ItemB getItemB() { + return itemB; + } + + public void setItemB(ItemB itemB) { + this.itemB = itemB; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/testutil/runner/EclipseCompilingStatement.java b/processor/src/test/java/org/mapstruct/ap/testutil/runner/EclipseCompilingStatement.java index 18a7c69b5..f9ece7a98 100644 --- a/processor/src/test/java/org/mapstruct/ap/testutil/runner/EclipseCompilingStatement.java +++ b/processor/src/test/java/org/mapstruct/ap/testutil/runner/EclipseCompilingStatement.java @@ -55,8 +55,8 @@ class EclipseCompilingStatement extends CompilingStatement { config.setAnnotationProcessors( new String[] { MappingProcessor.class.getName() } ); config.setSourceFiles( getSourceFiles( compilationRequest.getSourceClasses() ) ); config.setShowWarnings( false ); - config.setSourceVersion( "1.6" ); - config.setTargetVersion( "1.6" ); + config.setSourceVersion( "1.8" ); + config.setTargetVersion( "1.8" ); for ( String option : compilationRequest.getProcessorOptions() ) { config.addCompilerCustomArgument( option, null );