Skip to content

Wrong JavaDoc with invalid syntax #1018

Closed
@Vampire

Description

@Vampire

The JavaDoc show invalid examples and should be reviewed for errors.
For example in MockingApi the Mock and Stub methods use leftshift for defining return values instead of rightshift:

// type is Person.class, name is "person", returns hard-coded values for property {@code name} and method {@code sing()}
Person person = Stub {
  name << "Fred"
  sing() << "Tra-la-la"
}

Also would name >> "Fred" be valid?
Because I tried to do it like that and got No such property: author for class: net.kautler.command.api.restriction.javacord.BotOwnerJavacordTest

I also tried delegate.name, in which case I get no error, but the call is not recorded at all.
Same with delegate.getName().
(I tried to make CodeNarc happy which checks that you use property syntax if you can and it doesn't recognize that you cannot there which might actually be a bug)

Update: Aah, it.name works.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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