This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Description
Validate.notIllegalArgument(buffer.isDirect(), new IllegalArgumentException(String.format("buffer.isDirect(): %b (expected: direct buffer)", buffer.isDirect())));
Second argument is executed independent of the truth value of the first one. Thus even buffer.isDirect is true, IllegalArgumentException constructor and String.format is executed. This yields unnecessary computation on CPU. An example jvisualvm CPU sampling is shown below.
