Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming a file can rename also another similar file #540

Open
optyfr opened this issue Mar 31, 2024 · 0 comments · May be fixed by #541
Open

Renaming a file can rename also another similar file #540

optyfr opened this issue Mar 31, 2024 · 0 comments · May be fixed by #541

Comments

@optyfr
Copy link

optyfr commented Mar 31, 2024

suppose I have 2 entries :

  • abcd.tmp
  • abcd.tmp0

If I rename abcd.tmp to bcde.tmp, then abcd.tmp0 is also renamed to bcde.tmp0 !!!

This is probably related to this line :

if (fileHeaderToBeChecked.getFileName().startsWith(fileHeaderToBeRenamed.getKey())) {

Every file headers that starts with the file to rename are matching, and so they get renamed by overwritting with the new name up to the len of the new name

Replacing startsWith method with equals should solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant