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

[BUG] Javadoc warnings on builder methods #2323

Closed
Vynnytska opened this issue Dec 26, 2019 · 1 comment
Closed

[BUG] Javadoc warnings on builder methods #2323

Vynnytska opened this issue Dec 26, 2019 · 1 comment

Comments

@Vynnytska
Copy link

Description:
When using lombok and add javadoc on field inside a class, warnings are thrown when generating javadoc, which depends on delombok task.

To Reproduce:
Create a class with Value and Builder lombok annotation. Add javadoc on fields inside it and override some builder methods. For example,

/**
 * Class used to store a unit of log.
 */
@Value
@Builder
public class Log {

    @NonNull
    private final Severity severity;
    /**
     * Should be specified.
     */
    private final String message;
    /**
     * Optional field. {@link Log.Category#UNCATEGORIZED} by default.
     */
    private final Category category;

    public static class LogBuilder {

        public LogBuilder message(@NonNull String pattern, Object... arguments) {

            message = MessageFormat.format(pattern.replace("'", "''"), arguments);
            if (!message.endsWith(".")) {
                message = message + ".";
            }
            return this;
        }

        public Log build() {
            if (category == null) {
                category = Category.UNCATEGORIZED;
            }
            return new Log(severity, message, category);
        }

    }

}

Then run ./gradlew javadoc.
Actual behaviour:

Task :javadoc
warning: no @return
public Category getCategory() {
^
warning: no @param for category
public LogBuilder category(final Category category) {
^
warning: no @return
public LogBuilder category(final Category category) {
^
3 warnings

if add java docs @param and @return to java docs on category field, only one warning will bet thrown:

Task :javadoc
warning: no @return
public LogBuilder category(final Category category) {
^

Expected behavior:
No warnings.

Version info (please complete the following information):

  • Lombok since 1.18.6v
  • java 11
  • gradle 6.0.1
@nikolayandr
Copy link

nikolayandr commented Apr 26, 2021

I have the same issue: "...warning: no @param for..." for the current last available lombok version.
Looks like @rzwitserloot 's commit 0b0656a only fixes issue related to @return

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

2 participants