diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java index 87e9b25a001..dbf32fde8dc 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java @@ -38,16 +38,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.apache.dubbo.common.constants.CommonConstants.ENABLED_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.HOST_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; import static org.apache.dubbo.rpc.cluster.Constants.ADDRESS_KEY; import static org.apache.dubbo.rpc.cluster.Constants.FORCE_KEY; import static org.apache.dubbo.rpc.cluster.Constants.PRIORITY_KEY; import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY; import static org.apache.dubbo.rpc.cluster.Constants.RUNTIME_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX; -import static org.apache.dubbo.common.constants.CommonConstants.ENABLED_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.HOST_KEY; /** * ConditionRouter @@ -238,7 +237,7 @@ private boolean matchCondition(Map condition, URL url, URL pa } else { sampleValue = sample.get(key); if (sampleValue == null) { - sampleValue = sample.get(DEFAULT_KEY_PREFIX + key); + sampleValue = sample.get(key); } } if (sampleValue != null) { diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java index 106bebc70c2..11d89cb243a 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java @@ -40,20 +40,19 @@ import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; -import static org.apache.dubbo.common.constants.CommonConstants.HOST_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.PORT_KEY; import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_KEY; import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE; import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN; -import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX; import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.HOST_KEY; import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; import static org.apache.dubbo.common.constants.CommonConstants.LOCALHOST_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.PASSWORD_KEY; import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.PORT_KEY; import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.PASSWORD_KEY; import static org.apache.dubbo.common.constants.CommonConstants.USERNAME_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY; /** * URL - Uniform Resource Locator (Immutable, ThreadSafe) @@ -492,11 +491,7 @@ public String getParameterAndDecoded(String key, String defaultValue) { } public String getParameter(String key) { - String value = parameters.get(key); - if (StringUtils.isEmpty(value)) { - value = parameters.get(DEFAULT_KEY_PREFIX + key); - } - return value; + return parameters.get(key); } public String getParameter(String key, String defaultValue) { diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URLBuilder.java b/dubbo-common/src/main/java/org/apache/dubbo/common/URLBuilder.java index 5c926f94383..677cbe083f8 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/URLBuilder.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URLBuilder.java @@ -24,8 +24,6 @@ import java.util.Map; import java.util.Objects; -import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX; - public final class URLBuilder { private String protocol; @@ -343,10 +341,6 @@ public boolean hasParameter(String key) { } public String getParameter(String key) { - String value = parameters.get(key); - if (StringUtils.isEmpty(value)) { - value = parameters.get(DEFAULT_KEY_PREFIX + key); - } - return value; + return parameters.get(key); } } diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java index 246694822a7..e1018108a56 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java @@ -178,11 +178,7 @@ protected static void appendParameters(Map parameters, Object co str = URL.encode(str); } if (parameter != null && parameter.append()) { - String pre = parameters.get(DEFAULT_KEY + "." + key); - if (pre != null && pre.length() > 0) { - str = pre + "," + str; - } - pre = parameters.get(key); + String pre = parameters.get(key); if (pre != null && pre.length() > 0) { str = pre + "," + str; }