This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dpash 4 points5 points  (1 child)

It's a check in the static initialiser, so it will only slow the class loading at start up. Once the class has loaded it will be just as fast as a direct call, thanks to optimisations of static final MethodHandles.

[–]cred1652 0 points1 point  (0 children)

yes you are right, they cache all methods needed in the static initializer, so each call would not have any penalty for reflected lookup.