- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.sonar.plugins.java.api.tree.WhileStatementTree
类的一些代码示例,展示了WhileStatementTree
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhileStatementTree
类的具体详情如下:
包路径:org.sonar.plugins.java.api.tree.WhileStatementTree
类名称:WhileStatementTree
[英]'while' statement. JLS 14.12
while (
#condition())
#statement
[中]“while”声明。JLS 14.12
while (
#condition())
#statement
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
scan(tree.condition());
scan(tree.statement());
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
// do not scan the condition
addLines(tree.whileKeyword(), tree.closeParenToken());
addLineOfCloseBrace(tree.whileKeyword(), tree.statement());
scan(tree.statement());
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
blame.add(tree.firstToken());
super.visitWhileStatement(tree);
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
checkBlock(tree.closeParenToken(), tree.statement());
super.visitWhileStatement(tree);
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
scan(tree.statement());
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
if (LiteralUtils.isTrue(tree.condition())) {
checkLoopWithAlwaysTrueCondition(context, tree);
}
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitNode(Tree tree) {
switch (tree.kind()) {
case WHILE_STATEMENT:
WhileStatementTree whileStatementTree = (WhileStatementTree) tree;
checkStatement(whileStatementTree.whileKeyword(), whileStatementTree.statement());
break;
case DO_STATEMENT:
DoWhileStatementTree doWhileStatementTree = (DoWhileStatementTree) tree;
checkStatement(doWhileStatementTree.doKeyword(), doWhileStatementTree.statement());
break;
case FOR_STATEMENT:
ForStatementTree forStatementTree = (ForStatementTree) tree;
checkStatement(forStatementTree.forKeyword(), forStatementTree.statement());
break;
case FOR_EACH_STATEMENT:
ForEachStatement forEachStatement = (ForEachStatement) tree;
checkStatement(forEachStatement.forKeyword(), forEachStatement.statement());
break;
case IF_STATEMENT:
checkIfStatement((IfStatementTree) tree);
break;
default:
break;
}
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
SyntaxToken whileKeyword = tree.whileKeyword();
checkNesting(whileKeyword);
nestingLevel.push(whileKeyword);
super.visitWhileStatement(tree);
nestingLevel.pop();
}
代码示例来源:origin: org.sonarsource.java/java-checks
@Override
public void visitWhileStatement(WhileStatementTree tree) {
scan(tree.statement());
}
代码示例来源:origin: org.sonarsource.java/java-frontend
@Override
public void visitWhileStatement(WhileStatementTree tree) {
if (LiteralUtils.isTrue(tree.condition())) {
checkLoopWithAlwaysTrueCondition(context, tree);
}
}
代码示例来源:origin: org.sonarsource.java/java-checks
@Override
public void visitNode(Tree tree) {
switch (tree.kind()) {
case WHILE_STATEMENT:
WhileStatementTree whileStatementTree = (WhileStatementTree) tree;
checkStatement(whileStatementTree.whileKeyword(), whileStatementTree.statement());
break;
case DO_STATEMENT:
DoWhileStatementTree doWhileStatementTree = (DoWhileStatementTree) tree;
checkStatement(doWhileStatementTree.doKeyword(), doWhileStatementTree.statement());
break;
case FOR_STATEMENT:
ForStatementTree forStatementTree = (ForStatementTree) tree;
checkStatement(forStatementTree.forKeyword(), forStatementTree.statement());
break;
case FOR_EACH_STATEMENT:
ForEachStatement forEachStatement = (ForEachStatement) tree;
checkStatement(forEachStatement.forKeyword(), forEachStatement.statement());
break;
case IF_STATEMENT:
checkIfStatement((IfStatementTree) tree);
break;
default:
break;
}
}
代码示例来源:origin: org.sonarsource.java/java-checks
@Override
public void visitWhileStatement(WhileStatementTree tree) {
checkBlock(tree.closeParenToken(), tree.statement());
super.visitWhileStatement(tree);
}
代码示例来源:origin: org.sonarsource.java/java-checks
@Override
public void visitWhileStatement(WhileStatementTree tree) {
SyntaxToken whileKeyword = tree.whileKeyword();
checkNesting(whileKeyword);
nestingLevel.push(whileKeyword);
super.visitWhileStatement(tree);
nestingLevel.pop();
}
代码示例来源:origin: org.codehaus.sonar-plugins.java/java-squid
@Override
public void visitWhileStatement(WhileStatementTree tree) {
scan(tree.condition());
scan(tree.statement());
}
代码示例来源:origin: org.sonarsource.java/java-checks
@Override
public void visitWhileStatement(WhileStatementTree tree) {
// do not scan the condition
addLines(tree.whileKeyword(), tree.closeParenToken());
addLineOfCloseBrace(tree.whileKeyword(), tree.statement());
scan(tree.statement());
}
代码示例来源:origin: SonarSource/sonar-java
private static Tree loopStatement(Tree loopTree) {
if (loopTree.is(Tree.Kind.FOR_STATEMENT)) {
return ((ForStatementTree) loopTree).statement();
} else if (loopTree.is(Tree.Kind.DO_STATEMENT)) {
return ((DoWhileStatementTree) loopTree).statement();
} else if (loopTree.is(Tree.Kind.WHILE_STATEMENT)) {
return ((WhileStatementTree) loopTree).statement();
} else if (loopTree.is(Tree.Kind.FOR_EACH_STATEMENT)) {
return ((ForEachStatement) loopTree).statement();
}
return null;
}
代码示例来源:origin: SonarSource/sonar-java
/**
* While loops are sometimes used to get only the first element of an enumeration/collection, using code similar to:
* <code>
* while(myIterator.hasNext()) {
* // ...
* return myIterator.next(); // unconditional jump
* }
* </code>
*/
private static boolean isWhileNextElementLoop(Tree loopTree) {
if (loopTree.is(Tree.Kind.WHILE_STATEMENT)) {
ExpressionTree condition = ExpressionUtils.skipParentheses(((WhileStatementTree) loopTree).condition());
return condition.is(Tree.Kind.METHOD_INVOCATION) && NEXT_ELEMENT.anyMatch((MethodInvocationTree) condition);
}
return false;
}
代码示例来源:origin: DarLiner/vjtools
@Override
public void visitNode(Tree tree) {
switch (tree.kind()) {
case WHILE_STATEMENT:
WhileStatementTree whileStatementTree = (WhileStatementTree) tree;
checkStatement(whileStatementTree.whileKeyword(), whileStatementTree.statement());
break;
case DO_STATEMENT:
DoWhileStatementTree doWhileStatementTree = (DoWhileStatementTree) tree;
checkStatement(doWhileStatementTree.doKeyword(), doWhileStatementTree.statement());
break;
case FOR_STATEMENT:
ForStatementTree forStatementTree = (ForStatementTree) tree;
checkStatement(forStatementTree.forKeyword(), forStatementTree.statement());
break;
case FOR_EACH_STATEMENT:
ForEachStatement forEachStatement = (ForEachStatement) tree;
checkStatement(forEachStatement.forKeyword(), forEachStatement.statement());
break;
case IF_STATEMENT:
checkIfStatement((IfStatementTree) tree);
break;
default:
break;
}
}
代码示例来源:origin: SonarSource/sonar-java
@Override
public void visitWhileStatement(WhileStatementTree tree) {
increaseComplexityByNesting(tree.whileKeyword());
nesting++;
super.visitWhileStatement(tree);
nesting--;
}
代码示例来源:origin: org.sonarsource.java/java-frontend
@Override
public void visitWhileStatement(WhileStatementTree tree) {
blame.add(tree.firstToken());
super.visitWhileStatement(tree);
}
本文整理了Java中org.sonar.plugins.java.api.tree.WhileStatementTree.statement()方法的一些代码示例,展示了WhileStatementT
本文整理了Java中org.sonar.plugins.java.api.tree.WhileStatementTree.whileKeyword()方法的一些代码示例,展示了WhileStateme
本文整理了Java中org.sonar.plugins.java.api.tree.WhileStatementTree.condition()方法的一些代码示例,展示了WhileStatementT
我是一名优秀的程序员,十分优秀!