Skip to content

Fix Javadoc Warnings: "use of default constructor, which does not provide a comment" #17642

@AmitKumarDeoghoria

Description

@AmitKumarDeoghoria

From Comment : #17630 (comment)
When running the maven-site-plugin (with maven-javadoc-plugin:3.11.2), the build currently fails because of 100+ Javadoc warnings related to classes that do not have documented constructors.

These warnings block mvn site execution and need to be resolved.

hundred of:

[WARNING] Javadoc Warnings
[WARNING] /home/circleci/project/src/main/java/com/puppycrawl/tools/checkstyle/
  checks/naming/AbbreviationAsWordInNameCheck.java:146: 
  warning: use of default constructor, which does not provide a comment
[WARNING] public class AbbreviationAsWordInNameCheck extends AbstractCheck {
[WARNING] ^

and single

[WARNING] Note: Custom tags that could override future standard tags:
    @noinspectionreason, @noinspection. To avoid potential overrides, 
    use at least one period character (.) in custom tag names.
[WARNING] Note: Custom tags that were not seen:  @noinspectionreason, @noinspection
[WARNING] 100 warnings

[WARNING] /home/circleci/project/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java:146: warning: use of default constructor, which does not provide a comment [WARNING] public class AbbreviationAsWordInNameCheck extends AbstractCheck { [WARNING] ^ [WARNING] /home/circleci/project/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java:64: warning: use of default constructor, which does not provide a comment [WARNING] public abstract class AbstractAutomaticBean [WARNING] ^ ... [WARNING] Note: Custom tags that could override future standard tags: @noinspectionreason, @noinspection. [WARNING] 100 warnings [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.21.0:site ...

CI Error Link : https://app.circleci.com/pipelines/github/checkstyle/checkstyle/36005/workflows/de45df89-f2ed-43a4-aa38-ec36e77f3e33/jobs/1042842

Root Cause

The Javadoc plugin complains whenever:

  • A public or protected class has an implicit or explicit default constructor but lacks Javadoc.
  • Nested static/inner classes also trigger this if their constructors are not documented.

Since many Checkstyle checks and utility classes rely on default constructors, these warnings accumulate and break the site phase.

Some details on fact that compiler add this constructor:
https://stackoverflow.com/a/17709063

Proposed Solution

Add minimal Javadoc comments for default constructors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions