`plusOrReplace` example not working in Java

Open
#547 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, kotlin
Domain
documentation

Research direction

Open selfie.dev/src/pages/jvm/facets.mdx at the linked example and compare its plusOrReplace call with the documented Java signature. Check the mentioned SnapshotValue.of(...) and SnapshotValueString options for Java accessibility. Done means the documentation example uses a valid Java-compatible value and matches the public API.

Written by the indexing model from the issue text.

Description

bug docs jvm

The documentation shows the following example:
https://github.com/diffplug/selfie/blob/9e72865b58f07a2cb1d576110165ba3bbb4e1501/selfie.dev/src/pages/jvm/facets.mdx?plain=1#L149

...but the signature of plusOrReplace is public final Snapshot plusOrReplace(@NotNull String key, @NotNull SnapshotValue value) - it can not take String as the second argument (like the example shows)

The codebase contains a SnapshotValue.of(...) call, but it does not seem accessible from Java?

I guess one could call new SnapshotValueString(...) directly?

Dominant language
Kotlin
Stars
101
Forks
18
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/selfie

All issues in diffplug/selfie

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.