diff --git a/patches/8036-draft.diff b/patches/8036-draft.diff index c267c55..1ba0dee 100644 --- a/patches/8036-draft.diff +++ b/patches/8036-draft.diff @@ -1,5 +1,5 @@ diff --git a/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java b/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java -index 76bb6080c73c..da54d0c76922 100644 +index 76bb6080c73c..5ac38f940612 100644 --- a/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java +++ b/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java @@ -26,6 +26,7 @@ @@ -20,16 +20,15 @@ index 76bb6080c73c..da54d0c76922 100644 /** * NetBeans implementation of a PAC script evaluator. This implementation -@@ -196,6 +200,8 @@ public class NbPacScriptEvaluator implements PacScriptEvaluator { +@@ -196,6 +200,7 @@ public class NbPacScriptEvaluator implements PacScriptEvaluator { private static final String PAC_SOCKS5_FFEXT = "SOCKS5"; // Mozilla Firefox extension. Not part of original Netscape spec. private static final String PAC_HTTP_FFEXT = "HTTP"; // Mozilla Firefox extension. Not part of original Netscape spec. private static final String PAC_HTTPS_FFEXT = "HTTPS"; // Mozilla Firefox extension. Not part of original Netscape spec. -+ private static class RPSingleton { private static final RequestProcessor instance = new RequestProcessor(NbPacScriptEvaluator.class.getName(), Runtime.getRuntime().availableProcessors(), true, false); } -+ private static RequestProcessor getRequestProcessor() { return RPSingleton.instance; } ++ private static final RequestProcessor RP = new RequestProcessor(NbPacScriptEvaluator.class.getName(), Runtime.getRuntime().availableProcessors(), true, false); private final String pacScriptSource; -@@ -213,7 +219,7 @@ public NbPacScriptEvaluator(String pacSourceCocde) throws PacParsingException { +@@ -213,7 +218,7 @@ public NbPacScriptEvaluator(String pacSourceCocde) throws PacParsingException { @Override public List findProxyForURL(URI uri) throws PacValidationException { @@ -38,7 +37,7 @@ index 76bb6080c73c..da54d0c76922 100644 // First try the cache if (resultCache != null) { -@@ -222,38 +228,37 @@ public List findProxyForURL(URI uri) throws PacValidationException { +@@ -222,38 +227,37 @@ public List findProxyForURL(URI uri) throws PacValidationException { return jsResultAnalyzed; } } @@ -73,7 +72,7 @@ index 76bb6080c73c..da54d0c76922 100644 + jsResultAnalyzed = executeProxyScript(uri); + } else { + AtomicReference> resultHolder = new AtomicReference<>(null); -+ Task task = getRequestProcessor().post(() -> { ++ Task task = RP.post(() -> { + resultHolder.set(executeProxyScript(uri)); + }); + @@ -104,7 +103,7 @@ index 76bb6080c73c..da54d0c76922 100644 @Override public boolean usesCaching() { return (canUseURLCaching && (resultCache != null)); -@@ -275,6 +280,32 @@ public String getPacScriptSource() { +@@ -275,6 +279,32 @@ public String getPacScriptSource() { return this.pacScriptSource; } @@ -210,7 +209,7 @@ index 178c9b162feb..90812bfa4612 100644 testPacFile2("pac-test4.js", factory); } diff --git a/platform/o.n.core/src/org/netbeans/core/ProxySettings.java b/platform/o.n.core/src/org/netbeans/core/ProxySettings.java -index 2d29427cd3c2..593c99f5d6fe 100644 +index 2d29427cd3c2..bb0bc42ae19f 100644 --- a/platform/o.n.core/src/org/netbeans/core/ProxySettings.java +++ b/platform/o.n.core/src/org/netbeans/core/ProxySettings.java @@ -49,6 +49,8 @@ public class ProxySettings { @@ -227,7 +226,7 @@ index 2d29427cd3c2..593c99f5d6fe 100644 } + public static int getPacScriptTimeout() { -+ return NbPreferences.forModule(ProxySettings.class) ++ return getPreferences () + .getInt(PAC_SCRIPT_TIMEOUT, DEFAULT_TIMEOUT); + }