Class SynchronizedHandler
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler
com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler
com.puppycrawl.tools.checkstyle.checks.indentation.SynchronizedHandler
Handler for synchronized statements.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
Determine that "synchronized" token used as modifier of method. -
Constructor Summary
ConstructorDescriptionSynchronizedHandler
(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check the indentation of the expression we are handling.private void
Check indentation of expression we synchronized on.private static DetailAST
getSynchronizedStatementRightParen
(DetailAST syncStatementAST) Returns right parenthesis of synchronized statement.private static boolean
Checks if given synchronized is modifier of method.Methods inherited from class com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler
canChildrenBeNested, checkTopLevelToken, curlyIndent, getCheckedChildren, getChildrenExpectedIndent, getLeftCurly, getListChild, getNonListChild, getRightCurly, getSuggestedChildIndent, getTopLevelAst
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler
checkChildren, checkExpressionSubtree, checkLeftParen, checkModifiers, checkRightParen, checkWrappingIndentation, checkWrappingIndentation, expandedTabsColumnNo, findSubtreeAst, getBasicOffset, getBraceAdjustment, getFirstAstNode, getFirstLine, getFirstToken, getIndent, getIndentCheck, getIndentImpl, getLineStart, getLineStart, getMainAst, getParent, isOnStartOfLine, logError, logError, shouldIncreaseIndent
-
Field Details
-
methodModifier
Determine that "synchronized" token used as modifier of method.
-
-
Constructor Details
-
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 checkast
- the abstract syntax treeparent
- the parent handler
-
-
Method Details
-
checkIndentation
Description copied from class:AbstractExpressionHandler
Check the indentation of the expression we are handling.- Overrides:
checkIndentation
in classBlockParentHandler
-
checkSynchronizedExpr
Check indentation of expression we synchronized on. -
isMethodModifier
Checks if given synchronized is modifier of method.- Parameters:
ast
- synchronized(TokenTypes.LITERAL_SYNCHRONIZED) to check- Returns:
- true if synchronized only modifies method
-
getSynchronizedStatementRightParen
Returns right parenthesis of synchronized statement.- Parameters:
syncStatementAST
- ast node(TokenTypes.LITERAL_SYNCHRONIZED)- Returns:
- right parenthesis of synchronized statement.
-