private class ReturnCountCheck.Context
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
checking
Whether we should check this method or not.
|
private int |
count
Counter for return statements.
|
private java.lang.Integer |
maxAllowed
Maximum allowed number of return statements.
|
Constructor and Description |
---|
Context(boolean checking)
Creates new method context.
|
Modifier and Type | Method and Description |
---|---|
void |
checkCount(DetailAST ast)
Checks if number of return statements in the method are more
than allowed.
|
void |
visitLiteralReturn(int maxAssigned)
Increase the number of return statements.
|
private final boolean checking
private int count
private java.lang.Integer maxAllowed
Context(boolean checking)
checking
- should we check this method or not.public void visitLiteralReturn(int maxAssigned)
maxAssigned
- Maximum allowed number of return statements.public void checkCount(DetailAST ast)
ast
- method def associated with this context.