BurningCN commented on code in PR #10389:
URL: https://github.com/apache/dubbo/pull/10389#discussion_r933809844
##########
dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java:
##########
@@ -514,8 +525,12 @@ protected void appendAnnotation(Class<?> annotationClass,
Object annotation) {
* @see AbstractConfig#appendParameters(Map, Object, String)
*/
public Map<String, String> getMetaData() {
+ return getMetaData(null);
+ }
+
+ public Map<String, String> getMetaData(String prefix) {
Map<String, String> metaData = new HashMap<>();
- appendAttributes(metaData, this);
+ appendAttributes(metaData, this, prefix);
Review Comment:
在原来getMetaData()的基础上,再添加一个带有prefix参数的重载的getMetaData方法。这样ConfigConfigurationAdapter在获取带前缀的元数据的时候直接调用此方法(`getMetaData(String
prefix)`)就可以了,不需要再像原来的逻辑 getMetaData() + 遍历entry对每个key拼上prefix。
--
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]