So the workaround is:
IOException ioe = new IOException("message");It can also be written as:
ioe.initCause(e);
throw ioe;
throw (IOException) new IOException("message").initCause(e);It is not a major problem, but still. We can all thank the guy who reported that as a bug to Sun in 2004.
the code sure is handy... but i have just one question though; why do you need to throw IOException? Isn't this analogous to throwing Exception, which is an anti-pattern.
ReplyDelete