All notable changes to the project will be documented in this file. This project adheres to Semantic Versioning.
- Fixes NPE when interacting with Context created by use of
copyFrom
. (Thanks, pedroafonsodias)
- Deprecated LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts.
- Updating Gradle to 7.6
- Fixed NPE when creating a multi-context that included one invalid context.
This major version release of java-sdk-common
corresponds to the upcoming v6.0.0 release of the LaunchDarkly Java SDK (java-server-sdk
) and the v4.0.0 release of the LaunchDarkly Android SDK (android-client-sdk
), and cannot be used with earlier SDK versions.
- The types
LDContext
andContextKind
define the new "context" model. "Contexts" are a replacement for the earlier concept of "users"; they can be populated with attributes in more or less the same way as before, but they also support new behaviors. More information about these features will be included in the release notes for the v6.0.0 Java SDK and v4.0.0 Android SDK releases. - The type
AttributeRef
defines the attribute reference syntax, for referencing subproperties of JSON objects in flag evaluations or private attribute configuration. Applications normally will not need to reference this type.
- It was previously allowable to set a user key to an empty string. In the new context model, the key is not allowed to be empty. Trying to use an empty key will cause evaluations to fail and return the default value.
- There is no longer such a thing as a
secondary
meta-attribute that affects percentage rollouts. If you set an attribute with that name in anLDContext
, it will simply be a custom attribute like any other. - The
anonymous
attribute inLDUser
is now a simple boolean, with no distinction between a false state and a null state.
- Removed all types, fields, and methods that were deprecated as of the most recent release.
- Removed the
secondary
meta-attribute inLDUser
andLDUser.Builder
.
- In
EvaluationReason
, added optional status information related to the new Big Segments feature.
- The
com.launchdarkly.sdk.json
serialization methods were dropping any object property whose value wasnull
(due to the internal use of Gson, and Gson's default behavior of always omitting null properties). This has been changed to always respect whatever properties are written by the serializer for a given type, since in some cases (such as a map of feature flag keys to values) the presence of a key with a null value might have a subtly different meaning than the absence of the key.
- Updated Gson to 2.8.9 for a security bugfix. This dependency change will also be made in the Java SDK; the version of Gson that is referenced in
java-sdk-common
is used only at compile time.
- The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
- Increased the compile-time dependency on
jackson-databind
to 2.10.5.1, due to CVE-2020-25649. - Stopped including Gson and Jackson in the published runtime dependency list in Gradle module metadata. These artifacts were already being excluded from
pom.xml
, but were still showing up as transitive dependencies in any tools that used the module metadata. For the rationale behind excluding these dependencies, seebuild-shared.gradle
.
- Fixed an issue in the Jackson integration that could cause
.0
to be added unnecessarily to integer numeric values when serializing objects with Jackson.
This release makes improvements to the helper methods for using Gson and Jackson for JSON conversion.
LDGson.valueToJsonElement
andLDGson.valueMapToJsonElementMap
: convenience methods for applications that use Gson types.LDValue.arrayOf()
- In
com.launchdarkly.sdk.json
, the implementations ofLDGson.typeAdapters
andLDJackson.module
have been changed for better efficiency in deserialization. Instead of creating an intermediate string representation and re-parsing that, they now have a more direct way for the internal deserialization logic to interact with the streaming parser in the application's Gson or Jackson instance.
Gson.toJsonTree
now works with LaunchDarkly types, as long as you have configured it as described incom.launchdarkly.sdk.json.LDGson
. Previously, Gson was able to convert these types to and from JSON string data, buttoJsonTree
did not work due to a known issue with theJsonWriter.jsonValue
method; the SDK code no longer uses that method.LDValue.parse()
now returnsLDValue.ofNull()
instead of an actual null reference if the JSON string isnull
.- Similarly, when deserializing an
EvaluationDetail<LDValue>
from JSON, if thevalue
property isnull
, it will now translate this intoLDValue.ofNull()
rather than an actual null reference.
Initial release, corresponding to version 5.0.0 of the server-side Java SDK.