Source:
<code>public CuratorFramework makeCurator(CuratorConfig config, EnsembleProvider ensembleProvider, Lifecycle lifecycle) { final Builder builder = CuratorFrameworkFactory.builder(); if (!Strings.isNullOrEmpty(config.getZkUser()) && !Strings.isNullOrEmpty(config.getZkPwd())) { builder.authorization( config.getAuthScheme(), StringUtils.format("%s:%s", config.getZkUser(), config.getZkPwd()).getBytes(StandardCharsets.UTF_8) ); } final Function<Void, Void> exitFunction = new Function<Void, Void>() { @Override public Void apply(Void someVoid) { log.error("Zookeeper can't be reached, forcefully stopping lifecycle..."); lifecycle.stop(); log.error("Zookeeper can't be reached, forcefully stopping virtual machine..."); System.exit(1); return null; } }; final CuratorFramework framework = builder .ensembleProvider(ensembleProvider) .sessionTimeoutMs(config.getZkSessionTimeoutMs()) <START> .retryPolicy(config.getQuitOnConnectFail() ? new BoundedExponentialBackoffRetryWithQuit(exitFunction, BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES) : new BoundedExponentialBackoffRetry(BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES)) <END> .compressionProvider(new PotentiallyGzippedCompressionProvider(config.getEnableCompression())) .aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider()) .build(); framework.getUnhandledErrorListenable().addListener((message, e) -> { log.error(e, "Unhandled error in Curator Framework"); try { lifecycle.stop(); } catch (Throwable t) { log.warn(t, "Exception when stopping druid lifecycle"); } }); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() { log.info("Starting Curator"); framework.start(); } @Override public void stop() { log.info("Stopping Curator"); framework.close(); } } ); return framework; }</code><technical_language>Line longer 120 cols. Extract a variable</technical_language>

Target:
public CuratorFramework makeCurator(CuratorConfig config, EnsembleProvider ensembleProvider, Lifecycle lifecycle) { final Builder builder = CuratorFrameworkFactory.builder(); if (!Strings.isNullOrEmpty(config.getZkUser()) && !Strings.isNullOrEmpty(config.getZkPwd())) { builder.authorization( config.getAuthScheme(), StringUtils.format("%s:%s", config.getZkUser(), config.getZkPwd()).getBytes(StandardCharsets.UTF_8) ); } RetryPolicy retryPolicy; if (config.getTerminateDruidProcessOnConnectFail()) { final Runnable exitRunner = () -> { try { log.error("Zookeeper can't be reached, forcefully stopping lifecycle..."); lifecycle.stop(); System.err.println("Zookeeper can't be reached, forcefully stopping virtual machine..."); } finally { System.exit(1); } }; retryPolicy = new BoundedExponentialBackoffRetryWithQuit( exitRunner, BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES ); } else { retryPolicy = new BoundedExponentialBackoffRetry(BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES); } final CuratorFramework framework = builder .ensembleProvider(ensembleProvider) .sessionTimeoutMs(config.getZkSessionTimeoutMs()) .retryPolicy(retryPolicy) .compressionProvider(new PotentiallyGzippedCompressionProvider(config.getEnableCompression())) .aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider()) .build(); framework.getUnhandledErrorListenable().addListener((message, e) -> { log.error(e, "Unhandled error in Curator Framework"); try { lifecycle.stop(); } catch (Throwable t) { log.warn(t, "Exception when stopping druid lifecycle"); } }); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() { log.info("Starting Curator"); framework.start(); } @Override public void stop() { log.info("Stopping Curator"); framework.close(); } } ); return framework; }