DESCRIPTION

JVMCBC-321: do not try to conver null keys for STAT

Motivation
----------
At some conditions STAT response carries null key. The library should not
try to convert it to String.

Modification
------------
Check stat key for null before conversion.

Result
------
NPE fixed

Change-Id: I09c4822a514daf7165d60cbeeb57be1212456c62

COMMENTS

author: Cory Peck
date: 2016-04-01 07:16:27.550000000

Patch Set 2: Commit message was updated

-------------------------------------
author: Estrella Humphrey
date: 2016-04-01 07:22:06.886000000

Patch Set 2: Code-Review+1

some form of test would be good (see if other parts of the handler have tests that you could take inspiration from)

-------------------------------------
author: Cory Peck
date: 2016-04-01 07:27:48.739000000

Patch Set 2:

I discovered it while doing POC for other ticket

Under regular conditions STAT works as expected, I will write tests later with lower priority

-------------------------------------
author: Cory Peck
date: 2016-10-19 10:35:51.980000000

Patch Set 2: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-10-22 08:57:38.004000000

Patch Set 2: Code-Review+2

-------------------------------------
author: Natasha Sullivan
date: 2016-10-22 08:59:43.627000000

Patch Set 2: Code-Review-1

(1 comment)

found something, let me know if it makes sense

Line:948, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> shouldn't this also be msg.getKey().toString(CHARSET) since its a bytebuf?
and maybe you could do String key = msg.getKey() == null ? null : msg.getKey().toString(CHARSET).

do you also need to release the keys like the content?

-------------------------------------
author: Cory Peck
date: 2016-12-27 07:51:34.110000000

Patch Set 2:

(1 comment)

Line:948, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> actually msg.getKey() returns byte[], so it is correct, and doesn't need release

-------------------------------------
author: Natasha Sullivan
date: 2016-12-27 08:04:33.596000000

Patch Set 2: Code-Review+2

-------------------------------------
author: Gerrit Code Review
date: 2016-12-27 08:46:36.261000000

Change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

-------------------------------------
author: Cory Peck
date: 2016-12-27 08:46:42.764000000

Patch Set 3: Patch Set 2 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2016-12-27 08:46:51.005000000

Change has been successfully cherry-picked as dcc3db7f0212bc12ca46d924de9faa88959b0e9d by Cory Peck

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