Skip to content

docs: fix LDConfig.Builder examples to include AutoEnvAttributes parameter#334

Open
kinyoklion wants to merge 1 commit intomainfrom
devin/1774052331-fix-auto-env-attrs-doc-examples
Open

docs: fix LDConfig.Builder examples to include AutoEnvAttributes parameter#334
kinyoklion wants to merge 1 commit intomainfrom
devin/1774052331-fix-auto-env-attrs-doc-examples

Conversation

@kinyoklion
Copy link
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

No test changes needed — this PR only modifies Javadoc code examples.

Related issues

N/A — identified during a documentation audit of client-side SDK examples.

Describe the solution you've provided

All LDConfig.Builder code examples in Javadoc comments were using the no-arg constructor (new LDConfig.Builder()), which does not exist. The actual constructor requires an AutoEnvAttributes parameter: new LDConfig.Builder(AutoEnvAttributes.Enabled).

This PR updates every affected Javadoc example across 13 source files to use the correct constructor signature.

Describe alternatives you've considered

None — the examples must match the actual method signature.

Additional context

Key items for review:

  • Completeness — a grep for the no-arg new LDConfig.Builder() pattern against the main source tree returns zero results after this change.
  • All 34 replacements are confined to Javadoc <pre><code> blocks; no functional code was modified.
  • AutoEnvAttributes.Enabled was chosen as the example value since it is the recommended setting per the SDK documentation.

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

…meter

Co-Authored-By: rlamb@launchdarkly.com <kingdewman@gmail.com>
@devin-ai-integration
Copy link
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 and CI monitoring

* after setting any desired properties on the builder, applies this configuration to the SDK.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be LDConfig.Builder.AutoEnvAttributes.Disabled or is AutoEnvAttributes.Enabled fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example app (example/MainActivity.java) uses the short form with an import:

import com.launchdarkly.sdk.android.LDConfig.Builder.AutoEnvAttributes;
// ...
LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)

Since these are Javadoc examples, the short form AutoEnvAttributes.Enabled is consistent with how users would write it after importing the enum.

That said, I'm happy to change all occurrences to LDConfig.Builder.AutoEnvAttributes.Enabled if you'd prefer the fully-qualified form for clarity in the doc examples — just let me know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanderson-ld I will leave this choice to you.

@kinyoklion kinyoklion marked this pull request as ready for review March 21, 2026 00:48
@kinyoklion kinyoklion requested a review from a team as a code owner March 21, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant