コード例 #1
0
 public void visitWhileStatement(GrWhileStatement whileStatement) {
   if (myExpression.equals(whileStatement.getCondition())) {
     myResult =
         new TypeConstraint[] {
           new SubtypeConstraint(TypesUtil.getJavaLangObject(whileStatement), PsiType.BOOLEAN)
         };
   }
 }
コード例 #2
0
 public void visitWhileStatement(GrWhileStatement whileStatement) {
   final InstructionImpl instruction = startNode(whileStatement);
   final GrCondition condition = whileStatement.getCondition();
   if (condition != null) {
     condition.accept(this);
   }
   if (!alwaysTrue(condition)) {
     addPendingEdge(whileStatement, myHead); // break
   }
   final GrCondition body = whileStatement.getBody();
   if (body != null) {
     body.accept(this);
   }
   checkPending(instruction); // check for breaks targeted here
   if (myHead != null) addEdge(myHead, instruction); // loop
   interruptFlow();
   finishNode(instruction);
 }