#3040: Allow using only BeanMapping#mappingControl

This commit is contained in:
Orange Add 2022-11-04 05:02:58 +08:00 committed by GitHub
parent 81b2f70dac
commit bb099a55ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -92,6 +92,7 @@ public class BeanMappingOptions extends DelegatingOptions {
private static boolean isConsistent(BeanMappingGem gem, ExecutableElement method,
FormattingMessager messager) {
if ( !gem.resultType().hasValue()
&& !gem.mappingControl().hasValue()
&& !gem.qualifiedBy().hasValue()
&& !gem.qualifiedByName().hasValue()
&& !gem.ignoreUnmappedSourceProperties().hasValue()

View File

@ -7,7 +7,6 @@ package org.mapstruct.ap.test.subclassmapping;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueMappingStrategy;
import org.mapstruct.SubclassMapping;
import org.mapstruct.ap.test.subclassmapping.mappables.Bike;
import org.mapstruct.ap.test.subclassmapping.mappables.Car;
@ -21,6 +20,6 @@ public interface DeepCloneMethodMapper {
@SubclassMapping( source = Car.class, target = Car.class )
@SubclassMapping( source = Bike.class, target = Bike.class )
@BeanMapping( mappingControl = DeepClone.class, nullValueMappingStrategy = NullValueMappingStrategy.RETURN_NULL )
@BeanMapping( mappingControl = DeepClone.class )
Vehicle map(Vehicle vehicle);
}