Skip to content

Javadoc examples in Atomic.java and RtSttc.java call non-existent Locks#lock(String) #115

Description

@bibonix

The class-level Javadoc examples in two files call Locks#lock(String), but that method does not exist on the Locks interface. The interface only declares exists(String) and get(String) (src/main/java/co/stateful/Locks.java:24,32), so the examples will not compile against the current API.

The offending snippets are in src/main/java/co/stateful/Atomic.java:31-33:

Lock lock = new RtSttc(new URN("urn:github:12345"), "token")
  .locks().lock("test");

and in src/main/java/co/stateful/RtSttc.java:33-35:

Lock lock = new RtSttc(
  new URN("urn:github:12345"), "token"
).locks().lock("test");

Both fail at .locks().lock("test") because RtSttc#locks() returns a Locks, and Locks exposes Lock get(String) to look up a lock by name.

Proposed fix: replace .locks().lock("test") with .locks().get("test") in both class-level Javadocs so the example matches the actual API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions