On Wed, 17 Mar 2021 18:15:37 GMT, Mandy Chung <[email protected]> wrote:

>> Other methods that delegate to `makeImpl` aren't doing up-front validation, 
>> so this change was made to get things more in line. It might be good to 
>> spell out that `makeImpl` does these checks for all its callers, though. 
>> (The `makeImpl` fast-path that execute before the validation can never 
>> return an invalid MethodType)
>
> Generally we have a public API implementation to check the arguments upfront 
> for readability.  In particular for this case, the validation cost is 
> negligible and removing the validation makes the code unclear where the 
> validation is done.  I prefer to keep the validation there.   It should check 
> that `nptype` is non-null and not `void.class`.

Ah, I mis-read your comment.   I now see that `makeImpl` does the argument 
validation.  Adding the comment would be helpful.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2300

Reply via email to