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

Generate @return and @param JavaDoc tags for @Getter and @Setter annotations #3209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lars-sh
Copy link
Contributor

@lars-sh lars-sh commented Jun 10, 2022

I suggest to generate the JavaDoc tags @return and @param for the lombok annotations @Getter and @Setter unless they are specified by the developer manually.

Missing JavaDoc tags cause warnings in javac of JDK11 and later. That's why I came across this idea, which literally avoids developers to copy over JavaDoc code of really simple getters and setters for the @return or @param JavaDoc tags.

I hope this makes sense. Feel free to give me feedback to the general idea, the implementation, code style and so on.

This Pull Request contains multiple test cases for both lombok annotations inside src/test/resources/transform/..., while here comes one example to show the use of this request:

Lombok code:

/**
 * First name of the employee
 */
String firstName;

Delomboked code:

/**
 * First name of the employee
 */
@Getter
String firstName;

/**
 * First name of the employee
 * @return First name of the employee
 */
public String getFirstName() {
    return this.firstName;
}

@lars-sh
Copy link
Contributor Author

lars-sh commented Jul 19, 2022

@rspilker, I really enjoy work.
Is there something I can do to support this Pull Request?

@dstango
Copy link

dstango commented Jul 19, 2022

This seems to be a somewhat different concept than the one already present, which allows to specify @param and @return on the field and then copies/moves it around: https://projectlombok.org/features/GetterSetter

As far as I've witnessed the development of lombok so far, I guess a new concept like this would first need some discussion and consideration before such a PR might be accepted.

I guess @rzwitserloot or @rspilker should say how to best proceed.

@lars-sh
Copy link
Contributor Author

lars-sh commented Jul 19, 2022

Thanks @dstango :)
I'm not sure, how the Lombok project is organized and if you ask me to create an issue or something else instead I'm absolutely fine with that, too.

Indeed, discussing the expectations and the idea are highly appreciated. I don't expect this Pull Request to be merged, it's meant to initiate a discussion by providing some more examples (see the test resources).

I'm aware of the available @param and @return magic of Lombok, as I'm using it that way. This idea is meant to be an extension for the case there's no @param or @return tag.

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

Successfully merging this pull request may close these issues.

2 participants