[
https://issues.apache.org/jira/browse/LUCENE-10526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17525275#comment-17525275
]
ASF subversion and git services commented on LUCENE-10526:
----------------------------------------------------------
Commit 844bd8883980302ba2259f2c0a428228d3e86bad in lucene's branch
refs/heads/main from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=844bd888398 ]
LUCENE-10526: add single method to mockfile to wrap a Path (#822)
Currently "new FilterPath" is called from everywhere, making it impossible for
a mockfilesystem to use a custom subclass.
Add FilterFileSystemProvider.wrapPath(path), which subclasses can override. Fix
tests to use it instead of juggling URI objects and passing FileSystems around.
> add single method to mockfile to wrap a Path
> --------------------------------------------
>
> Key: LUCENE-10526
> URL: https://issues.apache.org/jira/browse/LUCENE-10526
> Project: Lucene - Core
> Issue Type: Sub-task
> Reporter: Robert Muir
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Currently, mockfilesystems wrap a path with "new FilterPath". but this
> "wrapping" logic is scattered everywhere in the code (and tests!). And it is
> hardcoded at filterpath (subclassing is not possible).
> This makes it impossible for a mock filesystem to extend FilterPath with some
> custom logic (example: check for special windows reserved characters).
> I don't think code/tests should be calling "new FilterPath" everywhere, this
> is also just messy. Instead they should ask the mockfilesystem's provider to
> wrap the path: {{provider.wrapPath(path, filesystem)}}.
> This way, WindowsFS can then override wrapPath() with a subclass that looks
> for special characters.
> This issue is just for the API refactoring/cleanup. Additional
> Windows-simulation can happen on the parent issue.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]