Skip to content

Commit 673e677

Browse files
committed
Fix other issues
1 parent ba7060e commit 673e677

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main/client/src/mill/main/client/Util.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import java.nio.file.Path;
1414
import java.security.MessageDigest;
1515
import java.security.NoSuchAlgorithmException;
16+
import java.util.ArrayList;
1617
import java.util.HashMap;
17-
import java.util.LinkedList;
1818
import java.util.List;
1919
import java.util.Locale;
2020
import java.util.Map;
@@ -54,6 +54,7 @@ public static final int ExitServerCodeWhenVersionMismatch() {
5454
* This method takes into account these differences and is compatible with
5555
* both JDK versions before 22 and later.
5656
*/
57+
@SuppressWarnings("SystemConsoleNull")
5758
public static boolean hasConsole() {
5859
Console console = System.console();
5960

@@ -143,7 +144,7 @@ public static int readInt(InputStream in) throws IOException {
143144
}
144145

145146
/**
146-
* @return Hex encoded MD5 hash of input string.
147+
* Returns hex encoded MD5 hash of input string.
147148
*/
148149
public static String md5hex(String str) throws NoSuchAlgorithmException {
149150
return hexArray(MessageDigest.getInstance("md5").digest(str.getBytes(StandardCharsets.UTF_8)));
@@ -168,8 +169,8 @@ public static String sha1Hash(String path) throws NoSuchAlgorithmException {
168169
* @return The non-empty lines of the files or an empty list, if the file does not exist
169170
*/
170171
public static List<String> readOptsFileLines(final Path file) throws Exception {
171-
final List<String> vmOptions = new LinkedList<>();
172-
try (final Scanner sc = new Scanner(file.toFile())) {
172+
final List<String> vmOptions = new ArrayList<>();
173+
try (final Scanner sc = new Scanner(file.toFile(), StandardCharsets.UTF_8)) {
173174
final Map<String, String> env = System.getenv();
174175
while (sc.hasNextLine()) {
175176
String arg = sc.nextLine();

0 commit comments

Comments
 (0)