pmd / pmd/pmd

[apex] AvoidBooleanMethodParameters: False positive on getter and setter

Open
#6,261 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

a:false-positive
Dominant language
Java
Stars
5.5k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
54

Description

Affects PMD Version: 7.15.0

Rule: AvoidBooleanMethodParameters

Description:
Rule marks Boolean getter, setter as violation.

Code Sample demonstrating the issue:

public Boolean displayable { get; set; }

Expected outcome:

PMD reports a violation, getter and setter should not be considered as violation of this rule. That's a false positive.

Running PMD through: CLI

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the AvoidBooleanMethodParameters rule and reproduce the Apex sample through the CLI. Done means the Boolean property getter and setter are no longer reported as violations for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.