* fix #10045, use ArrayList * fix checkstyle * fix #10045, fix unsupported operation lis Co-authored-by: 呈铭 <beck.wcm@antgroup.com>
This commit is contained in:
parent
7ff818f36a
commit
7b8019fef6
|
|
@ -417,10 +417,13 @@ public class ServiceInstancesChangedListener {
|
|||
}
|
||||
|
||||
protected List<URL> toUrlsWithEmpty(List<URL> urls) {
|
||||
if (urls == null) {
|
||||
boolean emptyProtectionEnabled = serviceDiscovery.getUrl().getParameter(ENABLE_EMPTY_PROTECTION_KEY, true);
|
||||
if (!emptyProtectionEnabled && urls == null) {
|
||||
urls = new ArrayList<>();
|
||||
} else if (emptyProtectionEnabled && urls == null) {
|
||||
urls = Collections.emptyList();
|
||||
}
|
||||
boolean emptyProtectionEnabled = serviceDiscovery.getUrl().getParameter(ENABLE_EMPTY_PROTECTION_KEY, true);
|
||||
|
||||
if (CollectionUtils.isEmpty(urls) && !emptyProtectionEnabled) {
|
||||
// notice that the service of this.url may not be the same as notify listener.
|
||||
URL empty = URLBuilder.from(this.url)
|
||||
|
|
|
|||
Loading…
Reference in New Issue