For 1): That makes sense to me.
For 2): Catching all exceptions is often something that is done by accident, and might catch things it was not intended to catch (and should be caught at a higher level). Instead of catching Exception, I propose we instead catch
RuntimeException in these cases.
In the code today we can already catch multiple exceptions, so it would just be one more in the case where you intentionally want to catch more exceptions. All the exceptions mentioned in the current CL (
IllegalStateException,
IllegalArgumentException, and
SecurityException) are RuntimeExceptions, and as such would have been caught. If you want to catch exceptions that happen at runtime like the CL suggests, we should be explicit about that by catching RuntimeException, with the added bonus of being intuitive to understand for new readers.
I also don't think there's any benefit to reading something like:
catch (Exception e) { ... }
over
catch(RemoteException | RuntimeException e) { ... }
rather the latter is easier to understand the intent behind in my view, since as a new reader I see that the author caught the checked exceptions, and I would have an assumption that since they explicitly thought about RuntimeExceptions. If they had only written Exception, my mind would typically think: Are they intentionally catching RuntimeExceptions here?
That being said, regardless when catching broad exceptions, I still think it is nice to add an explanatory comment.