Source:
DefaultDockerClient(final Builder builder, Supplier<ClientBuilder> clientBuilderSupplier) { final URI originalUri = checkNotNull(builder.uri, "uri"); this.apiVersion = builder.apiVersion(); if ((builder.dockerCertificatesStore != null) && !originalUri.getScheme().equals("https")) { throw new IllegalArgumentException( "An HTTPS URI for DOCKER_HOST must be provided to use Docker client certificates"); } if (originalUri.getScheme().equals(UNIX_SCHEME)) { this.uri = UnixConnectionSocketFactory.sanitizeUri(originalUri); } else { this.uri = originalUri; } final PoolingHttpClientConnectionManager cm = getConnectionManager(builder); final PoolingHttpClientConnectionManager noTimeoutCm = getConnectionManager(builder); final RequestConfig requestConfig = RequestConfig.custom() .setConnectionRequestTimeout((int) builder.connectTimeoutMillis) .setConnectTimeout((int) builder.connectTimeoutMillis) .setSocketTimeout((int) builder.readTimeoutMillis) .build(); final ClientConfig config = DEFAULT_CONFIG .connectorProvider(new ApacheConnectorProvider()) .property(ApacheClientProperties.CONNECTION_MANAGER, cm) .property(ApacheClientProperties.REQUEST_CONFIG, requestConfig); this.registryAuthSupplier = builder.registryAuthSupplier; if (this.registryAuthSupplier == null) { this.registryAuthSupplier = new NoOpRegistryAuthSupplier(null); } this.client = clientBuilderSupplier.get().withConfig(config).build(); final RequestConfig noReadTimeoutRequestConfig = RequestConfig.copy(requestConfig) .setSocketTimeout((int) NO_TIMEOUT) .build(); this.noTimeoutClient = clientBuilderSupplier.get() .withConfig(config) .property(ApacheClientProperties.CONNECTION_MANAGER, noTimeoutCm) .property(ApacheClientProperties.REQUEST_CONFIG, noReadTimeoutRequestConfig) .build(); this.headers = new HashMap<>(builder.headers()); }

Target:
DefaultDockerClient(final Builder builder, Supplier<ClientBuilder> clientBuilderSupplier) { final URI originalUri = checkNotNull(builder.uri, "uri"); this.apiVersion = builder.apiVersion(); if ((builder.dockerCertificatesStore != null) && !originalUri.getScheme().equals("https")) { throw new IllegalArgumentException( "An HTTPS URI for DOCKER_HOST must be provided to use Docker client certificates"); } if (originalUri.getScheme().equals(UNIX_SCHEME)) { this.uri = UnixConnectionSocketFactory.sanitizeUri(originalUri); } else { this.uri = originalUri; } final PoolingHttpClientConnectionManager cm = getConnectionManager(builder); final PoolingHttpClientConnectionManager noTimeoutCm = getConnectionManager(builder); final RequestConfig requestConfig = RequestConfig.custom() .setConnectionRequestTimeout((int) builder.connectTimeoutMillis) .setConnectTimeout((int) builder.connectTimeoutMillis) .setSocketTimeout((int) builder.readTimeoutMillis) .build(); final ClientConfig config = DEFAULT_CONFIG .connectorProvider(new ApacheConnectorProvider()) .property(ApacheClientProperties.CONNECTION_MANAGER, cm) .property(ApacheClientProperties.REQUEST_CONFIG, requestConfig); if (builder.registryAuthSupplier == null) { this.registryAuthSupplier = new NoOpRegistryAuthSupplier(null); } else { this.registryAuthSupplier = builder.registryAuthSupplier; } this.client = clientBuilderSupplier.get().withConfig(config).build(); final RequestConfig noReadTimeoutRequestConfig = RequestConfig.copy(requestConfig) .setSocketTimeout((int) NO_TIMEOUT) .build(); this.noTimeoutClient = clientBuilderSupplier.get() .withConfig(config) .property(ApacheClientProperties.CONNECTION_MANAGER, noTimeoutCm) .property(ApacheClientProperties.REQUEST_CONFIG, noReadTimeoutRequestConfig) .build(); this.headers = new HashMap<>(builder.headers()); }