File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
common/common/src/main/java/io/helidon/build/common Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2626import java .net .URI ;
2727import java .net .URISyntaxException ;
2828import java .net .URL ;
29+ import java .nio .charset .StandardCharsets ;
2930import java .nio .file .FileSystem ;
3031import java .nio .file .FileSystemAlreadyExistsException ;
3132import java .nio .file .FileSystems ;
@@ -1149,9 +1150,11 @@ public static URL urlOf(Path path) {
11491150 * @return {@code true} if the file is a submodule, {@code false} otherwise
11501151 */
11511152 public static boolean isSubModule (Path path ) {
1152- try {
1153- BufferedReader reader = new BufferedReader (new FileReader (path .toFile ()));
1154- return reader .readLine ().startsWith ("[submodule" );
1153+ try (BufferedReader reader = new BufferedReader (new FileReader (path .toFile (), StandardCharsets .UTF_8 ))) {
1154+ String line = reader .readLine ();
1155+ return line == null
1156+ ? false
1157+ : line .startsWith ("[submodule" );
11551158 } catch (IOException e ) {
11561159 throw new UncheckedIOException (e );
11571160 }
You can’t perform that action at this time.
0 commit comments