#81, remove isHasFactoryMethod construction in the Freemarker template in favour for the '??'

This commit is contained in:
sjaakd 2014-02-02 16:40:17 +01:00
parent 8bdec6405d
commit b456cc8b6b
2 changed files with 1 additions and 8 deletions

View File

@ -39,13 +39,11 @@ public class BeanMappingMethod extends MappingMethod {
private final List<PropertyMapping> propertyMappings; private final List<PropertyMapping> propertyMappings;
private final FactoryMethod factoryMethod; private final FactoryMethod factoryMethod;
private final boolean hasFactoryMethod;
public BeanMappingMethod(Method method, List<PropertyMapping> propertyMappings, FactoryMethod factoryMethod) { public BeanMappingMethod(Method method, List<PropertyMapping> propertyMappings, FactoryMethod factoryMethod) {
super( method ); super( method );
this.propertyMappings = propertyMappings; this.propertyMappings = propertyMappings;
this.factoryMethod = factoryMethod; this.factoryMethod = factoryMethod;
this.hasFactoryMethod = factoryMethod != null;
} }
public List<PropertyMapping> getPropertyMappings() { public List<PropertyMapping> getPropertyMappings() {
@ -64,7 +62,6 @@ public class BeanMappingMethod extends MappingMethod {
} }
} }
} }
return mappingsByParameter; return mappingsByParameter;
} }
@ -79,10 +76,6 @@ public class BeanMappingMethod extends MappingMethod {
return types; return types;
} }
public boolean isHasFactoryMethod() {
return this.hasFactoryMethod;
}
public FactoryMethod getFactoryMethod() { public FactoryMethod getFactoryMethod() {
return this.factoryMethod; return this.factoryMethod;
} }

View File

@ -25,7 +25,7 @@ public <@includeModel object=returnType/> ${name}(<#list parameters as param><@i
} }
<#if !existingInstanceMapping> <#if !existingInstanceMapping>
${resultType.name} ${resultName} = <#if hasFactoryMethod><@includeModel object=factoryMethod/><#else>new ${resultType.name}()</#if>; ${resultType.name} ${resultName} = <#if factoryMethod??><@includeModel object=factoryMethod/><#else>new ${resultType.name}()</#if>;
</#if> </#if>
<#if (sourceParameters?size > 1)> <#if (sourceParameters?size > 1)>
<#list sourceParameters as sourceParam> <#list sourceParameters as sourceParam>