1
1
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
2
- index 76bb6080c73c..da54d0c76922 100644
2
+ index 76bb6080c73c..5ac38f940612 100644
3
3
--- a/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java
4
4
+++ b/platform/core.network/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluator.java
5
5
@@ -26,6 +26,7 @@
@@ -20,16 +20,15 @@ index 76bb6080c73c..da54d0c76922 100644
20
20
21
21
/**
22
22
* NetBeans implementation of a PAC script evaluator. This implementation
23
- @@ -196,6 +200,8 @@ public class NbPacScriptEvaluator implements PacScriptEvaluator {
23
+ @@ -196,6 +200,7 @@ public class NbPacScriptEvaluator implements PacScriptEvaluator {
24
24
private static final String PAC_SOCKS5_FFEXT = "SOCKS5"; // Mozilla Firefox extension. Not part of original Netscape spec.
25
25
private static final String PAC_HTTP_FFEXT = "HTTP"; // Mozilla Firefox extension. Not part of original Netscape spec.
26
26
private static final String PAC_HTTPS_FFEXT = "HTTPS"; // Mozilla Firefox extension. Not part of original Netscape spec.
27
- + private static class RPSingleton { private static final RequestProcessor instance = new RequestProcessor(NbPacScriptEvaluator.class.getName(), Runtime.getRuntime().availableProcessors(), true, false); }
28
- + private static RequestProcessor getRequestProcessor() { return RPSingleton.instance; }
27
+ + private static final RequestProcessor RP = new RequestProcessor(NbPacScriptEvaluator.class.getName(), Runtime.getRuntime().availableProcessors(), true, false);
29
28
private final String pacScriptSource;
30
29
31
30
32
- @@ -213,7 +219 ,7 @@ public NbPacScriptEvaluator(String pacSourceCocde) throws PacParsingException {
31
+ @@ -213,7 +218 ,7 @@ public NbPacScriptEvaluator(String pacSourceCocde) throws PacParsingException {
33
32
@Override
34
33
public List<Proxy> findProxyForURL(URI uri) throws PacValidationException {
35
34
@@ -38,7 +37,7 @@ index 76bb6080c73c..da54d0c76922 100644
38
37
39
38
// First try the cache
40
39
if (resultCache != null) {
41
- @@ -222,38 +228 ,37 @@ public List<Proxy> findProxyForURL(URI uri) throws PacValidationException {
40
+ @@ -222,38 +227 ,37 @@ public List<Proxy> findProxyForURL(URI uri) throws PacValidationException {
42
41
return jsResultAnalyzed;
43
42
}
44
43
}
@@ -73,7 +72,7 @@ index 76bb6080c73c..da54d0c76922 100644
73
72
+ jsResultAnalyzed = executeProxyScript(uri);
74
73
+ } else {
75
74
+ AtomicReference<List<Proxy>> resultHolder = new AtomicReference<>(null);
76
- + Task task = getRequestProcessor() .post(() -> {
75
+ + Task task = RP .post(() -> {
77
76
+ resultHolder.set(executeProxyScript(uri));
78
77
+ });
79
78
+
@@ -104,7 +103,7 @@ index 76bb6080c73c..da54d0c76922 100644
104
103
@Override
105
104
public boolean usesCaching() {
106
105
return (canUseURLCaching && (resultCache != null));
107
- @@ -275,6 +280 ,32 @@ public String getPacScriptSource() {
106
+ @@ -275,6 +279 ,32 @@ public String getPacScriptSource() {
108
107
return this.pacScriptSource;
109
108
}
110
109
@@ -210,7 +209,7 @@ index 178c9b162feb..90812bfa4612 100644
210
209
testPacFile2("pac-test4.js", factory);
211
210
}
212
211
diff --git a/platform/o.n.core/src/org/netbeans/core/ProxySettings.java b/platform/o.n.core/src/org/netbeans/core/ProxySettings.java
213
- index 2d29427cd3c2..593c99f5d6fe 100644
212
+ index 2d29427cd3c2..bb0bc42ae19f 100644
214
213
--- a/platform/o.n.core/src/org/netbeans/core/ProxySettings.java
215
214
+++ b/platform/o.n.core/src/org/netbeans/core/ProxySettings.java
216
215
@@ -49,6 +49,8 @@ public class ProxySettings {
@@ -227,7 +226,7 @@ index 2d29427cd3c2..593c99f5d6fe 100644
227
226
}
228
227
229
228
+ public static int getPacScriptTimeout() {
230
- + return NbPreferences.forModule(ProxySettings.class )
229
+ + return getPreferences ( )
231
230
+ .getInt(PAC_SCRIPT_TIMEOUT, DEFAULT_TIMEOUT);
232
231
+ }
233
232
0 commit comments