Source:
<code>public TDHttpClient(TDClientConfig config) { this.config = config; this.httpClient = config.useSSL ? new HttpClient(new SslContextFactory()) : new HttpClient(); httpClient.setConnectTimeout(config.connectTimeoutMillis); httpClient.setIdleTimeout(config.idleTimeoutMillis); httpClient.setTCPNoDelay(true); QueuedThreadPool executor = new QueuedThreadPool(config.connectionPoolSize, 2); executor.setDaemon(true); <START> executor.setName("td-client-java"); <END> httpClient.setExecutor(executor); httpClient.setScheduler(new ScheduledExecutorScheduler("td-client-java-scheduler", true)); httpClient.setCookieStore(new HttpCookieStore.Empty()); httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, "td-client-java-" + TDClient.getVersion())); if (config.proxy.isPresent()) { final ProxyConfig proxyConfig = config.proxy.get(); logger.trace("proxy configuration: " + proxyConfig); HttpProxy httpProxy = new HttpProxy(new Origin.Address(proxyConfig.getHost(), proxyConfig.getPort()), proxyConfig.useSSL()); httpProxy.getExcludedAddresses().add(proxyConfig.getHost() + ":" + proxyConfig.getPort()); httpClient.getProxyConfiguration().getProxies().add(httpProxy); if (proxyConfig.requireAuthentication()) { httpClient.getAuthenticationStore().addAuthenticationResult(new ProxyAuthResult(proxyConfig)); } } this.objectMapper = new ObjectMapper() .registerModule(new JsonOrgModule()) .registerModule(new GuavaModule()) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try { httpClient.start(); } catch (Exception e) { logger.error("Failed to initialize Jetty client", e); throw Throwables.propagate(e); } }</code><technical_language>td-client better</technical_language>

Target:
public TDHttpClient(TDClientConfig config) { this.config = config; this.httpClient = config.useSSL ? new HttpClient(new SslContextFactory()) : new HttpClient(); httpClient.setConnectTimeout(config.connectTimeoutMillis); httpClient.setIdleTimeout(config.idleTimeoutMillis); httpClient.setTCPNoDelay(true); QueuedThreadPool executor = new QueuedThreadPool(config.connectionPoolSize, 2); executor.setDaemon(true); executor.setName("td-client"); httpClient.setExecutor(executor); httpClient.setScheduler(new ScheduledExecutorScheduler("td-client-scheduler", true)); httpClient.setCookieStore(new HttpCookieStore.Empty()); httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, "td-client-java-" + TDClient.getVersion())); if (config.proxy.isPresent()) { final ProxyConfig proxyConfig = config.proxy.get(); logger.trace("proxy configuration: " + proxyConfig); HttpProxy httpProxy = new HttpProxy(new Origin.Address(proxyConfig.getHost(), proxyConfig.getPort()), proxyConfig.useSSL()); httpProxy.getExcludedAddresses().add(proxyConfig.getHost() + ":" + proxyConfig.getPort()); httpClient.getProxyConfiguration().getProxies().add(httpProxy); if (proxyConfig.requireAuthentication()) { httpClient.getAuthenticationStore().addAuthenticationResult(new ProxyAuthResult(proxyConfig)); } } this.objectMapper = new ObjectMapper() .registerModule(new JsonOrgModule()) .registerModule(new GuavaModule()) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try { httpClient.start(); } catch (Exception e) { logger.error("Failed to initialize Jetty client", e); throw Throwables.propagate(e); } }