You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/07/23 02:36:06 UTC

[dubbo] branch 3.0 updated: Adjust the modifier of DynamicParamTable#init method (#8332)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new b50effe  Adjust the modifier of DynamicParamTable#init method (#8332)
b50effe is described below

commit b50effe1397341e3e556f75c7cae3a9430e95ef7
Author: 灼华 <43...@users.noreply.github.com>
AuthorDate: Thu Jul 22 21:35:55 2021 -0500

    Adjust the modifier of DynamicParamTable#init method (#8332)
    
    * Adjust the modifier of DynamicParamTable#init method
    
    * Put the call to the getParameters() method outside the loop
---
 .../src/main/java/org/apache/dubbo/common/url/component/URLParam.java  | 3 ++-
 .../org/apache/dubbo/common/url/component/param/DynamicParamTable.java | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLParam.java b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLParam.java
index 574f4c7..01434ac 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLParam.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLParam.java
@@ -521,8 +521,9 @@ public class URLParam {
         }
 
         boolean hasAndEqual = true;
+        Map<String, String> urlParamMap = getParameters();
         for (Map.Entry<String, String> entry : parameters.entrySet()) {
-            String value = getParameters().get(entry.getKey());
+            String value = urlParamMap.get(entry.getKey());
             if (value == null) {
                 if (entry.getValue() != null) {
                     hasAndEqual = false;
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicParamTable.java b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicParamTable.java
index 76bfc05..7abac95 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicParamTable.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicParamTable.java
@@ -74,7 +74,7 @@ public final class DynamicParamTable {
         return VALUES.get(vi).defaultVal();
     }
 
-    public static void init() {
+    private static void init() {
         List<String> keys = new LinkedList<>();
         List<ParamValue> values = new LinkedList<>();
         Map<String, Integer> key2Index = new HashMap<>(64);