Restore lenient fallback in case of several non-public constructors
See gh-27437
This commit is contained in:
parent
93f8706dd3
commit
9ff0d717f2
|
|
@ -254,14 +254,13 @@ public abstract class BeanUtils {
|
|||
return (Constructor<T>) ctors[0];
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Several public constructors -> let's take the default constructor
|
||||
try {
|
||||
return clazz.getDeclaredConstructor();
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
// Giving up...
|
||||
}
|
||||
|
||||
// Several constructors -> let's try to take the default constructor
|
||||
try {
|
||||
return clazz.getDeclaredConstructor();
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
// Giving up...
|
||||
}
|
||||
|
||||
// No unique constructor at all
|
||||
|
|
|
|||
Loading…
Reference in New Issue