Throw an exception for suspending factory methods
Suspending factory methods are not supported, and can have side effects, so it is better to fail explicitly for such use case. Closes gh-32719
This commit is contained in:
@@ -720,7 +720,7 @@ public class MethodParameter {
|
||||
else if (this.executable instanceof Constructor<?> constructor) {
|
||||
parameterNames = discoverer.getParameterNames(constructor);
|
||||
}
|
||||
if (parameterNames != null) {
|
||||
if (parameterNames != null && this.parameterIndex < parameterNames.length) {
|
||||
this.parameterName = parameterNames[this.parameterIndex];
|
||||
}
|
||||
this.parameterNameDiscoverer = null;
|
||||
|
||||
Reference in New Issue
Block a user