Java 6 compatibility#876
Conversation
|
@lwahonen Will could you have a look at this changeset? I had a look at the "Java 6 compatibility" problem, and this would be my suggestion for a fix. The usage of reflection will creation of the exception down, but considering this is the already slow exception path I consider this acceptable. In turn this keeps the functionality for newer JDKs in place. What do you think? If you agree, I'll backport this to the 4.5.1-dev branch and will do a release for that. |
|
Should we log the suppressed error here? Other than that, I think your solution is much better than my quick-and-dirty hack was. Thank you! |
|
I would not change that. This leaves the first case: If the method is not present, its companion |
addSuppressed was added to Throwable in JDK7, to be compatible with Java 6 it can't be called directly. To replace the functionality reflection is used. A helper method "addSuppressedRelfected" was introduced into the only class, that currently uses suppressed exceptions (Win32Exception).
d17f153 to
e240a2d
Compare
This is a partial fix to restore Java 6 compatibility: