Skip to content

Commit

Permalink
14034: Eliminate assumption of mutable list argument in SeleniumManag…
Browse files Browse the repository at this point in the history
…er.getBinaryPaths() (SeleniumHQ#14036)

14034: Eliminate assumption of mutable list argument

Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
2 people authored and sandeepsuryaprasad committed Oct 29, 2024
1 parent 8f5a967 commit 95754f2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions java/src/org/openqa/selenium/manager/SeleniumManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
Expand Down Expand Up @@ -232,16 +233,18 @@ private synchronized Path getBinary() {
* @return the locations of the assets from Selenium Manager execution
*/
public Result getBinaryPaths(List<String> arguments) {
arguments.add("--language-binding");
arguments.add("java");
arguments.add("--output");
arguments.add("json");
List<String> args = new ArrayList<>(arguments.size() + 5);
args.addAll(arguments);
args.add("--language-binding");
args.add("java");
args.add("--output");
args.add("json");

if (getLogLevel().intValue() <= Level.FINE.intValue()) {
arguments.add("--debug");
args.add("--debug");
}

return runCommand(getBinary(), arguments);
return runCommand(getBinary(), args);
}

private Level getLogLevel() {
Expand Down

0 comments on commit 95754f2

Please sign in to comment.