lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shad Storhaug (JIRA)" <>
Subject [jira] [Commented] (LUCENENET-592) Lucene.Net.QueryParsers.Flexible.Core.Util.UnescapedCharSequence
Date Thu, 10 Aug 2017 19:55:00 GMT


Shad Storhaug commented on LUCENENET-592:

Thanks for the report.

These "bugs" were copied over from Lucene (
Since the constructor was made private, it apparently isn't for outside use (however, I can't
really explain what it would be for if it is decorated with the {{@SuppressWarnings("unused")}}

If you need to pass an {{UnescapedCharSequence}} to create a new one, you can use the {{public
UnescapedCharSequence(ICharSequence text)}} overload because {{UnescapedCharSequence}} implements

That said, we are missing an overload here for passing in a {{StringBuilder}} - in Java both
{{String}} and {{StringBuilder}} implement {{ICharSequence}}, so in .NET we need an overload
for all three (including {{ICharSequence}}) to mimic that behavior since there is no shared
interface between these types in .NET.

> Lucene.Net.QueryParsers.Flexible.Core.Util.UnescapedCharSequence
> ----------------------------------------------------------------
>                 Key: LUCENENET-592
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net.QueryParser
>    Affects Versions: Lucene.Net 4.8.0
>         Environment: .NET 4.5.1/4.6.2
>            Reporter: Greg Mulvihill
> I noticed a few things that seem to be bugs in UnescapedCharSequence.cs.  
> Line 77: I found no reference to the private constructor UnescapedCharSequence(UnescapedCharSequence
text), but needed to use it.
> Line 81: The for loop throws an exception as the condition statement goes beyond the
length of text due to '<=', rather than '<'.
> Line 128: The for loop immediately terminates as i will always fail the condition statement.

This message was sent by Atlassian JIRA

View raw message