manzhizhen commented on a change in pull request #8772:
URL: https://github.com/apache/dubbo/pull/8772#discussion_r706793738
##########
File path:
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AttachmentsAdapter.java
##########
@@ -22,12 +22,18 @@
/**
* This class provides map adapters to support attachments in RpcContext,
Invocation and Result switch from
* <String, String> to <String, Object>
+ *
+ * please use {@link org.apache.dubbo.common.utils.MapUtils}
+ *
*/
+@Deprecated
public class AttachmentsAdapter {
+ @Deprecated
public static class ObjectToStringMap extends HashMap<String, String> {
private Map<String, Object> attachments;
+ @Deprecated
Review comment:
Hmm, the new method takes this into consideration, calling
Object#toString() directly。Using JSON here may not be the best choice.
/**
* use {@link Object#toString()} switch Obj to String
*
* @param obj
* @return
*/
private static String convertToString(Object obj) {
if (obj == null) {
return null;
} else {
return obj.toString();
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]