delta icon indicating copy to clipboard operation
delta copied to clipboard

[Kernel] Cleanup the `FileNames.java` utility methods

Open vkorukanti opened this issue 1 year ago • 1 comments

Some of the utility methods in FileNames.java take strings and some Paths. For string input, it is either the file name or the file path. It is confusing and can easily cause bugs. Unify all APIs to take Path (we anyway create Path in all places when the utility methods are used)

Also, avoid using finding the / to figure out the file name. This could be risky. Instead rely on the Path.

    final int slashIdx = path.lastIndexOf(Path.SEPARATOR); <-- avoid this.
    final String name = path.substring(slashIdx + 1);
    return Long.parseLong(name.split("\\.")[0]);

vkorukanti avatar Aug 20 '24 23:08 vkorukanti

can I pick it ?

tsafacjo avatar Aug 28 '24 16:08 tsafacjo

Hey @allisonport-db, can i pick up this issue ? Thank you

boufousabd avatar Jan 25 '25 19:01 boufousabd

hey sorry I think @scottsand-db already merged a PR for this https://github.com/delta-io/delta/pull/4086/. Going to close this.

allisonport-db avatar Jan 27 '25 18:01 allisonport-db