Have you verified that HotSpot elides the if-checks when this is false?