diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/PojoUtils.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/PojoUtils.java index 81310dbbae8485951ca5b3f0710579d2c2a516e5..34cc23b55233aa43b17b632d2c5f83d49dba3b23 100644 --- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/PojoUtils.java +++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/PojoUtils.java @@ -110,7 +110,7 @@ public class PojoUtils { return ((Class)pojo).getName(); } - Integer id = System.identityHashCode(pojo); + Integer id = hashCode(pojo); if (history.containsKey(id)) { return history.get(id); } @@ -227,7 +227,7 @@ public class PojoUtils { private static Object realize1(Object pojo, Class type, final Map history) { return realize0(pojo, type, null , history); } - + @SuppressWarnings({ "unchecked", "rawtypes" }) private static Object realize0(Object pojo, Class type, Type genericType, final Map history) { if (pojo == null) { @@ -473,4 +473,7 @@ public class PojoUtils { && ! Map.class.isAssignableFrom(cls); } + private static int hashCode(Object object) { + return 31 * (object.getClass().getName().hashCode() ^ System.identityHashCode(object)); + } } \ No newline at end of file