When the object's writeReplace return itself, then just serialize it as the normal object. No need to do another recursive call, which will cause infinite recursion.
Verifying this change
Check the newly added unit test case: Hessian2WriteReplaceTest.java
What is the purpose of the change
Fix #2031
Brief changelog
When the object's writeReplace return itself, then just serialize it as the normal object. No need to do another recursive call, which will cause infinite recursion.
Verifying this change
Check the newly added unit test case: Hessian2WriteReplaceTest.java