Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
.classpath
bin/

# IntelliJ IDEA
.idea/
*.iml

# Maven
target/
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PacProxySelector extends ProxySelector {
private static final String PAC_SOCKS = "SOCKS";
private static final String PAC_DIRECT = "DIRECT";

private PacScriptParser pacScriptParser;
private final PacScriptParser pacScriptParser;

private static volatile boolean enabled = true;

Expand All @@ -38,7 +38,7 @@ public class PacProxySelector extends ProxySelector {

public PacProxySelector(PacScriptSource pacSource) {
super();
selectEngine(pacSource);
pacScriptParser = selectEngine(pacSource);
}

/*************************************************************************
Expand Down Expand Up @@ -70,12 +70,13 @@ public static boolean isEnabled() {
* to use as input.
************************************************************************/

private void selectEngine(PacScriptSource pacSource) {
protected PacScriptParser selectEngine(PacScriptSource pacSource) {
try {
Logger.log(getClass(), LogLevel.INFO, "Using javax.script JavaScript engine.");
pacScriptParser = new JavaxPacScriptParser(pacSource);
return new JavaxPacScriptParser(pacSource);
} catch (Exception e) {
Logger.log(getClass(), LogLevel.ERROR, "PAC parser error.", e);
return null;
}
}

Expand Down