Skip to content

Leading asterisk is not detected at the beginning of javadoc content for google style #18271

@Praveen7294

Description

@Praveen7294

From: 7.1.1 General Form and google/google-java-format#1279 (comment)

7.1.1 General form
The basic formatting of Javadoc blocks is as seen in this example:

/**
 * Multiple lines of Javadoc text are written here,
 * wrapped normally...
 */
public int method(String p1) { ... }

... or in this single-line example:
/** An especially short bit of Javadoc. */
The basic form is always acceptable. The single-line form may be substituted when the entirety of the Javadoc block (including comment markers) can fit on a single line.


Part of #17778, subproblem 1

According to Google Java Style, Javadoc content must begin on the second line after /**, and leading asterisks are treated as part of the content. However, in the following example:

/*************************************************
 * @param str testing.....
 */
public InputCorrectJavadocLeadingAsteriskAlignment(String str) {}

the leading asterisks that appear immediately after /** are treated as Javadoc content. JavadocContentLocation ignores such content because the check explicitly states that content beginning with a leading asterisk is skipped. As a result, this case becomes a false negative, even though the Google Style Guide requires validation of content starting rules.

please, work on this issue after merging #18255

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