mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#941 undesired too postfixes in local variable names
This commit is contained in:
parent
ea6493d983
commit
d1388c3a45
@ -90,23 +90,25 @@ public abstract class MappingMethod extends ModelElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected MappingMethod(Method method, List<Parameter> parameters) {
|
protected MappingMethod(Method method, List<Parameter> parameters) {
|
||||||
this( method, parameters, method.getParameterNames(), null, null, Collections.<ForgedMethod>emptyList() );
|
this( method, parameters, new ArrayList<String>( method.getParameterNames() ), null, null,
|
||||||
|
Collections.<ForgedMethod>emptyList() );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MappingMethod(Method method) {
|
protected MappingMethod(Method method) {
|
||||||
this( method, method.getParameterNames(), null, null );
|
this( method, new ArrayList<String>( method.getParameterNames() ), null, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences,
|
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences,
|
||||||
List<LifecycleCallbackMethodReference> afterMappingReferences) {
|
List<LifecycleCallbackMethodReference> afterMappingReferences) {
|
||||||
this( method, method.getParameterNames(), beforeMappingReferences, afterMappingReferences );
|
this( method, new ArrayList<String>( method.getParameterNames() ), beforeMappingReferences,
|
||||||
|
afterMappingReferences );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences,
|
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences,
|
||||||
List<LifecycleCallbackMethodReference> afterMappingReferences,
|
List<LifecycleCallbackMethodReference> afterMappingReferences,
|
||||||
List<ForgedMethod> forgedMethods) {
|
List<ForgedMethod> forgedMethods) {
|
||||||
this( method, method.getParameters(), method.getParameterNames(), beforeMappingReferences,
|
this( method, method.getParameters(), new ArrayList<String>( method.getParameterNames() ),
|
||||||
afterMappingReferences, forgedMethods );
|
beforeMappingReferences, afterMappingReferences, forgedMethods );
|
||||||
}
|
}
|
||||||
|
|
||||||
public MappingMethod(Method method, Collection<String> existingVariableNames,
|
public MappingMethod(Method method, Collection<String> existingVariableNames,
|
||||||
|
@ -314,11 +314,13 @@ public class SourceMethod implements Method {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getParameterNames() {
|
public List<String> getParameterNames() {
|
||||||
if ( parameterNames == null ) {
|
if ( parameterNames == null ) {
|
||||||
parameterNames = new ArrayList<String>( parameters.size() );
|
List<String> names = new ArrayList<String>( parameters.size() );
|
||||||
|
|
||||||
for ( Parameter parameter : parameters ) {
|
for ( Parameter parameter : parameters ) {
|
||||||
parameterNames.add( parameter.getName() );
|
names.add( parameter.getName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parameterNames = Collections.unmodifiableList( names );
|
||||||
}
|
}
|
||||||
|
|
||||||
return parameterNames;
|
return parameterNames;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user