@Override
 public boolean isValueCompatible() {
   final PsiElement body = getBody();
   if (body != null) {
     try {
       final ControlFlow controlFlow =
           ControlFlowFactory.getInstance(getProject())
               .getControlFlow(
                   body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
       if (ControlFlowUtil.findExitPointsAndStatements(
               controlFlow,
               0,
               controlFlow.getSize(),
               new IntArrayList(),
               PsiReturnStatement.class,
               PsiThrowStatement.class)
           .isEmpty()) {
         return false;
       }
     } catch (AnalysisCanceledException e) {
       return true;
     }
   }
   return true;
 }
  public Collection<PsiStatement> prepareExitStatements(
      final @NotNull PsiElement[] elements, final @NotNull PsiElement enclosingCodeFragment)
      throws ExitStatementsNotSameException {
    myExitPoints = new IntArrayList();
    myExitStatements =
        ControlFlowUtil.findExitPointsAndStatements(
            myControlFlow,
            myFlowStart,
            myFlowEnd,
            myExitPoints,
            ControlFlowUtil.DEFAULT_EXIT_STATEMENTS_CLASSES);
    if (ControlFlowUtil.hasObservableThrowExitPoints(
        myControlFlow, myFlowStart, myFlowEnd, elements, enclosingCodeFragment)) {
      throw new ExitStatementsNotSameException();
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("exit points:");
      for (int i = 0; i < myExitPoints.size(); i++) {
        LOG.debug("  " + myExitPoints.get(i));
      }
      LOG.debug("exit statements:");
      for (PsiStatement exitStatement : myExitStatements) {
        LOG.debug("  " + exitStatement);
      }
    }
    if (myExitPoints.isEmpty()) {
      // if the fragment never exits assume as if it exits in the end
      myExitPoints.add(myControlFlow.getEndOffset(elements[elements.length - 1]));
    }

    if (myExitPoints.size() != 1) {
      myGenerateConditionalExit = true;
      areExitStatementsTheSame();
    }
    return myExitStatements;
  }