Skip to content

Commit

Permalink
Add jvmstatic
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuubiRan committed Aug 26, 2023
1 parent e5f143e commit 43b31e2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ object ClassUtils {
* @throws NoSuchMethodException if the constructor is not found
*/
@Throws(NoSuchMethodException::class)
@JvmStatic
fun newInstance(clz: Class<*>, paramTypes: ParamTypes = paramTypes(), params: Params = params()): Any {
val cf = clz.constructorFinder().filterByParamTypes(*paramTypes.types)

Expand All @@ -308,6 +309,7 @@ object ClassUtils {
* @throws NoSuchMethodException if the constructor is not found
*/
@Throws(NoSuchMethodException::class)
@JvmStatic
fun newInstanceBestMatch(clz: Class<*>, vararg params: Any?): Any {
val paramTypes = params.map { it?.let { it::class.java } }.toTypedArray()
val cf = clz.constructorFinder().filterByAssignableParamTypes(*paramTypes)
Expand Down

0 comments on commit 43b31e2

Please sign in to comment.