Skip to content

[java] BeanMembersShouldSerialize : add a property to ignore class not implementing the Serializable interface #403

@TehBakker

Description

@TehBakker

Rule Set:
I used PMD 5.4.1 though the Eclipse plugin.

Description:
The BeanMembersShouldSerialize rule : https://pmd.github.io/pmd-5.4.1/pmd-java/rules/java/javabeans.html#BeanMembersShouldSerialize
Since PMD has noway to determinate what is a bean and what is a Service, it would be great to have a property allowing to easily apply this rule only to Bean implementing the Serializable interface.
Kinda like Sonar now does it with its Fields in a "Serializable" class rule.

I see a lot of people asking about it on Stackoverflow and it leads to people adding transient everywhere without really knowing why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions