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

The following examples show how to use com.puppycrawl.tools.checkstyle.api.TokenTypes#ASSIGN . 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: SpringNoThisCheck.java    From spring-javaformat with Apache License 2.0 5 votes vote down vote up
private void visitIdent(DetailAST ast) {
	String name = ast.getText();
	if (this.names.contains(name)) {
		DetailAST sibling = ast.getPreviousSibling();
		if (sibling != null && sibling.getType() == TokenTypes.LITERAL_THIS) {
			DetailAST parent = getFirstNonDotParent(ast);
			if (!(this.allowAssignement && parent != null && parent.getType() == TokenTypes.ASSIGN)) {
				log(ast.getLineNo(), ast.getColumnNo(), "nothis.unexpected", name);
			}
		}
	}
}