Class SynchronizedHandler

    • Field Detail

      • methodModifier

        private final boolean methodModifier
        Determine that "synchronized" token used as modifier of method.
    • Constructor Detail

      • SynchronizedHandler

        public SynchronizedHandler​(IndentationCheck indentCheck,
                                   DetailAST ast,
                                   AbstractExpressionHandler parent)
        Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler.
        Parameters:
        indentCheck - the indentation check
        ast - the abstract syntax tree
        parent - the parent handler
    • Method Detail

      • checkSynchronizedExpr

        private void checkSynchronizedExpr()
        Check indentation of expression we synchronized on.
      • isMethodModifier

        private static boolean isMethodModifier​(DetailAST ast)
        Checks if given synchronized is modifier of method.
        Parameters:
        ast - synchronized(TokenTypes.LITERAL_SYNCHRONIZED) to check
        Returns:
        true if synchronized only modifies method
      • getSynchronizedStatementRightParen

        private static DetailAST getSynchronizedStatementRightParen​(DetailAST syncStatementAST)
        Returns right parenthesis of synchronized statement.
        Parameters:
        syncStatementAST - ast node(TokenTypes.LITERAL_SYNCHRONIZED)
        Returns:
        right parenthesis of synchronized statement.