apache / dubbo-hessian-lite

Hessian Lite for Apache Dubbo
Apache License 2.0
53 stars 47 forks source link

[Dubbo-2031] Fix hessian2 serialization infinit recursion(StackOverflowError) when object's writeReplace method returns the object itself #1

Closed nobodyiam closed 6 years ago

nobodyiam commented 6 years ago

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