DESCRIPTION

JCBC-505: Fix concurrency issue in Query builder.

Motivation
----------
Similar to one fix earlier in SPY (SPY-170), only the regex matcher is thread safe
(resetting it is not), leading to NPEs further down the stack.

Modifications
-------------
Always use a new builder and do not reset the same one.

Result
------
Thread safety for the Query class and no exceptions like:

java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.reset(Matcher.java:329)
at com.couchbase.client.protocol.views.Query.quote(Query.java:572)
at com.couchbase.client.protocol.views.Query.setRangeStart(Query.java:400)
at com.couchbase.client.protocol.views.Paginator.fetchNextPage(Paginator.java:180)
at com.couchbase.client.protocol.views.Paginator.hasNext(Paginator.java:160)

Change-Id: Icc578a03bdece1ebc9b344ee8fdbe36a2542b6cf


COMMENTS

author: Natasha Sullivan
date: 2014-08-04 05:26:35.976000000

Patch Set 2: Commit message was updated

-------------------------------------
author: Jasmin Rangel
date: 2014-08-04 05:26:36.419000000

Patch Set 2:

New patchset patch-id matches previous patchset, but commit message has changed.

-------------------------------------
author: Natasha Sullivan
date: 2014-08-04 05:26:42.879000000

Patch Set 2: Verified+1

-------------------------------------
author: Andreas Short
date: 2014-08-04 17:11:46.013000000

Patch Set 2: Code-Review+2

-------------------------------------
