Skip to content

Commit 4b10ee6

Browse files
committed
FileUtils.lastModifiedFileTime(File) calls Objects.requireNonNull() on
the wrong object
1 parent 89559a5 commit 4b10ee6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The <action> type attribute can be add,update,fix,remove.
4949
<release version="2.16.2" date="YYYY-MM-DD" description="Java 8 is required.">
5050
<!-- FIX -->
5151
<action dev="ggregory" type="fix" due-to="Dependabot">Add missing unit tests.</action>
52+
<action dev="ggregory" type="fix" due-to="Dependabot">FileUtils.lastModifiedFileTime(File) calls Objects.requireNonNull() on the wrong object.</action>
5253
<!-- UPDATE -->
5354
<action dev="ggregory" type="update" due-to="Dependabot">Bump tests commons.bytebuddy.version from 1.14.13 to 1.14.14 #615.</action>
5455
<action dev="ggregory" type="update" due-to="Dependabot">Bump tests commons-codec:commons-codec from 1.16.1 to 1.17.0.</action>

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ public static FileTime lastModifiedFileTime(final File file) throws IOException
21382138
// https://bugs.openjdk.java.net/browse/JDK-8177809
21392139
// File.lastModified() is losing milliseconds (always ends in 000)
21402140
// This bug is in OpenJDK 8 and 9, and fixed in 10.
2141-
return Files.getLastModifiedTime(Objects.requireNonNull(file.toPath(), "file"));
2141+
return Files.getLastModifiedTime(Objects.requireNonNull(file, "file").toPath());
21422142
}
21432143

21442144
/**

0 commit comments

Comments
 (0)