Replace custom wrapped Throwable in XMPPException with Exception.cause
Description
Since Java 1.4, there is a built-in method to wrap an Exception in an Exception, supported by constructors and the getCause() method. This allows looping through the exception stack to find the original cause of the problem.
SMACK instead is using a custom wrappedThrowable variable, preventing a regular search using getCause() iteration.
I suggest changing the implementation of wrappedThrowable to rely on the existing Java API, and to deprecate the getWrappedThrowable method. Thus we could also get rid of all the custom printing/toString methods.
Since Java 1.4, there is a built-in method to wrap an Exception in an Exception, supported by constructors and the getCause() method. This allows looping through the exception stack to find the original cause of the problem.
SMACK instead is using a custom wrappedThrowable variable, preventing a regular search using getCause() iteration.
I suggest changing the implementation of wrappedThrowable to rely on the existing Java API, and to deprecate the getWrappedThrowable method. Thus we could also get rid of all the custom printing/toString methods.