Skip to content

Commit

Permalink
fix: backport to java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
erdos committed Nov 3, 2023
1 parent ec6b968 commit 6bf2e2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions java-src/io/github/erdos/stencil/PrepareOptions.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.github.erdos.stencil;

import io.github.erdos.stencil.impl.FileHelper;

import java.io.File;

public final class PrepareOptions {
Expand Down
6 changes: 4 additions & 2 deletions java-src/io/github/erdos/stencil/impl/FileHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.Objects;
import java.util.UUID;
import java.util.regex.Pattern;

import static java.lang.System.getProperty;
import static java.util.Objects.requireNonNullElse;

/**
* File handling utilities.
Expand Down Expand Up @@ -141,4 +139,8 @@ public static String toUnixSeparatedString(Path path) {
}
}
}

private static <T> T requireNonNullElse(T first, T second) {
return first == null ? second : first;
}
}

0 comments on commit 6bf2e2c

Please sign in to comment.