DESCRIPTION

JCBC-589: Setting UserAgent overwrites one in core

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.

What was expected was to get the core sdk information on calling a
DefaultCoreEnvironment's userAgent() method and to get the client sdk
information when calling a DefaultCouchbaseEnvironment's userAgent()
method.

Root Cause:
The USER_AGENT class property in DefaultCoreEnvironment is not shadowed
by DefaultCouchbaseEnvironment, contrary to PACKAGE_NAME_AND_VERSION.
Thus when loading version information, the DefaultCouchbaseEnvironment
overwrites USER_AGENT in core package.

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

Introduced a new SDK_USER_AGENT property in DefaultCouchbaseEnvironment
which is the one set by version initialization.

Calling either userAgent() or packageNameAndVersion() to get version
info on the appropriate classes in the core and the java sdk in both
case provides correct information.

DefaultCoreEnvironment provides version information on the core.
DefaultCouchbaseEnvironment provides version info on the java client.

Change-Id: I3c8b01ca556fa941fd8a118ee88bdb8882473d88


COMMENTS

author: Estrella Humphrey
date: 2014-10-24 08:30:36.850000000

Uploaded patch set 1.

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