Search code examples
javanaming-conventionsgetter-settercamelcasing

Getters/setters when first word has second letter capitalized


What should we expect from the following name? : mGage Program

if I camelCase this it will be mGageProgram and if I generate (in eclipse) the getters and setters I will get the following:

public String getmGageProgram() {
    return mGageProgram;
}

public void setmGageProgram(String mGageProgram) {
    this.mGageProgram = mGageProgram;
}

Which to me doesn't seem right as I was expecting the getMGageProgram() and setMGageProgram(value).

Are these getters/setters names alright?


Solution

  • According to 8.8: Capitalization of inferred names of the JavaBeans API specification the names generated from the IDE are correct.