GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value · Issue #4200 · pmd/pmd

[java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value #4200

New issue
Copy link
New issue
Copy link
Closed
#4202
Closed
[java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value#4200
#4202
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
6.52.0

Description

@LynnBroe
LynnBroe
opened on Nov 9, 2022
Issue body actions

Affects PMD Version:6.51.0

Rule: ClassWithOnlyPrivateConstructorsShouldBeFinal

Please provide the rule name and a link to the rule documentation:
https://pmd.sourceforge.io/pmd-6.51.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal

Description:
In the following code example, @Value can add a final modifier to the class Test and causes a false positive that PMD considers it is a class with only private constructors but no final modifier.

Code Sample demonstrating the issue:

import lombok.Value;

@Value
public class Test {
    private Test(int a, int b, int c, String abc, long d, double p, String[] arr, int data, long in, float fl, String res) {}
}

Expected outcome:

PMD reports a violation at line 4, but that's wrong. That's a false positive.

Running PMD through: CLI

Activity

  1. LynnBroe
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Nov 9, 2022
  2. adangel
    changed the title [-]ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value[/-] [+][java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value[/+] on Nov 10, 2022
  3. adangel
    added this to the 6.52.0 milestone on Nov 11, 2022
  4. adangel
    closed this as completedin 3eb291con Nov 11, 2022
  5. adangel
    added 2 commits that reference this issue on Nov 11, 2022

    [doc] Update release notes (#4200, #4201, #4202)

    f28bb76

    Merge pull request pmd#4202 from LynnBroe:master

    e2a845e
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-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.52.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.