Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Fixes #9086 again to solve race condition issue. #9588

Merged
merged 1 commit into from Jan 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -325,9 +325,10 @@ public String getParameter(String key) {
}

public String getMethodParameter(String method, String key, String defaultValue) {
// set consumerMethodParams firstly to avoid NPE at race condition.
if (methodParams == null) {
methodParams = URL.toMethodParameters(params);
consumerMethodParams = URL.toMethodParameters(consumerParams);
methodParams = URL.toMethodParameters(params);
}

String value = getMethodParameter(method, key, consumerMethodParams);
Expand Down Expand Up @@ -359,12 +360,14 @@ public boolean hasMethodParameter(String method, String key) {
}

public boolean hasMethodParameter(String method) {
// set consumerMethodParams firstly to NPE at race condition.
if (methodParams == null) {
methodParams = URL.toMethodParameters(params);
consumerMethodParams = URL.toMethodParameters(consumerParams);
methodParams = URL.toMethodParameters(params);
}

return consumerMethodParams.containsKey(method) || methodParams.containsKey(method);
return (CollectionUtils.isNotEmptyMap(consumerMethodParams) && consumerMethodParams.containsKey(method))
|| (CollectionUtils.isNotEmptyMap(methodParams) && methodParams.containsKey(method));
}

public String toDescString() {
Expand Down