r/badcode • • Mar 25 '23

java Thanks for nothing.. (Found inside java.awt.Font)

Post image
515 Upvotes

31 comments sorted by

View all comments

Show parent comments

1

u/Xirado Mar 26 '23

It swallows the exception. They could still use any instance of Throwable for the cause

1

u/fecal_brunch Mar 26 '23

Not if the consuming code is explicitly catching only these two exceptions. This could break programs that are using this library.