Skip to content

Commit 390d9a9

Browse files
Use Paths.get rather than Path.of in Html5libTest
This change replaces Path.of() calls in Html5libTest with Paths.get(). Per https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/Path.html#of(java.net.URI) Path.of() was introduced in Java 11. So Java 8 has no Path.of(); see also https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html We need to continue to support Java 8 for the time being. It seems Paths.get() will eventually end up being formally deprecated; by the time it finally is, we may also be able to quit supporting Java 8 — and so we can just switch to Path.of() then.
1 parent 8a48cb0 commit 390d9a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test-src/nu/validator/htmlparser/test/Html5libTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.nio.file.FileVisitResult;
3030
import java.nio.file.Files;
3131
import java.nio.file.Path;
32+
import java.nio.file.Paths;
3233
import java.nio.file.SimpleFileVisitor;
3334
import java.nio.file.attribute.BasicFileAttributes;
3435
import java.util.function.Consumer;
@@ -38,7 +39,7 @@ public class Html5libTest {
3839
private final Path testDir;
3940

4041
public Html5libTest() throws URISyntaxException {
41-
this.testDir = Path.of(
42+
this.testDir = Paths.get(
4243
Html5libTest.class.getResource("/html5lib-tests").toURI());
4344
}
4445

@@ -111,7 +112,8 @@ private TestVisitor(boolean skipScripted, String requiredTestExtension,
111112
@Override
112113
public FileVisitResult preVisitDirectory(Path dir,
113114
BasicFileAttributes attrs) throws IOException {
114-
if (skipScripted && dir.getFileName().equals(Path.of("scripted"))) {
115+
if (skipScripted
116+
&& dir.getFileName().equals(Paths.get("scripted"))) {
115117
return FileVisitResult.SKIP_SUBTREE;
116118
}
117119

0 commit comments

Comments
 (0)