Issue #957: Decrease visibility of package-private methods
This commit is contained in:
parent
6f7799cb72
commit
e04cbbf23e
|
|
@ -246,7 +246,7 @@ public abstract class AbstractDeclarationCollector extends Check {
|
|||
/** Add a name to the frame.
|
||||
* @param nameToAdd the name we're adding
|
||||
*/
|
||||
void addName(String nameToAdd) {
|
||||
private void addName(String nameToAdd) {
|
||||
varNames.add(nameToAdd);
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ public abstract class AbstractDeclarationCollector extends Check {
|
|||
* @param nameToFind the name we're looking for
|
||||
* @return whether it was found
|
||||
*/
|
||||
LexicalFrame getIfContains(String nameToFind) {
|
||||
private LexicalFrame getIfContains(String nameToFind) {
|
||||
LexicalFrame frame = null;
|
||||
|
||||
if (contains(nameToFind)) {
|
||||
|
|
|
|||
|
|
@ -134,12 +134,12 @@ public class FinalClassCheck
|
|||
}
|
||||
|
||||
/** Adds private ctor. */
|
||||
void reportPrivateCtor() {
|
||||
private void reportPrivateCtor() {
|
||||
withPrivateCtor = true;
|
||||
}
|
||||
|
||||
/** Adds non-private ctor. */
|
||||
void reportNonPrivateCtor() {
|
||||
private void reportNonPrivateCtor() {
|
||||
withNonPrivateCtor = true;
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ public class FinalClassCheck
|
|||
* Does class have private ctors.
|
||||
* @return true if class has private ctors
|
||||
*/
|
||||
boolean isWithPrivateCtor() {
|
||||
private boolean isWithPrivateCtor() {
|
||||
return withPrivateCtor;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ public class FinalClassCheck
|
|||
* Does class have non-private ctors.
|
||||
* @return true if class has non-private ctors
|
||||
*/
|
||||
boolean isWithNonPrivateCtor() {
|
||||
private boolean isWithNonPrivateCtor() {
|
||||
return withNonPrivateCtor;
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ public class FinalClassCheck
|
|||
* Is class declared as final.
|
||||
* @return true if class is declared as final
|
||||
*/
|
||||
boolean isDeclaredAsFinal() {
|
||||
private boolean isDeclaredAsFinal() {
|
||||
return declaredAsFinal;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ public class FinalClassCheck
|
|||
* Is class declared as abstract.
|
||||
* @return true if class is declared as final
|
||||
*/
|
||||
boolean isDeclaredAsAbstract() {
|
||||
private boolean isDeclaredAsAbstract() {
|
||||
return declaredAsAbstract;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public class ModifierOrderCheck
|
|||
* @return null if the order is correct, otherwise returns the offending
|
||||
* modifier AST.
|
||||
*/
|
||||
static DetailAST checkOrderSuggestedByJLS(List<DetailAST> modifiers) {
|
||||
private static DetailAST checkOrderSuggestedByJLS(List<DetailAST> modifiers) {
|
||||
final Iterator<DetailAST> iterator = modifiers.iterator();
|
||||
|
||||
//Speed past all initial annotations
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ public final class MethodCountCheck extends Check {
|
|||
* Increments to counter by one for the supplied scope.
|
||||
* @param scope the scope counter to increment.
|
||||
*/
|
||||
void increment(Scope scope) {
|
||||
private void increment(Scope scope) {
|
||||
total++;
|
||||
if (inInterface) {
|
||||
counts.put(Scope.PUBLIC, 1 + value(Scope.PUBLIC));
|
||||
|
|
@ -249,7 +249,7 @@ public final class MethodCountCheck extends Check {
|
|||
* @param scope the scope counter to get the value of
|
||||
* @return the value of a scope counter
|
||||
*/
|
||||
int value(Scope scope) {
|
||||
private int value(Scope scope) {
|
||||
final Integer value = counts.get(scope);
|
||||
|
||||
if (value == null) {
|
||||
|
|
@ -263,7 +263,7 @@ public final class MethodCountCheck extends Check {
|
|||
/**
|
||||
* @return the total number of methods.
|
||||
*/
|
||||
int getTotal() {
|
||||
private int getTotal() {
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue