@@ -96,24 +96,17 @@ private void readDefaultPreferences(Reader defaultsReader) {
96
96
Map <String , Object > map = new Json ().toType (rawJson , MAP_TYPE );
97
97
98
98
Map <String , Object > frozen = (Map <String , Object >) map .get ("frozen" );
99
- for (Map .Entry <String , Object > entry : frozen .entrySet ()) {
100
- String key = entry .getKey ();
101
- Object value = entry .getValue ();
99
+ frozen .forEach ((key , value ) -> {
102
100
if (value instanceof Long ) {
103
101
value = ((Long ) value ).intValue ();
104
102
}
105
103
setPreference (key , value );
106
104
immutablePrefs .put (key , value );
107
- }
105
+ });
108
106
109
107
Map <String , Object > mutable = (Map <String , Object >) map .get ("mutable" );
110
- for (Map .Entry <String , Object > entry : mutable .entrySet ()) {
111
- Object value = entry .getValue ();
112
- if (value instanceof Long ) {
113
- value = ((Long ) value ).intValue ();
114
- }
115
- setPreference (entry .getKey (), value );
116
- }
108
+ mutable .forEach (this ::setPreference );
109
+
117
110
} catch (IOException e ) {
118
111
throw new WebDriverException (e );
119
112
}
@@ -163,10 +156,6 @@ public void addTo(Preferences prefs) {
163
156
prefs .allPrefs .putAll (allPrefs );
164
157
}
165
158
166
- public void addTo (FirefoxProfile profile ) {
167
- profile .getAdditionalPreferences ().allPrefs .putAll (allPrefs );
168
- }
169
-
170
159
public void writeTo (Writer writer ) throws IOException {
171
160
for (Map .Entry <String , Object > pref : allPrefs .entrySet ()) {
172
161
writer .append ("user_pref(\" " ).append (pref .getKey ()).append ("\" , " );
@@ -213,10 +202,6 @@ private boolean isStringified(String value) {
213
202
return value .startsWith ("\" " ) && value .endsWith ("\" " );
214
203
}
215
204
216
- public void putAll (Map <String , Object > frozenPreferences ) {
217
- allPrefs .putAll (frozenPreferences );
218
- }
219
-
220
205
void checkForChangesInFrozenPreferences () {
221
206
allPrefs .forEach ((this ::checkPreference ));
222
207
}
0 commit comments