On Tue, 13 Jan 2026 18:05:43 GMT, Jan Lahoda <[email protected]> wrote:

> The SwitchBootstraps.enumSwitch is documented to throw a NullPointerException 
> when lookup is null, but it does not throw the exception in all cases.

Nothing against failing fast, but wouldn't this argumentation open a can of 
worms? The method documents that it can throw multiple exceptions but there is 
no guaranteed order of argument checking. So even if the method documents that 
it rejects a null `labels` parameter it is still valid to throw a 
IllegalArgumentException first when checking the `invocationType`  parameter.

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

PR Comment: https://git.openjdk.org/jdk/pull/29202#issuecomment-3746511952

Reply via email to