You aren't silently suppressing the exception, right? As for item 2 of the OP, sure you can factor functionality out of the catch block. Why would you think otherwise? Having multiple occurrences of a ...
Learn how to use pattern-matching features in your Java programs, including pattern matching with switch statements, when clauses, sealed classes, and a preview of primitive type pattern matching in ...