public static boolean isLocallyBoundLoop(PsiExpression loopCondition) {
      loopCondition = PsiUtil.skipParenthesizedExprDown(loopCondition);
      if (loopCondition == null) return false;
      if (ExpressionUtils.computeConstantExpression(loopCondition) == null && ExpressionUtils.isLocallyDefinedExpression(loopCondition)) {
        return true;
      }
      if (loopCondition instanceof PsiPolyadicExpression && ((PsiPolyadicExpression)loopCondition).getOperationTokenType().equals(
        JavaTokenType.ANDAND)) {
        for (PsiExpression operand : ((PsiPolyadicExpression)loopCondition).getOperands()) {
          if (isCounterCondition(operand)) {
            return true;
          }
        }
      }
      return false;
    }
public static boolean isLocallyBoundLoop(PsiExpression loopCondition)