• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • PMD
  • Issues
PMD

BeanMembersShouldSerialize with Dependency Injection false +

A source code analyzer

Brought to you by: adangel, juansotuyo
  • Summary
  • Files
  • Reviews
  • Support
  • News
  • Donate
  • Code
  • Mailing Lists
  • Issues
  • Patches
  • Feature Requests
  • Discussion
Menu ▾ ▴
  • Create Ticket
  • View Stats

Milestone

  • New Tickets
  • PMD-Backlog
  • Eclipse-Plugin
  • Documentation

Searches

  • Feature Requests
  • Changes
  • Closed Tickets
  • In Progress
  • More Info Needed
  • Open Eclipse
  • Open Tickets
  • PMD-5.3.7
  • PMD-5.3.8
  • PMD-5.4.2
  • PMD-5.4.3
  • PMD-5.5.1
  • PMD-5.5.2
  • PMD-5.5.3
  • PMD-5.5.4

Help

  • Formatting Help

#781 BeanMembersShouldSerialize with Dependency Injection false +

open
Tom Copeland
pmd (543)
5
2013-08-25
2008-06-09
Anthony Whitford
No

The BeanMembersShouldSerialize rule from the JavaBeans rule set is generating false positives when using an Inversion of Control framework.

For example:

public class Foo {
@In
SessionContext sessionContext;
...
}

The sessionContext field will be injected from the IoC container, so I don't need to add an accessor or mutator. Adding transient would be misleading because the class is not serializable.

http://pmd.sourceforge.net/rules/javabeans.html#BeanMembersShouldSerialize

I guess the logical solution would be to be able to customize the rule to skip if certain annotations are present, such as @In (Seam, Guice), @Resource (Spring), @EJB (EJB 3), etc.

Discussion

  • Anthony Whitford

    Anthony Whitford - 2013-08-25

    See Bug 881 too: https://sourceforge.net/p/pmd/bugs/881/

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2025 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
×