Menu

#244 False +: ImmutableFieldRule with static inner class

closed
pmd (543)
5
2012-10-07
2004-10-22
No

Hi the following code is flagged as violating
ImmutableFieldRule.

count should not be final, this is a false +

package com.premier.cims.sbl.external.finance.pcr;

public class CStatic {
//~ Constructors ------

public CStatic() {
}

//~ Methods 
public InnerStuff callMe() {
    InnerStuff stuff = new InnerStuff();
    stuff.count = 5;
    return stuff;
}

public static class InnerStuff {
    private int count = 0;
    public int getCount() {
        return count;
    }
}

}

Discussion

  • Benoit Xhenseval

    Logged In: YES
    user_id=358115

    Tom,
    Any progress on this one also?
    Many thanks
    Benoit

     
  • Tom Copeland

    Tom Copeland - 2005-08-25

    Logged In: YES
    user_id=5159

    Hi Benoit -

    This appears to have been fixed in CVS at some point. You
    can download an updated pmd-3.2 jar file from here:

    http://infoether.com/~tom/pmd-3.2.jar

    that should work.

    Thanks,

    Tom

     

Log in to post a comment.

MongoDB Logo MongoDB