@@ -35,6 +35,8 @@ public class ParamNameResolver {
35
35
36
36
public static final String GENERIC_NAME_PREFIX = "param" ;
37
37
38
+ private final boolean useActualParamName ;
39
+
38
40
/**
39
41
* <p>
40
42
* The key is the index and the value is the name of the parameter.<br />
@@ -51,9 +53,9 @@ public class ParamNameResolver {
51
53
private final SortedMap <Integer , String > names ;
52
54
53
55
private boolean hasParamAnnotation ;
54
- private boolean useActualParamName ;
55
56
56
57
public ParamNameResolver (Configuration config , Method method ) {
58
+ this .useActualParamName = config .isUseActualParamName ();
57
59
final Class <?>[] paramTypes = method .getParameterTypes ();
58
60
final Annotation [][] paramAnnotations = method .getParameterAnnotations ();
59
61
final SortedMap <Integer , String > map = new TreeMap <>();
@@ -74,15 +76,13 @@ public ParamNameResolver(Configuration config, Method method) {
74
76
}
75
77
if (name == null ) {
76
78
// @Param was not specified.
77
- if (config . isUseActualParamName () ) {
79
+ if (useActualParamName ) {
78
80
name = getActualParamName (method , paramIndex );
79
81
}
80
82
if (name == null ) {
81
83
// use the parameter index as the name ("0", "1", ...)
82
84
// gcode issue #71
83
85
name = String .valueOf (map .size ());
84
- } else {
85
- useActualParamName = true ;
86
86
}
87
87
}
88
88
map .put (paramIndex , name );
0 commit comments