<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: windows8</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>
<p dir="auto">在消费端使用注解<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/reference/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/reference">@reference</a>时候，其中registry中指定了具体的值（注册配置对应的id属性）后，在启动解析注解时候，会执行configureRegistryConfigs方法解析<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/reference/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/reference">@reference</a>中的registry属性值，在改属性里面设置了值后，会执行getBeans方法，在getBeans方法中会返回Collections.unmodifiableList集合</p>
</li>
<li>
<p dir="auto">在步骤1中返回的集合，会在接下来调用相应的ReferenceBean的方法setRegistries，设置到属性List registries中，此时的list是Collections.unmodifiableList实现。</p>
</li>
<li>
<p dir="auto">接下来，在ReferenceBean初始化中，会先检测注册配置，调用checkRegistry方法，在里面会将RegistryIds 转换为registries，即在convertRegistryIdsToRegistries方法中完成。</p>
</li>
<li>
<p dir="auto">convertRegistryIdsToRegistries 方法在有registryIds时候,有如下代码：<br>
<code class="notranslate">String[] ids = COMMA_SPLIT_PATTERN.split(registryIds); List&lt;RegistryConfig&gt; tmpRegistries = CollectionUtils.isNotEmpty(registries) ? registries : new ArrayList&lt;&gt;(); Arrays.stream(ids).forEach(id -&gt; { if (tmpRegistries.stream().noneMatch(reg -&gt; reg.getId().equals(id))) { tmpRegistries.add(ConfigManager.getInstance().getRegistry(id).orElseGet(() -&gt; { RegistryConfig registryConfig = new RegistryConfig(); registryConfig.setId(id); registryConfig.refresh(); return registryConfig; })); } });</code><br>
其中tmpRegistries.add时候会报错，因为此时的tmpRegistries是Collections.unmodifiableList实例，导致无法添加</p>
</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">改变下类型，使其可以进行添加</h3>