Skip to content

PathMatchingResourcePatternResolver should enforce OS-independent sorting of directory content [SPR-16838] #21378

@spring-projects-issues

Description

@spring-projects-issues

Benoit opened SPR-16838 and commented

A sort was added in #18657 but the default File#compareTo depends upon the underlying system.

The ordering of the ressources returned by PathMatchingResourcePatternResolver#retrieveMatchingFiles may differ between OS (Windows, Unix).

This leads to subtle bugs hard to track.

 This PR replace the default sort with one based on the file name.


Affects: 5.0.6

Issue Links:

Referenced from: pull request #1832, and commits bb6ab5d

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions