Skip to content

Commit 0989442

Browse files
committed
PathUtils.deleteOnExit(Path) calls Objects.requireNonNull() on the wrong
object
1 parent 4b10ee6 commit 0989442

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
@@ -50,6 +50,7 @@ The <action> type attribute can be add,update,fix,remove.
5050
<!-- FIX -->
5151
<action dev="ggregory" type="fix" due-to="Dependabot">Add missing unit tests.</action>
5252
<action dev="ggregory" type="fix" due-to="Dependabot">FileUtils.lastModifiedFileTime(File) calls Objects.requireNonNull() on the wrong object.</action>
53+
<action dev="ggregory" type="fix" due-to="Dependabot">PathUtils.deleteOnExit(Path) calls Objects.requireNonNull() on the wrong object.</action>
5354
<!-- UPDATE -->
5455
<action dev="ggregory" type="update" due-to="Dependabot">Bump tests commons.bytebuddy.version from 1.14.13 to 1.14.14 #615.</action>
5556
<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/file/PathUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public static PathCounters deleteFile(final Path file, final LinkOption[] linkOp
605605
* @since 3.13.0
606606
*/
607607
public static void deleteOnExit(final Path path) {
608-
Objects.requireNonNull(path.toFile()).deleteOnExit();
608+
Objects.requireNonNull(path).toFile().deleteOnExit();
609609
}
610610

611611
/**

0 commit comments

Comments
 (0)