Introduce support for creating a MethodParameter from a Java 8 Parameter [SPR-14055] #18627
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Sam Brannen opened SPR-14055 and commented
Status Quo
A
MethodParameter
orSynthesizingMethodParameter
can be created from aMethod
and anindex
; however, there is currently no first-class support for creating aMethodParameter
from ajava.lang.reflect.Parameter
.Related Resources
The
MethodParameterFactory
in thespring-test
project has factory methods for creating aMethodParameter
orSynthesizingMethodParameter
from a Java 8Parameter
.The trick involves retrieving the
java.lang.reflect.Executable
from the suppliedParameter
and then determining theindex
of the corresponding parameter.The following code excerpts demonstrate the technique.
Deliverables
MethodParameter
from ajava.lang.reflect.Parameter
.SynthesizingMethodParameter
from ajava.lang.reflect.Parameter
.Issue Links:
Referenced from: commits 7e783dd, 5f53a60, 39e3f2e
The text was updated successfully, but these errors were encountered: