lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Character Escape in QueryParsing.StrParser.getQuotedString()
Date Tue, 01 Dec 2009 20:20:39 GMT
Thanks for the report - that definitely looks wrong.  I've opened
https://issues.apache.org/jira/browse/SOLR-1615

-Yonik
http://www.lucidimagination.com



On Mon, Nov 30, 2009 at 7:04 PM, wojtekpia <wojtek_p@hotmail.com> wrote:
>
> I'm confused by the following code snippet in
> QueryParsing.StrParser.getQuotedString().
>
> 626         char ch = val.charAt(pos);
> 627         if (ch=='\\') {
> 628           ch = pos<end ? val.charAt(pos++) : 0;
> 629         } else if (ch==delim) {
> 630           pos++;
> 631           return sb.toString();
> 632         }
>
> It seems like if line 627 is true, then line 628 will always assign ch='\\'.
> Should line 628 have a pre-increment instead of post-increment on the 'pos'
> variable? i.e.
>
> 626         char ch = val.charAt(pos);
> 627         if (ch=='\\') {
> 628           ch = pos<end ? val.charAt(++pos) : 0;
> 629         } else if (ch==delim) {
> 630           pos++;
> 631           return sb.toString();
> 632         }
> --
> View this message in context: http://old.nabble.com/Character-Escape-in-QueryParsing.StrParser.getQuotedString%28%29-tp26584376p26584376.html
> Sent from the Solr - Dev mailing list archive at Nabble.com.
>
>

Mime
View raw message