Skip to content

Commit e0f97af

Browse files
committed
Use FileUtils.current()
- Using File("") can yield unexpected results - See https://bugs.openjdk.org/browse/JDK-8024695
1 parent a2c3617 commit e0f97af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/org/apache/commons/cli/TypeHandlerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
4141
import java.util.Map;
4242
import java.util.stream.Stream;
4343

44+
import org.apache.commons.io.FileUtils;
4445
import org.apache.commons.io.IOUtils;
4546
import org.junit.jupiter.api.Test;
4647
import org.junit.jupiter.params.ParameterizedTest;
@@ -184,7 +185,7 @@ void testCreateDate(final Date date) {
184185

185186
@Test
186187
void testCreateFile() {
187-
final File file = new File("").getAbsoluteFile();
188+
final File file = FileUtils.current().getAbsoluteFile();
188189
assertEquals(file, TypeHandler.createFile(file.toString()));
189190
}
190191

0 commit comments

Comments
 (0)