Pavel Pismerov I think about it more today and I don't think we can do something in HV. The ParameterNameProvider API is dealing with methods and constructors directly and we can't really change it to ignore synthetic parameters. I could do the change in HV but that would break the Spring use case as they are using their own ParameterNameProvider which does not ignore synthetic parameters in the standard Java reflection case. Thus, I think it's an issue with Kotlin: Kotlin should report consistently either all the parameters or only the non synthetic parameters but shouldn't report one or the other depending on the method calls. As mentioned in the SO answer:
- the constructor as provided by the reflection API is: com.test.simple.Group(java.lang.String $enum$name, int $enum$ordinal, java.lang.String groupName, java.lang.String groupDescription) so it has four parameters. I suppose the name and the ordinal are passed to the constructor;
- the parameter names as provided by KotlinReflectionParameterNameDiscoverer are only [groupName, groupDescription] (so not taking into account the additional parameters).
Could you open a Kotlin issue and see what they are thinking about it? I would appreciate a follow-up here with a link to the issue. Thanks! |