-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Remove the extra slash while loading resources. #893
Conversation
We can not be sure that someone editing config file will remember to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use proper path joining.
import java.nio.file.Paths;
You should also perform same changes in all other files where |
Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com>
Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com>
Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use path join to prevent double slash
all done, have fun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark fields as private to prevent use *FOLDER directly
Thanks. Looks good to me now. I'll most likely go around whole codebase in another PR later and see if we can refactor |
Waitting for your message :) |
* Remove the extra slash * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Import java.nio.file.Paths to use Paths.get * Mark fields as private to prevent use *FOLDER directly * Remove unnecessary slash Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com>
Description
The new default config file already contains / at the end of path string, which may cause double slash while loading resources, It seems to work fine at the moment, but it is recommended to remove it to prevent unpredictable situations.
Issues fixed by this PR
Type of changes
Checklist: