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

Shai Erera commented on LUCENE-4724:
------------------------------------

Good catch. But I'm not sure about the fix. I.e. new CP("test","") could also 
be handled to be equivalent to new CP("test").
Also, it's not clear if new CP("test///foo",'/') should generate a CP that's 
similar to test/foo.
But for sure, new CP("test/", '/') should be equivalent to new CP("test"), 
right?

I think that for simplicity, we should eliminate all empty strings, from both 
ctors. So:
* new CP("test") == new CP("test", '/') --> "test"
* new CP("test", "") == new CP("test/", '/') --> "test"
* new CP("test", "", "foo") == new CP("test//foo", '/') --> "test/foo"

This is very similar to FS hierarchies I think. And it's easy to document and 
handle.

Also, does the test really test the bug? I.e. the only fix is in the CP ctor 
which takes a String and delimiter, yet the test seems to be using the vararg 
String... ctor?
                
> TaxonomyReader drops empty string component from CategoryPath
> -------------------------------------------------------------
>
>                 Key: LUCENE-4724
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4724
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>            Reporter: Michael McCandless
>             Fix For: 4.2, 5.0
>
>         Attachments: LUCENE-4724.patch, LUCENE-4724.patch
>
>
> I ran the new PrintTaxonomyStats on a Wikipedia facets index, and it hit an 
> AIOOBE because there was a child of the /categories path that had only one 
> component ... this was created because I had added new 
> CategoryPath("categories", "") during indexing.
> I think TaxoReader should preserve and return that empty string from .getPath?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to