Skip to content

Clarification needed in Java style guide, Javadoc formatting rules (Section 7.1.1 General Form) #1279

@Zopsss

Description

@Zopsss

Copy of: google/styleguide#941

In Section 7.1.1 General Form, the style guide shows examples of how Javadoc blocks should look. However, there are a few cases not explicitly mentioned, which makes it unclear if they are acceptable or not.

Cases that need clarification:

  1. Text immediately after /**
/** Javadoc starts without a leading asterisk.
 * More text...
 */

Should be text allowed immediately after /**?

  1. Lines inside a Javadoc block without a leading asterisk
/**
     Line without asterisk, indentation inconsistent.
 */

Should every line inside a multi-line Javadoc always begin with *, or is it acceptable to omit it?

  1. Closing */ on the same line as content
/**
 * Some description. */

Should this be considered valid, or should */ always appear on its own line in multi-line Javadoc blocks?


Based on the examples given, it seems more consistent if:

  • all lines in multi-line Javadoc start with *.
  • /** should be alone on the line, i.e it should not be followed by any content.
  • the closing */ is always placed on a separate line.

Could Section 7.1.1 be updated to clarify whether these forms are allowed or not?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions