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
FieldsModifier and TypeFieldDescriptionprivate final booleanDetermine that "synchronized" token used as modifier of method. -
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedHandler(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 TypeMethodDescriptionvoidCheck the indentation of the expression we are handling.private voidCheck indentation of expression we synchronized on.private static DetailASTgetSynchronizedStatementRightParen(DetailAST syncStatementAST) Returns right parenthesis of synchronized statement.private static booleanChecks 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, getTopLevelAstMethods 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:AbstractExpressionHandlerCheck the indentation of the expression we are handling.- Overrides:
checkIndentationin 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.
-