31
31
import java .io .IOException ;
32
32
import java .time .Duration ;
33
33
import java .util .ArrayList ;
34
+ import java .util .HashMap ;
34
35
import java .util .List ;
35
36
import java .util .Map ;
36
37
import java .util .Optional ;
37
38
38
39
import static java .util .Collections .unmodifiableList ;
40
+ import static java .util .Collections .unmodifiableMap ;
39
41
import static java .util .concurrent .TimeUnit .MILLISECONDS ;
40
42
import static org .openqa .selenium .remote .Browser .FIREFOX ;
41
43
@@ -62,7 +64,9 @@ public GeckoDriverService(
62
64
int port ,
63
65
List <String > args ,
64
66
Map <String , String > environment ) throws IOException {
65
- super (executable , port , DEFAULT_TIMEOUT , args , environment );
67
+ super (executable , port , DEFAULT_TIMEOUT ,
68
+ unmodifiableList (new ArrayList <>(args )),
69
+ unmodifiableMap (new HashMap <>(environment )));
66
70
}
67
71
68
72
/**
@@ -79,7 +83,9 @@ public GeckoDriverService(
79
83
Duration timeout ,
80
84
List <String > args ,
81
85
Map <String , String > environment ) throws IOException {
82
- super (executable , port , timeout , args , environment );
86
+ super (executable , port , timeout ,
87
+ unmodifiableList (new ArrayList <>(args )),
88
+ unmodifiableMap (new HashMap <>(environment )));
83
89
}
84
90
85
91
/**
@@ -94,6 +100,11 @@ public static GeckoDriverService createDefaultService() {
94
100
return new Builder ().build ();
95
101
}
96
102
103
+ /**
104
+ *
105
+ * @param caps Capabilities instance
106
+ * @return default GeckoDriverService
107
+ */
97
108
static GeckoDriverService createDefaultService (Capabilities caps ) {
98
109
return createDefaultService ();
99
110
}
0 commit comments