4 ms·
Checked exceptions are a leaky concept in Java. The Java type system has no union types so you can not have a generics method that abstract more than one except
by _old_dude_ 3y ago
Checked exceptions are a leaky concept in Java.
The Java type system has no union types so you can not have a generics method that abstract more than one exception.
That's why Stream::map can not capture the checked exceptions properly.
- pharmakom 3y agoYes! The problem with the Java implementation of checked exceptions is the inheritance hierarchy, which encourages catching the broadest possible error.
- rozap 3y agoDefinitely they have shortcomings in Java but throwing the concept out entirely is a bummer. It creates a whole shadow type system where all bets are off.