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
Reviewed-on: http://review.couchbase.org/42415
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Cory Peck xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

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

Change has been successfully cherry-picked as 3b03630abe3ca0c1f12c3cff1f67a1516f8ef1c9

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