You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Mickael Maison (Jira)" <ji...@apache.org> on 2022/06/10 11:30:00 UTC

[jira] [Resolved] (KAFKA-13929) Replace File.createNewFile() with Files.createFile()

     [ https://issues.apache.org/jira/browse/KAFKA-13929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mickael Maison resolved KAFKA-13929.
------------------------------------
    Fix Version/s: 3.3.0
       Resolution: Fixed

> Replace File.createNewFile() with Files.createFile()
> ----------------------------------------------------
>
>                 Key: KAFKA-13929
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13929
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Divij Vaidya
>            Assignee: Divij Vaidya
>            Priority: Minor
>             Fix For: 3.3.0
>
>
> File.createNewFile() returns a boolean signifying whether the file creation was successful or not.
> There are multiple places in the Kafka code base where we are not checking the value of the returned boolean. 
> Replacing it with the Files.createFile() API will decrease the chances of inadvertent bugs in the code base since Files.createFile() API thrown exceptions when the creation is not successful.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)