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;
}
}
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".
hum, no answer to Xavier on this one... Set this entry to pending.
can this issue be be updated to be marked as false positive? Other issues seem to use False + for start of title.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 500 days (the time period specified by
the administrator of this Tracker).