I recently came across an odd pattern in two completely independent bits of Java code: when creating metadata, which is already a Throwablemore specific exception class. For example, from some Tomcat code:
Exception exception = ex.getException();
if (exception instanceof IOException) {
throw (IOException) exception;
}
Reducing to IOExceptionme seems completely pointless, but, having seen this twice in the wild, I wonder if I am missing something?
Aron source
share