Constants with Equal Values (CEV)

Description:

This rule catches constants with equal values. The presence of different constants with equal values can cause bugs if these constants have equal meaning.

Example:

final static int SUNDAY = 0;
final static int MONDAY = 1;
final static int TUESDAY = 2;
final static int WEDNESDAY = 3;
final static int THURSDAY = 4;
final static int FRIDAY = 5;
final static int SATURDAY = 0;

// This method would never return "Saturday"  
void getDayName(int day) {
    if( day == SUNDAY )
        return "Sunday";
    ...
    else if( day == SATURDAY )
        return "Saturday";
    ...
}