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

matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 3914fb5  Fix bug when adding to the potentially unmodifiable 
collection returned by original.select(URI).
     new d8dfc52  Merge pull request #2579 from 
streamsim/do-not-try-to-add-to-an-potential-unmodifiablecollection
3914fb5 is described below

commit 3914fb5c870453bfa8a93b41e70c5c07523ba0b7
Author: Matteo Di Giovinazzo <digiovina...@streamsim.com>
AuthorDate: Fri Dec 4 10:27:03 2020 -0700

    Fix bug when adding to the potentially unmodifiable collection returned by 
original.select(URI).
    
    Also always add to the res variable created at the beginning of the method.
---
 .../src/org/netbeans/core/network/proxy/NbProxySelector.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/platform/core.network/src/org/netbeans/core/network/proxy/NbProxySelector.java
 
b/platform/core.network/src/org/netbeans/core/network/proxy/NbProxySelector.java
index 394c39a..8143984 100644
--- 
a/platform/core.network/src/org/netbeans/core/network/proxy/NbProxySelector.java
+++ 
b/platform/core.network/src/org/netbeans/core/network/proxy/NbProxySelector.java
@@ -67,12 +67,12 @@ public final class NbProxySelector extends ProxySelector {
         int proxyType = ProxySettings.getProxyType ();
         switch (proxyType) {
             case ProxySettings.DIRECT_CONNECTION:
-                res = Collections.singletonList (Proxy.NO_PROXY);
+                res.add(Proxy.NO_PROXY);
                 break;
             case ProxySettings.AUTO_DETECT_PROXY:
                 if (useSystemProxies ()) {
                     if (original != null) {
-                        res = original.select(uri);                   
+                        res.addAll(original.select(uri));
                     }
                 } else {                    
                     String protocol = uri.getScheme ();
@@ -145,7 +145,7 @@ public final class NbProxySelector extends ProxySelector {
             case ProxySettings.AUTO_DETECT_PAC:
                 if (useSystemProxies ()) {
                     if (original != null) {
-                        res = original.select(uri);                   
+                        res.addAll(original.select(uri));
                     }
                 } else {
                     ProxyAutoConfig pac = ProxyAutoConfig.get(getPacFile());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to