[ pmd-Bugs-2023757 ] BeanMembersShouldSerialize doesn't understand boolean naming

View: New views
1 Messages — Rating Filter:   Alert me  

[ pmd-Bugs-2023757 ] BeanMembersShouldSerialize doesn't understand boolean naming

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bugs item #2023757, was opened at 2008-07-21 13:02
Message generated for change (Comment added) made by ruza
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=479921&aid=2023757&group_id=56262

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: pmd
Group: None
Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Don Kirkby (imfurry)
Assigned to: Nobody/Anonymous (nobody)
Summary: BeanMembersShouldSerialize doesn't understand boolean naming

Initial Comment:
Bug 962782 seems to have reappeared or still be present in PMD for Eclipse 3.2.4.v200804111600.

This class breaks the rule:
package com.pets;

public class Dog {
        private boolean isCute;

        /**
         * @return the isCute
         */
        public boolean isCute()
        {
                return isCute;
        }

        /**
         * @param isCute the isCute to set
         */
        public void setCute(boolean isCute)
        {
                this.isCute = isCute;
        }
}

This class doesn't break the BeanMembersShouldSerialize rule, but does break BooleanGetMethodName.
package com.pets;

public class Cat {
        private boolean isCute;

        /**
         * @return the isCute
         */
        public boolean getIsCute()
        {
                return isCute;
        }

        /**
         * @param isCute the isCute to set
         */
        public void setIsCute(boolean isCute)
        {
                this.isCute = isCute;
        }
}


----------------------------------------------------------------------

Comment By: Jan Ruzicka (ruza)
Date: 2009-08-19 17:38

Message:
can this issue be be updated to be marked as false positive? Other issues
seem to use False + for start of title.

----------------------------------------------------------------------

Comment By: Romain PELISSE (rpelisse)
Date: 2008-12-09 18:21

Message:
hum, no answer to Xavier on this one... Set this entry to pending.

----------------------------------------------------------------------

Comment By: Xavier Le Vourch (xlv)
Date: 2008-09-02 16:02

Message:
Logged In: YES
user_id=1373398
Originator: NO

I implemented a fix but I'm not sure it should be changed as the field has
the same name as the method and triggers AvoidFieldNameMatchingMethodName.
Maybe we should just document the fact that a boolean field is not supposed
to start with "is"?

The original fix for bug 962782 deals with the field named "cute" instead
of "isCute".


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=479921&aid=2023757&group_id=56262

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pmd-devel mailing list
Pmd-devel@...
https://lists.sourceforge.net/lists/listinfo/pmd-devel