Examples of branchContains()


Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);
        return (!isFinal && ScopeUtils.isLocalVariableDef(aAST));
    }
}
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);
        return (isFinal && ScopeUtils.isLocalVariableDef(aAST));
    }
}
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

    {
        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);

        if (aAST.getType() == TokenTypes.CLASS_DEF) {
            final boolean isFinal = (modifiers != null)
                    && modifiers.branchContains(TokenTypes.FINAL);
            final boolean isAbstract = (modifiers != null)
                    && modifiers.branchContains(TokenTypes.ABSTRACT);
            mClasses.push(new ClassDesc(isFinal, isAbstract));
        }
        else if (!ScopeUtils.inEnumBlock(aAST)) { //ctors in enums don't matter
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

        if (aAST.getType() == TokenTypes.CLASS_DEF) {
            final boolean isFinal = (modifiers != null)
                    && modifiers.branchContains(TokenTypes.FINAL);
            final boolean isAbstract = (modifiers != null)
                    && modifiers.branchContains(TokenTypes.ABSTRACT);
            mClasses.push(new ClassDesc(isFinal, isAbstract));
        }
        else if (!ScopeUtils.inEnumBlock(aAST)) { //ctors in enums don't matter
            final ClassDesc desc = mClasses.peek();
            if ((modifiers != null)
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

            mClasses.push(new ClassDesc(isFinal, isAbstract));
        }
        else if (!ScopeUtils.inEnumBlock(aAST)) { //ctors in enums don't matter
            final ClassDesc desc = mClasses.peek();
            if ((modifiers != null)
                && modifiers.branchContains(TokenTypes.LITERAL_PRIVATE))
            {
                desc.reportPrivateCtor();
            }
            else {
                desc.reportNonPrivateCtor();
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

            {
                hasMethodOrField = true;
                final DetailAST modifiers =
                    child.findFirstToken(TokenTypes.MODIFIERS);
                final boolean isStatic =
                    modifiers.branchContains(TokenTypes.LITERAL_STATIC);
                final boolean isPrivate =
                    modifiers.branchContains(TokenTypes.LITERAL_PRIVATE);

                if (!isStatic && !isPrivate) {
                    hasNonStaticMethodOrField = true;
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

                final DetailAST modifiers =
                    child.findFirstToken(TokenTypes.MODIFIERS);
                final boolean isStatic =
                    modifiers.branchContains(TokenTypes.LITERAL_STATIC);
                final boolean isPrivate =
                    modifiers.branchContains(TokenTypes.LITERAL_PRIVATE);

                if (!isStatic && !isPrivate) {
                    hasNonStaticMethodOrField = true;
                }
            }
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

        boolean retVal = false;

        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStatic = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.LITERAL_STATIC);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);

        if ((isStatic  && isFinal)
            || ScopeUtils.inInterfaceOrAnnotationBlock(aAST))
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

            }
            if (type == TokenTypes.CTOR_DEF) {
                hasDefaultCtor = false;
                final DetailAST modifiers =
                    child.findFirstToken(TokenTypes.MODIFIERS);
                if (!modifiers.branchContains(TokenTypes.LITERAL_PRIVATE)
                    && !modifiers.branchContains(TokenTypes.LITERAL_PROTECTED))
                {
                    // treat package visible as public
                    // for the purpose of this Check
                    hasPublicCtor = true;
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()

        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStatic = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.LITERAL_STATIC);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);

        if ((isStatic  && isFinal)
            || ScopeUtils.inInterfaceOrAnnotationBlock(aAST))
        {
            // Handle the serialVersionUID and serialPersistentFields  constants
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.