You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Mike Drob (Jira)" <ji...@apache.org> on 2021/11/09 20:34:00 UTC

[jira] [Commented] (LUCENE-10227) FilterPath.resolve(Path) doesn't work

    [ https://issues.apache.org/jira/browse/LUCENE-10227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17441351#comment-17441351 ] 

Mike Drob commented on LUCENE-10227:
------------------------------------

So all the wrapping is because the filter file system has a bunch of wrapping to generate the paths - {{ExtrasFS(HandleLimitFS(LeakFS(ShuffleFS(DisableFsyncFS(sun.nio.fs.MacOSXFileSystemProvider@62e280ab)))))}}

 That still leaves me unsure of what I should be changing to fix this bug. I'd like to use the {{resolve(Path)}} construct because in my code I'm actually calling it with a path with multiple elements, so that seems cleaner. Should I be figuring out how to call the String version instead?

> FilterPath.resolve(Path) doesn't work
> -------------------------------------
>
>                 Key: LUCENE-10227
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10227
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Priority: Major
>
> Short reproducing sample that captures the error I encounter when trying to write a unit test:
> {code:java}
> package org.apache.lucene.mockfile;
> import org.apache.lucene.util.LuceneTestCase;
> import org.junit.Test;
> import java.nio.file.Path;
> public class TestFilterPath extends LuceneTestCase {
>   @Test
>   public void testMultiwrap() throws Exception {
>     Path source = LuceneTestCase.createTempDir();
>     Path child = source.resolve("child");
>     assertEquals(source, child.getParent());
>     child = source.resolve(Path.of("child")); // This line throws exception
>     assertEquals(source, child.getParent());
>   }
> }
> {code}
> When running this test (on my Mac) I get the following:
> {noformat}
> mismatch, expected: FilterPath, got: class sun.nio.fs.UnixPath
> java.nio.file.ProviderMismatchException: mismatch, expected: FilterPath, got: class sun.nio.fs.UnixPath
> 	at __randomizedtesting.SeedInfo.seed([318296D60FE95435:125A6A9E9053DCC3]:0)
> 	at org.apache.lucene.mockfile.FilterPath.toDelegate(FilterPath.java:292)
> 	at org.apache.lucene.mockfile.FilterPath.resolve(FilterPath.java:151)
> 	at org.apache.lucene.mockfile.TestFilterPath.testMultiwrap(TestFilterPath.java:16)
> {noformat}
> Part of the problem here might be that {{createTempDir()}} gives me a {{FilterPath}} wrapped four layers deep.
> Part of the problem might be that resolve calls toDelegate which is too strict about what it would accept?
> I'm not sure what the intent of all of these wrappings is, so I'm not completely sure how to fix it.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org