twotoasters / hoot

A powerful, flexible, lightweight Android library for dealing with RESTful endpoints.
Apache License 2.0
26 stars 10 forks source link

All class members should declare an explicit access level. #2

Closed twaddington closed 11 years ago

twaddington commented 11 years ago

There are a lot of methods that don't specify an access level:

    String getBasicAuthUsername() {
        return mBasicAuthUsername;
    }

    String getBasicAuthPassword() {
        return mBasicAuthPassword;
    }

All the members should explicitly declare an access level. Private should be the go-to unless it's a public method. Protected should be used wisely.

Dropping this here so we can all remember to go in and clean these up as we see them.

bjdupuis commented 11 years ago

I disagree. These are explicitly package private, because they are meant to be accessible from within Hoot but not from outside. On Oct 3, 2012 6:46 PM, "Tristan Waddington" notifications@github.com wrote:

There are a lot of methods that don't specify an access level:

String getBasicAuthUsername() {
    return mBasicAuthUsername;
}

String getBasicAuthPassword() {
    return mBasicAuthPassword;
}

All the members should explicitly declare an access level. Private should be the go-to unless it's a public method. Protected should be used wisely.

Dropping this here so we can all remember to go in and clean these up as we see them.

— Reply to this email directly or view it on GitHubhttps://github.com/twotoasters/hoot/issues/2.

twaddington commented 11 years ago

Okay, so long as it's consistent. What's the reasoning behind this example from Hoot.java? Just an oversight?

    String getBaseUrl() {
        return mBaseUrl;
    }

    public boolean isBasicAuth() {
        return mBasicAuthUsername != null && mBasicAuthPassword != null;
    }
bjdupuis commented 11 years ago

Yeah, I think that was an auto generated oversight. Thanks for the heads up. On Oct 3, 2012 7:11 PM, "Tristan Waddington" notifications@github.com wrote:

Okay, so long as it's consistent. What's the reasoning behind this example from Hoot.java? Just an oversight?

String getBaseUrl() {
    return mBaseUrl;
}

public boolean isBasicAuth() {
    return mBasicAuthUsername != null && mBasicAuthPassword != null;
}

— Reply to this email directly or view it on GitHubhttps://github.com/twotoasters/hoot/issues/2#issuecomment-9125712.

bjdupuis commented 11 years ago

Addressed in 0254cf40d1a109d806023dd9c01cfb6faa5f0d3f.