launchdarkly/java-server-sdk

Builder object is not exist in V6 but is taken as an example in the docs

saharis9988 opened this issue · 6 comments

Is this a support request?
No

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

Describe the bug
There is no builder object in V6, but you added an example of it in the docs instead of the factory method example
see https://docs.launchdarkly.com/sdk/server-side/java#getting-started

SDK version
6.0.4

Language version, developer tools
java

OS/platform
macos Monterey

Hi. Thanks for reporting that there's an error in the docs; we'll fix it ASAP. To be clear, it's not that "the Builder object" (as in, the class) really has a lowercase name; the class is called Builder, capitalized like all Java classes. The mistake in the docs is that it is showing the use of a constructor (new LDContext.Builder()) but instead you are supposed to call a factory method (LDContext.builder()). This is a static method of the LDContext class, and (again following Java convention) method names are not capitalized.

We definitely need to fix this example code, but for future reference, the most authoritative and complete source for knowing exactly what all of the classes and methods are in the SDK is the generated Javadoc API documentation. Here is the page for LDContext.

We've fixed the documentation. Thanks again for the report.

First of all, you are right :)
I've used v5 before it with the object instantiation and when I tried to migrate to v6 with the object construction I didn't notice you are presenting the factory usage so I thought there is a typo here (the convention is that the class name starts with an uppercase letter).
Anyway, for me and for others (trust me :)), the source of information about the SDK is the docs so it's important to update it accordingly.
The auto-generated java docs are not readable so much.

As I said, we know it is important to have the online docs be correct, and we have updated them. I was not saying they were irrelevant.

I mentioned the auto-generated docs simply because developers sometimes don't notice that they are there. I'm not sure what you mean by "are not readable so much"; they use the Javadoc format which all Java libraries use, which is intended to be convenient for Java developers. If there's something you think is wrong or confusing in the text there, please let us know.

But I do want to emphasize that the pages at docs.launchdarkly.com are not, and never have been, intended to describe every class or method in the SDK. So if you're ever wondering, for instance, what all of the available methods of the LDContext are, the generated docs are always the best place to look.

Eli please do not take me so seriously..
I understand what you are saying, I don't say that I always look only in the official docs, but I try to get the maximum I can take from them, because the java SDK docs in general are not reader freindly. You must agree with me.
So I'm trying not to go there.
Thank you for the fast response and support, I appreciate it :)