Settings

Theme

Static Exceptions for Flow Control

travishaagen.github.io

1 points by sea-gold 16 days ago · 1 comment

Reader

sea-goldOP 16 days ago

> TL;DR

> To create high performance exceptions for flow control in the JVM, simply extend the following StaticException class. Then store the Exception instance in a static final field and throw it as needed. They're fast, because the call stack doesn't need to be traversed and since we're creating reusable objects, there's less for the garbage collector to do.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection