File tree 1 file changed +6
-3
lines changed
src/main/groovy/org/quartzpowered/apigen/gradle
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -167,10 +167,13 @@ class ApigenTask extends DefaultTask {
167
167
168
168
for (int i = 0 ; i < signatureNode. getArguments(). size(); i++ ) {
169
169
SignatureNode argument = signatureNode. getArguments(). get(i);
170
- LocalVariableNode localVariable = methodNode. localVariables. get(i + (isStatic ? 0 : 1 ));
170
+ String argumentName = methodNode. localVariables. get(i + (isStatic ? 0 : 1 )). name;
171
+ if (argumentName. equals(" this" )) {
172
+ argumentName = methodNode. localVariables. get(i + (isStatic ? 1 : 2 )). name;
173
+ }
171
174
172
175
String argumentType = toApiNamespace(argument. type);
173
- methodDef. param(directClass(argumentType), localVariable . name );
176
+ methodDef. param(directClass(argumentType), argumentName );
174
177
}
175
178
176
179
JBlock body = methodDef. body()
@@ -228,7 +231,7 @@ class ApigenTask extends DefaultTask {
228
231
229
232
for (int i = 0 ; i < signatureNode. getArguments(). size(); i++ ) {
230
233
SignatureNode argument = signatureNode. getArguments(). get(i);
231
- LocalVariableNode localVariable = methodNode. localVariables. get(i + (isStatic ? 0 : 1 ));
234
+ LocalVariableNode localVariable = methodNode. localVariables. get(i + (isStatic ? 0 : 1 )). name ;
232
235
233
236
String argumentType = toApiNamespace(argument. type);
234
237
methodDef. param(directClass(argumentType), localVariable. name);
You can’t perform that action at this time.
0 commit comments