From ba10a8c1232aa5ae90180562a04eb5c745c1c60e Mon Sep 17 00:00:00 2001 From: Andreas Gudian Date: Tue, 21 Oct 2014 20:06:17 +0200 Subject: [PATCH] use == instead of equals when comparing enum instances --- .../main/java/org/mapstruct/ap/model/BeanMappingMethod.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java index 7dcb182e1..d7d99348d 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java @@ -102,15 +102,15 @@ public class BeanMappingMethod extends MappingMethod { // A target access is in general a setter method on the target object. However, in case of collections, // the current target accessor can also be a getter method. // The following if block, checks if the target accessor should be overruled by an add method. - if ( cmStrategy.equals( CollectionMappingStrategy.SETTER_PREFERRED ) - || cmStrategy.equals( CollectionMappingStrategy.ADDER_PREFERRED ) ) { + if ( cmStrategy == CollectionMappingStrategy.SETTER_PREFERRED + || cmStrategy == CollectionMappingStrategy.ADDER_PREFERRED ) { // first check if there's a setter method. ExecutableElement adderMethod = null; if ( Executables.isSetterMethod( targetAccessor ) ) { Type targetType = ctx.getTypeFactory().getSingleParameter( targetAccessor ).getType(); // ok, the current accessor is a setter. So now the strategy determines what to use - if ( cmStrategy.equals( CollectionMappingStrategy.ADDER_PREFERRED ) ) { + if ( cmStrategy == CollectionMappingStrategy.ADDER_PREFERRED ) { adderMethod = method.getResultType().getAdderForType( targetType, targetPropertyName ); } }