Class ReturnCountCheck.Context
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.Context
-
- Enclosing class:
- ReturnCountCheck
private class ReturnCountCheck.Context extends java.lang.ObjectClass to encapsulate information about one method.
-
-
Field Summary
Fields Modifier and Type Field Description private booleancheckingWhether we should check this method or not.private intcountCounter for return statements.private java.lang.IntegermaxAllowedMaximum allowed number of return statements.
-
Constructor Summary
Constructors Constructor Description Context(boolean checking)Creates new method context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckCount(DetailAST ast)Checks if number of return statements in the method are more than allowed.voidvisitLiteralReturn(int maxAssigned)Increase the number of return statements.
-
-
-
Method Detail
-
visitLiteralReturn
public void visitLiteralReturn(int maxAssigned)
Increase the number of return statements.- Parameters:
maxAssigned- Maximum allowed number of return statements.
-
checkCount
public void checkCount(DetailAST ast)
Checks if number of return statements in the method are more than allowed.- Parameters:
ast- method def associated with this context.
-
-