Skip to content

feat: Deprecate the provider getState method - #55

Merged
kinyoklion merged 1 commit into
mainfrom
devin/java-deprecated-get-state
Aug 25, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
devin/java-deprecated-get-state

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

FeatureProvider#getState() is deprecated in the OpenFeature Java SDK, but this provider overrode it without marking it deprecated, so consumers got no signal to migrate.

  • Marks the getState() override @Deprecated and documents Client#getProviderState() as the replacement
  • Behavior is unchanged; the override is kept so existing callers keep getting real state rather than the SDK's READY default
  • Removes the deprecation warning emitted when compiling this provider

@cursor review

Implementation details

Context

The OpenFeature SDK now tracks provider state itself, from initialize and from the events this provider emits (ready/stale/error/configuration changed), which is why FeatureProvider#getState() carries @Deprecated with "The state is handled by the SDK internally. Query the state from the Client instead."

Alternatives considered

Deleting the override entirely: rejected for now because FeatureProvider supplies a default that always returns READY, so any consumer still calling provider.getState() would silently get a wrong answer. Deprecating first gives a migration path; the override can be dropped in a future major.

Testing

./gradlew test javadoc — all 44 tests pass and javadoc builds with no new warnings.

No visual preview applies — this is a server-side provider change.

Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion


Note

Overview
Aligns this LaunchDarkly OpenFeature server provider with the OpenFeature Java SDK by marking the getState() override @Deprecated and documenting Client#getProviderState() as the replacement.

The override remains so callers still receive accurate provider state instead of the SDK default READY; behavior is unchanged aside from deprecation signaling and cleaner compilation (no missing-deprecation warning on this override).

Reviewed by Cursor Bugbot for commit 302cd66. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion kinyoklion self-assigned this Aug 19, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring
@kinyoklion
kinyoklion marked this pull request as ready for review August 19, 2026 20:41
@kinyoklion
kinyoklion requested a review from a team as a code owner August 19, 2026 20:41
@kinyoklion
kinyoklion merged commit 1f71ef3 into main Aug 25, 2026
9 checks passed
@kinyoklion
kinyoklion deleted the devin/java-deprecated-get-state branch August 25, 2026 16:24
kinyoklion pushed a commit that referenced this pull request Aug 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.2.0](1.1.3...1.2.0)
(2026-08-25)


### Features

* Deprecate the provider getState method
([#55](#55))
([1f71ef3](1f71ef3))
* Populate OpenFeature flag metadata from the evaluation reason
([#56](#56))
([153eaa3](153eaa3))


### Bug Fixes

* Synchronize provider state access on the state lock
([#54](#54))
([ebe9513](ebe9513))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release Please** bumps the library from **1.1.3** to **1.2.0** in
`gradle.properties` and `.release-please-manifest.json`, and adds the
**1.2.0** section to `CHANGELOG.md`. No runtime code changes in this
diff.
> 
> The published **1.2.0** release (already on `main`) includes:
**deprecated** `Provider.getState()` with guidance to use
`Client.getProviderState()`; **flag metadata** on evaluations derived
from LaunchDarkly evaluation reason fields; and **thread-safe** provider
state reads/writes via synchronization on the state lock.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a86744b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants