DESCRIPTION

JCBC-935: Avoid key encoding for length check.

Motivation
----------
The AbstractDocument grabs the bytes() of the incoming document ID
and checks if more than 250 bytes are stored and if so will raise
an error. This is problematic for two reasons:

 - It is using getBytes() which does not use UTF-8 like the underlying
   logic in core-io, so it is not 100% accurate.
 - The same check is already performed in core-io.

Modifications
-------------
The code now just uses String#length() for a quick sanity check and
relies on core-io for exact boundary checks on edge cases. This reduces
garbage created and avoids the intensive work of encoding a document
ID just for the sake of checking how long it is.

Result
------
Less work and GC, but more or less the same effect. Exact checks
are performed in the KeyValueLocator in core-io anyways.

Change-Id: Ifdd94521a891d313d9982830c0e4e7c3325e2c1d
Reviewed-on: http://review.couchbase.org/61569
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Tate Garrett
date: 2016-03-16 13:34:55.514000000

Change has been successfully cherry-picked as 86f153ffcdc11d95e5d7c052e4cd2a53743e067d

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