Skip to content

removeFromOutdatedResources() fallback path never matches due to path mismatch #518

Description

@elharo

Description

In EarMojo.java:886-897, the removeFromOutdatedResources() method has a fallback path that will never match:

try {
    relativeDestFile = getWorkDirectory().toPath().relativize(destination.normalize());
} catch (ProviderMismatchException e) {
    relativeDestFile = destination.normalize();  // absolute path
}
if (outdatedResources.remove(relativeDestFile.toString())) { ... }

When a ProviderMismatchException occurs (e.g., zip filesystem path vs local filesystem path), the fallback stores an absolute path. However, outdatedResources contains only relative paths (from initOutdatedResources() at line 857). The remove() will never match, so cleanup silently fails for those paths.

Expected behavior

Attempt to relativize differently, or at minimum log that cleanup could not be performed for that path.

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