Java Code Examples for com.puppycrawl.tools.checkstyle.api.TokenTypes#LITERAL_ASSERT

The following examples show how to use com.puppycrawl.tools.checkstyle.api.TokenTypes#LITERAL_ASSERT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Resolver.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * processes a <code>BlockDef</code> and resolves references in it
 *
 * @param block the <code>BlockDef</code> to process
 */
protected void handleBlock(BlockDef block) {
    SymTabAST node = block.getTreeNode();

    switch (node.getType()) {

        case TokenTypes.LITERAL_FOR :
            handleFor(block);
            break;

        case TokenTypes.LITERAL_IF :
            handleIf(block);
            break;

        case TokenTypes.LITERAL_WHILE :
            handleWhileAndSynchronized(block);
            break;

        case TokenTypes.LITERAL_DO :
            handleDoWhile(block);
            break;

        case TokenTypes.LITERAL_TRY :
        case TokenTypes.LITERAL_FINALLY :
            SymTabAST slist = node.findFirstToken(TokenTypes.SLIST);

            handleSList(slist, block);
            break;

        case TokenTypes.LITERAL_CATCH :
            handleCatch(block);
            break;

        case TokenTypes.LITERAL_SWITCH :
            handleSwitch(block);
            break;

        case TokenTypes.SLIST :
            handleSList(node, block);
            break;

        case TokenTypes.EXPR :
            resolveExpression(node, block, null, true);
            break;

        case TokenTypes.INSTANCE_INIT :
        case TokenTypes.STATIC_INIT :
            handleSList((SymTabAST) node.getFirstChild(), block);
            break;

        case TokenTypes.LITERAL_SYNCHRONIZED :
            handleWhileAndSynchronized(block);
            break;

        case TokenTypes.LITERAL_ASSERT :
            handleAssert(block);
            break;

        default :
            if (mInitialized) {
                final Log log = mLogFactory.getInstance(this.getClass());
                log.error(
                    "Unhandled block "
                        + block
                        + " of type "
                        + node.getType());
            }
    }
}
 
Example 2
Source File: Resolver.java    From contribution with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * processes a <code>BlockDef</code> and resolves references in it
 *
 * @param block the <code>BlockDef</code> to process
 */
protected void handleBlock(BlockDef block) {
    SymTabAST node = block.getTreeNode();

    switch (node.getType()) {

        case TokenTypes.LITERAL_FOR :
            handleFor(block);
            break;

        case TokenTypes.LITERAL_IF :
            handleIf(block);
            break;

        case TokenTypes.LITERAL_WHILE :
            handleWhileAndSynchronized(block);
            break;

        case TokenTypes.LITERAL_DO :
            handleDoWhile(block);
            break;

        case TokenTypes.LITERAL_TRY :
        case TokenTypes.LITERAL_FINALLY :
            SymTabAST slist = node.findFirstToken(TokenTypes.SLIST);

            handleSList(slist, block);
            break;

        case TokenTypes.LITERAL_CATCH :
            handleCatch(block);
            break;

        case TokenTypes.LITERAL_SWITCH :
            handleSwitch(block);
            break;

        case TokenTypes.SLIST :
            handleSList(node, block);
            break;

        case TokenTypes.EXPR :
            resolveExpression(node, block, null, true);
            break;

        case TokenTypes.INSTANCE_INIT :
        case TokenTypes.STATIC_INIT :
            handleSList((SymTabAST) node.getFirstChild(), block);
            break;

        case TokenTypes.LITERAL_SYNCHRONIZED :
            handleWhileAndSynchronized(block);
            break;

        case TokenTypes.LITERAL_ASSERT :
            handleAssert(block);
            break;

        default :
            if (mInitialized) {
                final Log log = mLogFactory.getInstance(this.getClass());
                log.error(
                    "Unhandled block "
                        + block
                        + " of type "
                        + node.getType());
            }
    }
}