delta
delta copied to clipboard
[Kernel] Cleanup the `FileNames.java` utility methods
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]);
can I pick it ?
Hey @allisonport-db, can i pick up this issue ? Thank you
hey sorry I think @scottsand-db already merged a PR for this https://github.com/delta-io/delta/pull/4086/. Going to close this.