DESCRIPTION

JCBC-589: userAgent in core overwritten on purpose

Motivation
----------
After modifying the feature to get version number from the sdk, another
problem was found: when attempting to get version from both the core
sdk and the java-client sdk, using the userAgent() method both return
an user agent string with the java-client's information.

This is in fact by design, so that the core sends userAgent information
relative to the client to the outside world. On the contrary, the class
property PACKAGE_NAME_AND_VERSION contains version information
specific to the real package (core or java client) of the Environment on
which it is stored.

Variable shadowing makes this distinction hard to see, and makes the
USER_AGENT overwriting look like a bug.

Modifications
-------------
Instead of shadowing PACKAGE_NAME_AND_VERSION, introduced new property
SDK_PACKAGE_NAME_AND_VERSION in DefaultCouchbaseEnvironment.

Commented on the write of USER_AGENT property to indicate this is by design.

Result
------
Java client version information replaces the Core's USER_AGENT. Core will send
such information to the outside world, identifying itself as a java sdk.
From java sdk, calling userAgent() on any CoreEnvironment default
implementation will thus provide information about the java sdk version.

PACKAGE_NAME_AND_VERSION will contain info about the core.
SDK_PACKAGE_NAME_AND_VERSION will contain info about the java sdk.

Calling packageNameAndVersion() on a DefaultCoreEnvironment instance
provides version information on the core.

Calling packageNameAndVersion() on a DefaultCouchbaseEnvironment
instance provides version information on the java sdk.

Change-Id: I3c8b01ca556fa941fd8a118ee88bdb8882473d88


COMMENTS

author: Estrella Humphrey
date: 2014-10-24 09:11:28.517000000

Uploaded patch set 3.

-------------------------------------
author: Estrella Humphrey
date: 2014-10-24 09:12:58.089000000

Patch Set 3: Verified+1

as seen with Michael, USER_AGENT is overwritten by design. got rid of variable shadowing on PACKAGE_NAME_AND_VERSION for clarity and commented the overwrite to indicate this is done on purpose.

-------------------------------------
author: Cory Peck
date: 2014-10-24 09:14:02.511000000

Patch Set 3: Code-Review+2

-------------------------------------
author: Natasha Sullivan
date: 2014-10-27 15:02:40.879000000

Patch Set 3: Code-Review+2

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