diff --git a/src/test/java/com/github/checkstyle/regression/internal/FileUtils.java b/src/test/java/com/github/checkstyle/regression/internal/FileUtils.java index 7df5344..2044b9c 100644 --- a/src/test/java/com/github/checkstyle/regression/internal/FileUtils.java +++ b/src/test/java/com/github/checkstyle/regression/internal/FileUtils.java @@ -25,9 +25,9 @@ import java.nio.file.Files; public final class FileUtils { - protected static final String LF_REGEX = "\n"; + private static final String LF_REGEX = "\n"; - protected static final String CRLF_REGEX = "\\r\\n"; + private static final String CRLF_REGEX = "\\r\\n"; private FileUtils() { } diff --git a/src/test/java/com/github/checkstyle/regression/internal/GitUtils.java b/src/test/java/com/github/checkstyle/regression/internal/GitUtils.java index 4958e72..c6c8213 100644 --- a/src/test/java/com/github/checkstyle/regression/internal/GitUtils.java +++ b/src/test/java/com/github/checkstyle/regression/internal/GitUtils.java @@ -80,10 +80,8 @@ public static File addAnEmptyFileAndCommit(Repository repository, String fileNam throws IOException, GitAPIException { try (Git git = new Git(repository)) { final File file = new File(repository.getDirectory().getParent(), fileName); - if (!file.getParentFile().exists()) { - if (!file.getParentFile().mkdirs()) { - throw new IOException("Could not create directory " + file.getParentFile()); - } + if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) { + throw new IOException("Could not create directory " + file.getParentFile()); } if (!file.createNewFile()) { throw new IOException("Could not create file " + file);