Skip to content

Commit a34e788

Browse files
committed
Fix checkstyle
Signed-off-by: tvallin <[email protected]>
1 parent 7949379 commit a34e788

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

common/common/src/main/java/io/helidon/build/common/FileUtils.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.net.URI;
2727
import java.net.URISyntaxException;
2828
import java.net.URL;
29+
import java.nio.charset.StandardCharsets;
2930
import java.nio.file.FileSystem;
3031
import java.nio.file.FileSystemAlreadyExistsException;
3132
import 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
}

0 commit comments

Comments
 (0)