Skip to content

[java] BeanMembersShouldSerialize is extremely noisy #1668

@Vampire

Description

@Vampire

Rule doc: BeanMembersShouldSerialize

This is more of a question but could be seen as documentation bug.
How does the BeanMembersShouldSerialize rule classify a class as bean or used by a bean?
I have a class that will never be serialized ever or someone did something horribly wrong.
I see that for some cases it makes sense to mark members as transient even if they do not implement Serializable as other serialization mechanisms like Gson could also take that modifier into account.
But from the description I don't see when this rule applies to a class and when not and why it is applied to my class which is actually used by no other code as it is meant to be used by consumers of my library.

Metadata

Metadata

Assignees

Labels

a:false-positivePMD flags a piece of code that is not problematic

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions