Skip to content

feat: Deprecate the provider getState method - #55

Open
kinyoklion wants to merge 1 commit into
mainfrom
devin/java-deprecated-get-state
Open

feat: Deprecate the provider getState method#55
kinyoklion wants to merge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant