Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing @param and @return tags for getter and setter methods #1581

Open
RagGren opened this issue Jan 5, 2024 · 0 comments
Open

Missing @param and @return tags for getter and setter methods #1581

RagGren opened this issue Jan 5, 2024 · 0 comments

Comments

@RagGren
Copy link

RagGren commented Jan 5, 2024

By issue 218 (Generate @Param and @Returns javadoc) (pull request 219) @param and @retrun tags have been added.

This feature is not working for getter and setter (any more).
Currently only @param tags will be created, only for constructors. JDocComment#addParam( String) will only be called in ConstructorRule.
JDocComment#addReturn() will never be called.

title and descrition will currently be used in the Javadoc for getter and setter, but not as @param and @retrun tags, e.g.:

    /**
     * Titel of the property
     * <p>
     * Description of the property
     * (Required)
     * 
     */
    public Type getProperty() {
        return property;
    }

    /**
     * Titel of the property
     * <p>
     * Description of the property
     * (Required)
     * 
     */
    public void setProperty(Type property) {
        this.property = property;
    }

It should be something like this:

    /**
     * Gets the Titel of the property.
     * <p>
     * Description of the property
     * (Required)
     *
     * @return the Titel of the property
     */
    public Type getProperty() {
        return property;
    }

    /**
     * Sets the Titel of the property.
     * <p>
     * Description of the property
     * (Required)
     * 
     * @param property
     *     Titel of the property
     */
    public void setProperty(Type property) {
        this.property = property;
    }

N.B.: IMHO it would be sufficient to use only the title (if exists, otherwise the description) for the tags, but the current solution used for @param tags at constructors (title + . + description) is fine too.

@param and @retrun tags, including the title (and/or maybe description), should be added to getter and setter.

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

No branches or pull requests

1 participant