Skip to content

Commit 73d600c

Browse files
committed
Files.writeString instead of Files.write
1 parent da569c6 commit 73d600c

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.io.File;
44
import java.io.IOException;
55
import java.lang.reflect.InvocationTargetException;
6-
import java.nio.charset.StandardCharsets;
76
import java.nio.file.Files;
87
import java.nio.file.Path;
98
import java.nio.file.StandardOpenOption;

core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.io.IOException;
99
import java.lang.reflect.InvocationTargetException;
1010
import java.lang.reflect.Method;
11-
import java.nio.charset.StandardCharsets;
1211
import java.nio.file.Files;
1312
import java.nio.file.StandardOpenOption;
1413
import java.util.ArrayList;
@@ -486,8 +485,7 @@ private static Map<String, byte[]> extractGeneratedResources(BuildResult buildRe
486485
}
487486
File sourceFile = new File(debugPath, i.internalName() + ".zig");
488487
sourceFile.getParentFile().mkdirs();
489-
Files.write(sourceFile.toPath(), i.getSource().getBytes(StandardCharsets.UTF_8),
490-
StandardOpenOption.CREATE);
488+
Files.writeString(sourceFile.toPath(), i.getSource(), StandardOpenOption.CREATE);
491489
log.infof("Wrote source %s", sourceFile.getAbsolutePath());
492490
} else {
493491
log.infof("Source not available: %s", i.binaryName());

core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/BannerProcessorTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import static org.junit.jupiter.api.Assertions.assertFalse;
55
import static org.junit.jupiter.api.Assertions.assertTrue;
66

7-
import java.nio.charset.StandardCharsets;
87
import java.nio.file.FileSystem;
98
import java.nio.file.Files;
109
import java.nio.file.Path;
@@ -43,7 +42,7 @@ public void checkQuarkusCoreBannerOnFilesystemWithSpecialCharacters(@TempDir Pat
4342
try (final FileSystem fs = ZipUtils.newFileSystem(zipPath)) {
4443
Path classFile = fs.getPath(fromClassNameToResourceName(MyBannerProcessor.class.getName()));
4544
Files.createDirectories(classFile.getParent());
46-
Files.write(classFile, "".getBytes(StandardCharsets.UTF_8));
45+
Files.writeString(classFile, "");
4746
}
4847

4948
try (FileSystem fs = ZipUtils.newFileSystem(zipPath)) {

0 commit comments

Comments
 (0)