Status: Resolved (View Workflow)
Affects Version/s: 4.2.0.Final
The problem here is that, when I use a Interface (Rest Interface) for ex. here:
You see the interface itself has a @Path and some methods have a path too and some of them doesn't have a path annotation so they referencing to the classPathAnnotation above. So now when you want to create a RestClient with:
I get this error:
Now, I debuged and reverse-engineered the code and I found this code below:
The main problem is that the variable classTemplate is not immutable.
At line 381 on the same file you see a assignment to template (a temporary variable) later in the code at 410 (like the github link above) you see that there is method call on the template variable. This mutates it and then the former classTemplate is now mutated.
The former classTemplate's path was
after the line 410 the path becomes
and the second iteration in this for-loop (Line 392) got an error on line 406 because the method template.getPathParamNamesInDeclarationOrder() on line 390 returns a empty list because it cant find any pathparams, because it was mutated before.
I hope I could explain it, well. It is a small and hidden bug.