Skip to content

Commit

Permalink
[java] Fix linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Feb 1, 2023
1 parent 7de6dec commit 2917d05
Showing 1 changed file with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ private Map<String, Object> mergeChromiumOptions(Map<String, Object> stereotypeO
Map<String, Object> capsOptions) {
Map<String, Object> toReturn = new HashMap<>(stereotypeOptions);

for (String name : capsOptions.keySet()) {
for (Map.Entry<String, Object> entry : capsOptions.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
if (name.equals("args")) {
List<String> arguments =
(List<String>) (capsOptions.getOrDefault(("args"), new ArrayList<>()));
List<String> arguments = (List<String>) value;

List<String> stereotypeArguments =
(List<String>) (stereotypeOptions.getOrDefault(("args"), new ArrayList<>()));
Expand All @@ -113,7 +114,7 @@ private Map<String, Object> mergeChromiumOptions(Map<String, Object> stereotypeO
}

if (name.equals("extensions")) {
List<String> extensionList = (List<String>) (capsOptions.get(("extensions")));
List<String> extensionList = (List<String>) value;

List<String> stereotypeExtensions =
(List<String>) (stereotypeOptions.getOrDefault(("extensions"), new ArrayList<>()));
Expand All @@ -128,7 +129,7 @@ private Map<String, Object> mergeChromiumOptions(Map<String, Object> stereotypeO
}

if (!name.equals("binary") && !name.equals("extensions") && !name.equals("args")) {
toReturn.put(name, capsOptions.get(name));
toReturn.put(name, value);
}
}

Expand All @@ -139,11 +140,11 @@ private Map<String, Object> mergeFirefoxOptions(Map<String, Object> stereotypeOp
Map<String, Object> capsOptions) {
Map<String, Object> toReturn = new HashMap<>(stereotypeOptions);

for (String name : capsOptions.keySet()) {
for (Map.Entry<String, Object> entry : capsOptions.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
if (name.equals("args")) {
List<String>
arguments =
(List<String>) (capsOptions.getOrDefault(("args"), new ArrayList<>()));
List<String> arguments = (List<String>) value;
List<String> stereotypeArguments =
(List<String>) (stereotypeOptions.getOrDefault(("args"), new ArrayList<>()));
arguments.forEach(arg -> {
Expand All @@ -155,8 +156,7 @@ private Map<String, Object> mergeFirefoxOptions(Map<String, Object> stereotypeOp
}

if (name.equals("prefs")) {
Map<String, Object> prefs =
(Map<String, Object>) (capsOptions.getOrDefault(("prefs"), new HashMap<>()));
Map<String, Object> prefs = (Map<String, Object>) value;

Map<String, Object> stereotypePrefs =
(Map<String, Object>) (stereotypeOptions.getOrDefault(("prefs"), new HashMap<>()));
Expand All @@ -166,15 +166,12 @@ private Map<String, Object> mergeFirefoxOptions(Map<String, Object> stereotypeOp
}

if (name.equals("profile")) {
String rawProfile =
(String) capsOptions.get("profile");

String rawProfile = (String) value;
toReturn.put("profile", rawProfile);
}

if (name.equals("log")) {
Map<String, Object> logLevelMap =
(Map<String, Object>) capsOptions.get("log");
Map<String, Object> logLevelMap = (Map<String, Object>) value;
toReturn.put("log", logLevelMap);
}
}
Expand Down

0 comments on commit 2917d05

Please sign in to comment.