Skip to content

fix: update ProviderEvaluationBuilder usage for OpenFeature SDK 1.21.0 compatibility#52

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1782724567-fix-openfeature-sdk-compatibility
Jun 29, 2026
Merged

fix: update ProviderEvaluationBuilder usage for OpenFeature SDK 1.21.0 compatibility#52
kinyoklion merged 1 commit into
mainfrom
devin/1782724567-fix-openfeature-sdk-compatibility

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Jun 29, 2026

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

OpenFeature Java SDK 1.21.0 changed ProviderEvaluationBuilder from having 1 type parameter to 3 (adopting Lombok's @SuperBuilder pattern). This causes a compilation failure since the provider declares the builder with an explicit single-parameter type.

Describe the solution you've provided

- ProviderEvaluation.ProviderEvaluationBuilder<T> builder = ProviderEvaluation.<T>builder()
+ var builder = ProviderEvaluation.<T>builder()

Using var lets the compiler infer the correct builder type regardless of the OpenFeature SDK version. The var keyword is already used elsewhere in the codebase (e.g., Provider.java). All 43 existing tests pass with this change against OpenFeature SDK 1.21.0.

Describe alternatives you've considered

  • Explicitly using ProviderEvaluation.ProviderEvaluationBuilder<T, ?, ?> — works but couples the code to the new 3-param signature and wouldn't compile against older SDK versions.

Additional context

Versions tested: OpenFeature SDK 1.21.0, LaunchDarkly Java Server SDK 7.14.0. The version constraint [1.16.0,2.0.0) was already compatible — only the source code needed updating.

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


Note

Low Risk
Single-line typing change in evaluation detail conversion; no runtime logic changes.

Overview
Fixes a compile break with OpenFeature Java SDK 1.21.0, where ProviderEvaluationBuilder gained extra type parameters.

In EvaluationDetailConverter.getProviderEvaluation, the local builder is now declared with var instead of ProviderEvaluation.ProviderEvaluationBuilder<T>, so the compiler picks the right builder type across SDK versions. Evaluation mapping behavior is unchanged (value, reason, error code, variant).

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

… 1.21.0

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion kinyoklion self-assigned this Jun 29, 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 June 29, 2026 15:46
@kinyoklion kinyoklion requested a review from a team as a code owner June 29, 2026 15:46
@kinyoklion

Copy link
Copy Markdown
Member Author

Introduced by open-feature/java-sdk#1901

@kinyoklion kinyoklion merged commit 4350abe into main Jun 29, 2026
9 checks passed
@kinyoklion kinyoklion deleted the devin/1782724567-fix-openfeature-sdk-compatibility branch June 29, 2026 16:20
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.

2 participants