Instead of performing an unchecked cast on Lambda#invoke_for_Object, why don't we do it with generics instead and perform the unchecked class in the library?
Also, though I know this is not going to be changed as this library is likely already in use by a lot of people (LambdaMetaFactory has horrible documentation, and I naturally stumbled upon it) - why snake_case? invokeForObject, invokeForBoolean is much more idiomatic.
Nobody is going to assume that invokeForBoolean returns a boxed boolean, they will check and they will have read the documentation, and they will know it isn't boxed.
Instead of performing an unchecked cast on Lambda#invoke_for_Object, why don't we do it with generics instead and perform the unchecked class in the library?
e.g.
Also, though I know this is not going to be changed as this library is likely already in use by a lot of people (LambdaMetaFactory has horrible documentation, and I naturally stumbled upon it) - why snake_case?
invokeForObject
,invokeForBoolean
is much more idiomatic.Nobody is going to assume that
invokeForBoolean
returns a boxed boolean, they will check and they will have read the documentation, and they will know it isn't boxed.