Skip to content

Commit

Permalink
Restore lenient fallback in case of several non-public constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Sep 27, 2021
1 parent 93f8706 commit 9ff0d71
Showing 1 changed file with 7 additions and 8 deletions.
Expand Up @@ -254,14 +254,13 @@ else if (ctors.length == 0){
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
Expand Down

0 comments on commit 9ff0d71

Please sign in to comment.