public static List<Response> executeConnectionAndWait(HttpURLConnection connection,RequestBatch requests){
  List<Response> responses=Response.fromHttpConnection(connection,requests);
  Utility.disconnectQuietly(connection);
  int numRequests=requests.size();
  if (numRequests != responses.size()) {
    throw new FacebookException(String.format("Received %d responses while expecting %d",responses.size(),numRequests));
  }
  runCallbacks(requests,responses);
  HashSet<Session> sessions=new HashSet<Session>();
  for (  Request request : requests) {
    if (request.session != null) {
      sessions.add(request.session);
    }
  }
  for (  Session session : sessions) {
    session.extendAccessTokenIfNeeded();
  }
  return responses;
}

public static List < Response > executeConnectionAndWait ( HttpURLConnection connection , RequestBatch requests ) { List < Response > responses = Response . fromHttpConnection ( connection , requests ) ; Utility . disconnectQuietly ( connection ) ; int numRequests = requests . size ( ) ; if ( numRequests != responses . size ( ) ) { throw new FacebookException ( String . format ( "Received %d responses while expecting %d" , responses . size ( ) , numRequests ) ) ; } runCallbacks ( requests , responses ) ; HashSet < Session > sessions = new HashSet < Session > ( ) ; for ( Request request : requests ) { if ( request . session != null ) { sessions . add ( request . session ) ; } } for ( Session session : sessions ) { session . extendAccessTokenIfNeeded ( ) ; } return responses ; }
executes requests that have already been serialized into an httpurlconnection . no validation is done that the contents of the connection actually reflect the serialized requests , so it is the caller ' s responsibility to ensure that it will correctly generate the desired responses . < p / > this should only be called if you have transitioned off the ui thread .
