Skip to content

Commit

Permalink
Fix new Paths.get occurences
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadow-Devil committed Sep 20, 2024
1 parent 536ed3c commit ea91d29
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -42,8 +41,8 @@ public void setup() throws IOException {
this.watchTestResources = testResources.resolve("watchFlagResources");
URI testResourcesURI = Objects.requireNonNull(
getClass().getClassLoader().getResource("test-resources")).toURI();
Files.walkFileTree(Paths.get(testResourcesURI),
new BuildCommandTest.Copy(Paths.get(testResourcesURI), testResources));
Files.walkFileTree(Path.of(testResourcesURI),
new BuildCommandTest.Copy(Path.of(testResourcesURI), testResources));
watcher = new AtomicReference<>();
} catch (URISyntaxException e) {
Assert.fail("error loading resources");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/***
* A in-built code analyzer which adds a log statement to the beginning of the file.
*
* @since 2.7.1
*/
public class LogCodeAnalyzerInBuiltPlugin extends CompilerPlugin {
private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


/***
Expand All @@ -39,7 +38,7 @@
* @since 2.7.1
*/
public class LogCodeGeneratorInBuiltPlugin extends CompilerPlugin {
private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


/***
Expand All @@ -39,7 +38,7 @@
* @since 2.7.1
*/
public class LogCodeModifierInBuiltPlugin extends CompilerPlugin {
private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


/***
Expand All @@ -40,7 +39,7 @@
* @since 2.7.1
*/
public class LogCodeAnalyzerPkgPlugin extends CompilerPlugin {
private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


/***
Expand All @@ -40,7 +39,7 @@
*/
public class LogCodeGeneratorPkgPlugin extends CompilerPlugin {

private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


/***
Expand All @@ -41,7 +40,7 @@
*/
public class LogCodeModifierPkgPlugin extends CompilerPlugin {

private static final Path filePath = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
private static final Path filePath = Path.of("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -237,10 +236,10 @@ private StreamConnectionProvider createConnectionProvider(String balHome) {
if (Utils.getOSName().toLowerCase(Locale.ENGLISH).contains("windows")) {
processArgs.add("cmd.exe");
processArgs.add("/c");
processArgs.add(Paths.get(balHome, "bin", Constant.BALLERINA_SERVER_SCRIPT_NAME + ".bat").toString());
processArgs.add(Path.of(balHome, "bin", Constant.BALLERINA_SERVER_SCRIPT_NAME + ".bat").toString());
} else {
processArgs.add("bash");
processArgs.add(Paths.get(balHome, "bin", Constant.BALLERINA_SERVER_SCRIPT_NAME).toString());
processArgs.add(Path.of(balHome, "bin", Constant.BALLERINA_SERVER_SCRIPT_NAME).toString());
}

processArgs.add(DebugUtils.JBAL_DEBUG_CMD_NAME);
Expand Down

0 comments on commit ea91d29

Please sign in to comment.