diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java b/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java index 784e12616d049..b46f25e54389f 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java @@ -47,7 +47,8 @@ private String doGetEffectiveCommand() { List command = new ArrayList<>(1 + markerArgs.size()); command.add(defaultCommand); command.addAll(markerArgs); - new ProcessBuilder(command).redirectError(IdeUtil.NULL_FILE).redirectOutput(IdeUtil.NULL_FILE).start() + new ProcessBuilder(command).redirectError(ProcessBuilder.Redirect.DISCARD.file()) + .redirectOutput(ProcessBuilder.Redirect.DISCARD.file()).start() .waitFor(10, TimeUnit.SECONDS); return defaultCommand; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeUtil.java b/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeUtil.java index f15143c1ded9f..68080e7594379 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeUtil.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeUtil.java @@ -1,14 +1,9 @@ package io.quarkus.deployment.ide; -import java.io.File; import java.util.Locale; final class IdeUtil { - // copied from Java 9 - // TODO remove when we move to Java 11 - static final File NULL_FILE = new File(isWindows() ? "NUL" : "/dev/null"); - private IdeUtil() { } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java index f9475b4f36def..928ed20fe236a 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java @@ -7,7 +7,6 @@ import java.io.BufferedInputStream; import java.io.BufferedWriter; -import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -728,8 +727,8 @@ private boolean decompile(Path fernflowerJar, Path decompiledOutputDir, Path jar if (log.isDebugEnabled()) { processBuilder.inheritIO(); } else { - processBuilder.redirectError(NULL_FILE); - processBuilder.redirectOutput(NULL_FILE); + processBuilder.redirectError(ProcessBuilder.Redirect.DISCARD.file()) + .redirectOutput(ProcessBuilder.Redirect.DISCARD.file()); } exitCode = processBuilder.start().waitFor(); } catch (Exception e) { @@ -1313,9 +1312,4 @@ public boolean test(Path path, BasicFileAttributes basicFileAttributes) { return basicFileAttributes.isRegularFile() && path.toString().endsWith(".json"); } } - - // copied from Java 9 - // TODO remove when we move to Java 11 - - private static final File NULL_FILE = new File(SystemUtils.IS_OS_WINDOWS ? "NUL" : "/dev/null"); }