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] ImmutableField: Do not flag fields annotated with @Inject · Issue #4011 · pmd/pmd

[java] ImmutableField: Do not flag fields annotated with @Inject #4011

New issue
Copy link
New issue
Copy link
Closed
#4018
Closed
[java] ImmutableField: Do not flag fields annotated with @Inject#4011
#4018
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
6.47.0

Description

@maikelsteneker
maikelsteneker
opened on Jun 14, 2022
Issue body actions

Affects PMD Version: 6.46.0

Rule: ImmutableField

Description: Fields that are annotated using the javax.inject.Inject annotation should not be final. However, a violation suggesting as much is still triggered.

Code Sample demonstrating the issue:

public abstract class AbstractDapiProcess implements Process {
   @Inject private AuthenticationService authService;

Expected outcome: No violation

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

Running PMD through: CLI

Activity

  1. maikelsteneker
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Jun 14, 2022
  2. adangel
    added this to the 6.47.0 milestone on Jun 23, 2022
  3. adangel
    linked a pull request that will close this issue[java] Fix #4008 - ImmutableField FN with field assigned only in initializer #4018on Jun 23, 2022
  4. adangel
    added 2 commits that reference this issue on Jun 23, 2022

    [java] ImmutableField - add test case for @Inject (pmd#4011)

    f16532f

    [doc] Update release notes for PR pmd#4018

    520ca80
  5. adangel
    closed this as completedin #4018on Jun 23, 2022
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.47.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.