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 boolean |
isVoidContext
Identifies if context is void.
|
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,
java.lang.Boolean voidReturn)
Increase the number of return statements and set context return type.
|
private final boolean checking
private int count
private java.lang.Integer maxAllowed
private boolean isVoidContext
Context(boolean checking)
checking - should we check this method or not.public void visitLiteralReturn(int maxAssigned, java.lang.Boolean voidReturn)
maxAssigned - Maximum allowed number of return statements.voidReturn - Identifies if context is void.public void checkCount(DetailAST ast)
ast - method def associated with this context.Copyright © 2001-2022. All Rights Reserved.