From 2cba710ab06c88af8d4a64db6c44e339e42135ba Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Thu, 2 May 2019 10:18:20 +0300 Subject: [PATCH] [java] Refactoring, no functional changes --- .../client/test/org/openqa/selenium/build/BuckBuild.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/java/client/test/org/openqa/selenium/build/BuckBuild.java b/java/client/test/org/openqa/selenium/build/BuckBuild.java index 374fd11ad8086..7851668b3d806 100644 --- a/java/client/test/org/openqa/selenium/build/BuckBuild.java +++ b/java/client/test/org/openqa/selenium/build/BuckBuild.java @@ -29,7 +29,6 @@ import org.openqa.selenium.WebDriverException; import org.openqa.selenium.os.CommandLine; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; @@ -45,7 +44,7 @@ public BuckBuild of(String target) { return this; } - public Path go(boolean inDevMode) throws IOException { + public Path go(boolean inDevMode) { Path projectRoot = InProject.locate("Rakefile").getParent(); if (!inDevMode) { @@ -78,13 +77,13 @@ public Path go(boolean inDevMode) throws IOException { return findOutput(projectRoot); } - private Path findOutput(Path projectRoot) throws IOException { + private Path findOutput(Path projectRoot) { ImmutableList.Builder builder = ImmutableList.builder(); findBuck(projectRoot, builder); builder.add("targets", "--show-full-output", "--config", "color.ui=never", target); ImmutableList command = builder.build(); - CommandLine commandLine = new CommandLine(command.toArray(new String[command.size()])); + CommandLine commandLine = new CommandLine(command.toArray(new String[0])); commandLine.setWorkingDirectory(projectRoot.toAbsolutePath().toString()); commandLine.copyOutputTo(System.err); commandLine.execute(); @@ -120,7 +119,7 @@ private Path findOutput(Path projectRoot) throws IOException { return output; } - private void findBuck(Path projectRoot, ImmutableList.Builder builder) throws IOException { + private void findBuck(Path projectRoot, ImmutableList.Builder builder) { Path buckw = projectRoot.resolve(Platform.getCurrent().is(WINDOWS) ? "buckw.bat" : "buckw"); assertTrue("Unable to find buckw: " + buckw, Files.exists(buckw));