コード例 #1
0
ファイル: CFG.java プロジェクト: SonarSource/ruling_java
 private void buildReturnStatement(ReturnStatementTree tree) {
   ReturnStatementTree s = tree;
   currentBlock = createUnconditionalJump(s, exitBlock);
   ExpressionTree expression = s.expression();
   if (expression != null) {
     build(expression);
   }
 }
コード例 #2
0
 @Override
 public void visitReturnStatement(ReturnStatementTree tree) {
   ExpressionTree expression = tree.expression();
   if (expression == null || !isIncrementOrDecrement(expression)) {
     scan(expression);
   }
 }
コード例 #3
0
 @Override
 public void visitReturnStatement(ReturnStatementTree syntaxNode) {
   SymbolicValue currentVal = programState.peekValue();
   if (currentVal != null) {
     final ExpressionTree expression = syntaxNode.expression();
     if (expression != null) {
       if (expression.is(Tree.Kind.IDENTIFIER)) {
         final IdentifierTree identifier = (IdentifierTree) expression;
         currentVal = programState.getValue(identifier.symbol());
       } else {
         currentVal = programState.peekValue();
       }
       programState = closeResource(programState, currentVal);
     }
   }
 }