Java / Exception
Which exception advised not to be thrown from close method when implementing AutoCloseable?
It is strongly advised to not have the close method throw InterruptedException. This exception interacts with a thread's interrupted status, and runtime misbehavior is likely to occur if an InterruptedException is suppressed. More generally, if it would cause problems for an exception to be suppressed, the AutoCloseable.close method should not throw it.
More Related questions...