Skip to content

Return value of File.delete() ignored in EarMojo #517

Description

@elharo

Description

In EarMojo.java:881, the return value of File.delete() is ignored:

resourceFile.delete();

If the file cannot be deleted (e.g., locked by another process, permission denied), the failure goes undetected. In incremental builds, stale resources can remain behind.

Expected behavior

Check the return value and log a warning:

if (!resourceFile.delete()) {
    getLog().warn("Failed to delete outdated resource: " + resourceFile);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions