Skip to content

[java] UnnecessaryConstructor: False positive for JavaDoc-bearing constructor #6284

Closed

Description

@Vampire

Affects PMD Version: 7.18.0

Rule: UnnecessaryConstructor

Description:

An empty public no-arg constructor that bears JavaDoc is not unnecessary.
Without it, the JavaDoc tool renders the auto-generated default constructor to the docs, without any description.
Newer JavaDoc tool versions even give a doclint warning about it, that by IntelliJ is even displayed as error.

Expected outcome:

PMD reports a violation but that's wrong. That's a false positive.

Running PMD through: Gradle

Activity

  1. added
    a:false-positive
    on Nov 28, 2025
  2. changed the title [-][java] `UnnecessaryConstructor` reporting false-positive on JavaDoc-bearing constructor[/-] [+][java] UnnecessaryConstructor: False positive for JavaDoc-bearing constructor[/+] on Dec 22, 2025
  3. added this to the 7.20.0 milestone on Dec 22, 2025
  4. added a commit that references this issue on Dec 22, 2025
    9193b21
  5. added a commit that references this issue on Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positive

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions