larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/internal/connection/RealConnectionPool.java
private int pruneAndGetAllocationCount(RealConnection connection, long now) {
    List<Reference<Transmitter>> references = connection.transmitters;
    for (int i = 0; i < references.size(); ) {
      Reference<Transmitter> reference = references.get(i);

      if (reference.get() != null) {
        i++;
        continue;
      }

      // We've discovered a leaked transmitter. This is an application bug.
      TransmitterReference transmitterRef = (TransmitterReference) reference;
      String message = "A connection to " + connection.route().address().url()
          + " was leaked. Did you forget to close a response body?";
      Platform.get().logCloseableLeak(message, transmitterRef.callStackTrace);

      references.remove(i);
      connection.noNewExchanges = true;

      // If this was the last allocation, the connection is eligible for immediate eviction.
      if (references.isEmpty()) {
        connection.idleAtNanos = now - keepAliveDurationNs;
        return 0;
      }
    }

    return references.size();
  }
/**
   * Prunes any leaked transmitters and then returns the number of remaining live transmitters on
   * {@code connection}. Transmitters are leaked if the connection is tracking them but the
   * application code has abandoned them. Leak detection is imprecise and relies on garbage
   * collection.
   */
Prunes any leaked transmitters and then returns the number of remaining live transmitters on
connection. Transmitters are leaked if the connection is tracking them but the
application code has abandoned them. Leak detection is imprecise and relies on garbage
collection.
Prunes any leaked transmitters and then returns the number of remaining live transmitters on connection . Transmitters are leaked if the connection is tracking them but the application code has abandoned them . Leak detection is imprecise and relies on garbage collection .
private int pruneAndGetAllocationCount(RealConnection connection, long now) {
    List<Reference<Transmitter>> references = connection.transmitters;
    for (int i = 0; i < references.size(); ) {
      Reference<Transmitter> reference = references.get(i);
      if (reference.get() != null) {
        i++;
        continue;
      }
      TransmitterReference transmitterRef = (TransmitterReference) reference;
      String message = "A connection to " + connection.route().address().url()
          + " was leaked. Did you forget to close a response body?";
      Platform.get().logCloseableLeak(message, transmitterRef.callStackTrace);
      references.remove(i);
      connection.noNewExchanges = true;
      if (references.isEmpty()) {
        connection.idleAtNanos = now - keepAliveDurationNs;
        return 0;
      }
    }
    return references.size();
  }
private int pruneAndGetAllocationCount ( RealConnection connection , long now ) { List < Reference < Transmitter > > references = connection . transmitters ; for ( int i = 0 ; i < references . size ( ) ; ) { Reference < Transmitter > reference = references . get ( i ) ; if ( reference . get ( ) != null ) { i ++ ; continue ; } TransmitterReference transmitterRef = ( TransmitterReference ) reference ; String message = "A connection to " + connection . route ( ) . address ( ) . url ( ) + " was leaked. Did you forget to close a response body?" ; Platform . get ( ) . logCloseableLeak ( message , transmitterRef . callStackTrace ) ; references . remove ( i ) ; connection . noNewExchanges = true ; if ( references . isEmpty ( ) ) { connection . idleAtNanos = now - keepAliveDurationNs ; return 0 ; } } return references . size ( ) ; }
Prunes any leaked transmitters and then returns the number of remaining live transmitters on
 {@code connection}.
Prunes any leaked transmitters and then returns the number of remaining live transmitters on { @code connection } .
// We've discovered a leaked transmitter. This is an application bug. // If this was the last allocation, the connection is eligible for immediate eviction.