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

Refactor: Replace hardcoded path separator with PATH_SEPARATOR constant #33646

Closed
wants to merge 1 commit into from

Conversation

SungbinYang
Copy link
Contributor

Summary

This PR refactors the addResourcePathToPackagePath method by replacing the hardcoded path separator "/" with the PATH_SEPARATOR constant. The change enhances code maintainability and readability by avoiding magic literals.

Key Changes

  • Introduced PATH_SEPARATOR constant in place of the hardcoded '/'.
  • Updated the logic to handle the path separator dynamically using the constant.

Why this change is necessary

Using constants improves the consistency of the codebase and makes future modifications easier. If the path separator ever needs to change (e.g., for cross-platform support), we can modify the constant in one place without affecting multiple lines of code.

Impact

  • Improves code readability and maintainability.
  • Prepares the code for potential cross-platform adjustments in the future.

Please review and provide feedback!

Replaced the hardcoded '/' path separator with the `PATH_SEPARATOR` constant to improve code readability and maintainability. This change ensures consistency across the codebase when handling path separators.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 4, 2024
@bclozel bclozel added type: task A general task in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 4, 2024
@bclozel bclozel self-assigned this Oct 4, 2024
@bclozel bclozel added this to the 6.2.0-RC2 milestone Oct 4, 2024
@bclozel bclozel closed this in 65ac17e Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants