Skip to content

Commit

Permalink
Issue checkstyle#41: fixed pmd violations
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach committed Nov 15, 2017
1 parent 8fae99e commit c3391bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3391bd

Please sign in to comment.