public static class AssertStatementCreationUtility.AddAssertionCallStatementToReturnStatementVisitor
extends ClassCodeVisitorSupport
Replaces a given ReturnStatement with the appropriate assertion call statement and returns a result variable expression.
| Constructor and description |
|---|
AddAssertionCallStatementToReturnStatementVisitor(ReturnStatement returnStatement, Statement assertionCallStatement)Creates a visitor that rewrites one return statement to execute an assertion call before returning. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected SourceUnit |
getSourceUnit()This visitor is source-independent. |
|
public void |
visitBlockStatement(BlockStatement block)Rewrites the block containing the target return statement. |
Creates a visitor that rewrites one return statement to execute an assertion call before returning.
returnStatement - the return statement to replaceassertionCallStatement - the assertion statement to insertThis visitor is source-independent.
nullRewrites the block containing the target return statement.
block - the block being visitedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.