Skip to content

Commit 6349e71

Browse files
committed
Use NIO directly for Converter.PATH
1 parent f2768de commit 6349e71

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/cli/Converter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2121
import java.net.URL;
2222
import java.nio.file.InvalidPathException;
2323
import java.nio.file.Path;
24+
import java.nio.file.Paths;
2425
import java.text.SimpleDateFormat;
2526
import java.util.Date;
2627

@@ -52,9 +53,9 @@ public interface Converter<T, E extends Throwable> {
5253
Converter<File, NullPointerException> FILE = File::new;
5354

5455
/**
55-
* Path converter. Calls {@code new File(s).toPath()}.
56+
* Path converter. Calls {@link Paths#get(java.net.URI)}.
5657
*/
57-
Converter<Path, InvalidPathException> PATH = s -> new File(s).toPath();
58+
Converter<Path, InvalidPathException> PATH = Paths::get;
5859

5960
/**
6061
* Number converter. Converts to a Double if a decimal point ('.') is in the

0 commit comments

Comments
 (0)