gpt4 book ai didi

org.sonar.plugins.java.api.tree.WhileStatementTree.statement()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 14:33:05 26 4
gpt4 key购买 nike

本文整理了Java中org.sonar.plugins.java.api.tree.WhileStatementTree.statement()方法的一些代码示例,展示了WhileStatementTree.statement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhileStatementTree.statement()方法的具体详情如下:
包路径:org.sonar.plugins.java.api.tree.WhileStatementTree
类名称:WhileStatementTree
方法名:statement

WhileStatementTree.statement介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 scan(tree.statement());
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 scan(tree.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) {
 checkBlock(tree.closeParenToken(), tree.statement());
 super.visitWhileStatement(tree);
}

代码示例来源: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: org.codehaus.sonar-plugins.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 scan(tree.condition());
 visitStatement(tree.statement());
}

代码示例来源:origin: org.sonarsource.java/java-squid

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 scan(tree.condition());
 scan(tree.statement());
}

代码示例来源: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-frontend

@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: org.sonarsource.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 checkBlock(tree.closeParenToken(), tree.statement());
 super.visitWhileStatement(tree);
}

代码示例来源:origin: Cognifide/AEM-Rules-for-SonarQube

@Override
public void visitWhileStatement(WhileStatementTree tree) {
  checkModelProviderInLoop(tree, tree.condition(), tree.statement());
  super.visitWhileStatement(tree);
}

代码示例来源:origin: org.codehaus.sonar-plugins.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 ConditionalState conditionalState = visitCondition(tree.condition());
 Set<VariableSymbol> assignedVariables = new AssignmentVisitor().findAssignedVariables(tree.statement());
 currentState = conditionalState.trueState;
 currentState.invalidateVariables(assignedVariables);
 scan(tree.statement());
 restorePreviousState();
 currentState.invalidateVariables(assignedVariables);
}

代码示例来源:origin: SonarSource/sonar-java

private void buildWhileStatement(WhileStatementTree whileStatement) {
 Block falseBranch = currentBlock;
 Block loopback = createBlock();
 // process body
 currentBlock = createBlock(loopback);
 addContinueTarget(loopback);
 breakTargets.addLast(falseBranch);
 build(whileStatement.statement());
 breakTargets.removeLast();
 continueTargets.removeLast();
 Block bodyBlock = currentBlock;
 // process condition
 currentBlock = createBranch(whileStatement, bodyBlock, falseBranch);
 buildCondition(whileStatement.condition(), bodyBlock, falseBranch);
 loopback.addSuccessor(currentBlock);
 currentBlock = createBlock(currentBlock);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 super.visitWhileStatement(tree);
 checkForReport(tree.statement(), tree.whileKeyword(), tree.closeParenToken(), tree.whileKeyword().text());
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 super.visitWhileStatement(tree);
 checkForReport(tree.statement(), tree.whileKeyword(), tree.closeParenToken(), tree.whileKeyword().text());
}

代码示例来源:origin: org.codehaus.sonar-plugins.java/java-checks

@Override
public void visitWhileStatement(WhileStatementTree tree) {
 Set<Symbol.VariableSymbol> assignedSymbols = extractor.findAssignedVariables(tree);
 invalidateAssignedVariables(assignedSymbols);
 PackedStatementStates nextStates = PackedStatementStates.instantiate();
 for (ExecutionState state : currentStates) {
  PackedStates conditionStates = evaluateCondition(state, tree.condition());
  PackedStatementStates loopStates = evaluateStatement(conditionStates.trueStates, tree.statement());
  if (!conditionStates.falseStates.isEmpty() || !loopStates.isEmpty()) {
   state.mergeRelations(Iterables.concat(conditionStates.falseStates, loopStates));
   nextStates.addState(state);
  }
 }
 currentStates = nextStates;
 invalidateAssignedVariables(assignedSymbols);
}

代码示例来源: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: org.codehaus.sonar-plugins.java/java-checks

private 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: org.sonarsource.java/java-checks

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;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com